Update SM2 methods

The default `./config` will enable the X86_64 ASM implementation of SM2. Use `./config -DGMSSL_NO_TURBO enable-ec_nistp_64_gcc_128` will enable the fast C implementation of SM2. The  `./config -DGMSSL_NO_TURBO` will use the original implementation.
This commit is contained in:
Zhi Guan
2019-01-26 17:26:03 +08:00
parent 674cada9bc
commit 7d5c18379f
8 changed files with 5433 additions and 5420 deletions

View File

@@ -455,12 +455,18 @@ int BN_nist_mod_224(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_384(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
int BN_nist_mod_521(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
# ifndef OPENSSL_NO_SM2
int BN_sm2_mod_256(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, BN_CTX *ctx);
# endif
const BIGNUM *BN_get0_nist_prime_192(void);
const BIGNUM *BN_get0_nist_prime_224(void);
const BIGNUM *BN_get0_nist_prime_256(void);
const BIGNUM *BN_get0_nist_prime_384(void);
const BIGNUM *BN_get0_nist_prime_521(void);
# ifndef OPENSSL_NO_SM2
const BIGNUM *BN_get0_sm2_prime_256(void);
# endif
int (*BN_nist_mod_func(const BIGNUM *p)) (BIGNUM *r, const BIGNUM *a,
const BIGNUM *field, BN_CTX *ctx);

View File

@@ -41,9 +41,9 @@ extern "C" {
*/
# define OPENSSL_VERSION_NUMBER 0x1010004fL
# ifdef OPENSSL_FIPS
# define OPENSSL_VERSION_TEXT "GmSSL 2.4.3 - OpenSSL 1.1.0d-fips 23 Jan 2019"
# define OPENSSL_VERSION_TEXT "GmSSL 2.4.4 - OpenSSL 1.1.0d-fips 26 Jan 2019"
# else
# define OPENSSL_VERSION_TEXT "GmSSL 2.4.3 - OpenSSL 1.1.0d 23 Jan 2019"
# define OPENSSL_VERSION_TEXT "GmSSL 2.4.4 - OpenSSL 1.1.0d 26 Jan 2019"
# endif
/*-