Update sm9 functions

This commit is contained in:
Zhi Guan
2018-12-07 16:32:12 +08:00
parent 6f5b7a4c96
commit 1c00e47681
11 changed files with 5613 additions and 14 deletions

View File

@@ -75,7 +75,7 @@ int SM2_ciphertext_size(const EC_KEY *ec_key, size_t inlen)
int len = 0, i;
if (inlen > SM2_MAX_PLAINTEXT_LENGTH) {
SM2err(SM2_F_SM2CIPHERTEXTVALUE_SIZE, SM2_R_PLAINTEXT_TOO_LONG);
SM2err(SM2_F_SM2_CIPHERTEXT_SIZE, SM2_R_PLAINTEXT_TOO_LONG);
return 0;
}
@@ -89,7 +89,7 @@ int SM2_ciphertext_size(const EC_KEY *ec_key, size_t inlen)
/* ASN1_INTEGER xCoordinate, yCoordinate */
if (!(i = EC_GROUP_order_bits(group))) {
SM2err(SM2_F_SM2CIPHERTEXTVALUE_SIZE, ERR_R_EC_LIB);
SM2err(SM2_F_SM2_CIPHERTEXT_SIZE, ERR_R_EC_LIB);
return 0;
}
a.length = (i + 7)/8;

View File

@@ -22,6 +22,7 @@ static ERR_STRING_DATA SM2_str_functs[] = {
{ERR_FUNC(SM2_F_I2O_SM2CIPHERTEXTVALUE), "i2o_SM2CiphertextValue"},
{ERR_FUNC(SM2_F_O2I_SM2CIPHERTEXTVALUE), "o2i_SM2CiphertextValue"},
{ERR_FUNC(SM2_F_SM2CIPHERTEXTVALUE_SIZE), "SM2CiphertextValue_size"},
{ERR_FUNC(SM2_F_SM2_CIPHERTEXT_SIZE), "SM2_ciphertext_size"},
{ERR_FUNC(SM2_F_SM2_DECRYPT), "SM2_decrypt"},
{ERR_FUNC(SM2_F_SM2_DO_DECRYPT), "SM2_do_decrypt"},
{ERR_FUNC(SM2_F_SM2_DO_ENCRYPT), "SM2_do_encrypt"},