Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add crypto pubkey SM2 #9

Closed
wants to merge 2 commits into from
Closed

Add crypto pubkey SM2 #9

wants to merge 2 commits into from

Conversation

uudiin
Copy link
Contributor

@uudiin uudiin commented Dec 20, 2019

This new module implement the SM2 public key algorithm. It was
published by State Encryption Management Bureau, China.
List of specifications for SM2 elliptic curve public key cryptography:

  • GM/T 0003.1-2012
  • GM/T 0003.2-2012
  • GM/T 0003.3-2012
  • GM/T 0003.4-2012
  • GM/T 0003.5-2012

IETF: https://tools.ietf.org/html/draft-shen-sm2-ecdsa-02
scctc: http://www.gmbz.org.cn/main/bzlb.html

  • cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm2.c.
  • cipher/ecc-curves.c (domain_parms): Add sm2p256v1 for SM2.
  • cipher/pubkey.c [USE_SM2] (pubkey_list): Add _gcry_pubkey_spec_sm2.
  • cipher/sm2.c: New.
  • configure.ac (available_pubkey_ciphers): Add sm2.
  • src/cipher.h: Add declarations for SM2.
  • src/fips.c (algos): Add GCRY_PK_SM2.
  • src/gcrypt.h.in (gcry_pk_algos): Add algorithm ID for SM2.
  • tests/basic.c (check_pubkey): Add test cases for SM2.
  • tests/curves.c (N_CURVES): Update N_CURVES for SM2.

Signed-off-by: Tianjia Zhang tianjia.zhang@linux.alibaba.com

There are ecc-based public key algorithms that use these functions.
such as SM2.

* cipher/ecc.c: Export common functions and add '_gcry_ecc' prefix.
* cipher/pubkey-internal.h: Add declarations for ecc common functions.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
* cipher/Makefile.am (EXTRA_libcipher_la_SOURCES): Add sm2.c.
* cipher/ecc-curves.c (domain_parms): Add sm2p256v1 for SM2.
* cipher/pubkey.c [USE_SM2] (pubkey_list): Add _gcry_pubkey_spec_sm2.
* cipher/sm2.c: New.
* configure.ac (available_pubkey_ciphers): Add sm2.
* src/cipher.h: Add declarations for SM2.
* src/fips.c (algos): Add GCRY_PK_SM2.
* src/gcrypt.h.in (gcry_pk_algos): Add algorithm ID for SM2.
* tests/basic.c (check_pubkey): Add test cases for SM2.
* tests/curves.c (N_CURVES): Update N_CURVES for SM2.

Signed-off-by: Tianjia Zhang <tianjia.zhang@linux.alibaba.com>
@jeroen
Copy link

jeroen commented Dec 21, 2019

This is a read only mirror. I recommend you send the patch to the gnupg-devel mailing list.

@jeroen jeroen closed this Dec 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants