summaryrefslogtreecommitdiff
path: root/crypto/sm2/sm2_sign.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/sm2/sm2_sign.c')
-rw-r--r--crypto/sm2/sm2_sign.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/crypto/sm2/sm2_sign.c b/crypto/sm2/sm2_sign.c
index 4ca0ca8006..9d1905439a 100644
--- a/crypto/sm2/sm2_sign.c
+++ b/crypto/sm2/sm2_sign.c
@@ -282,7 +282,7 @@ int sm2_do_verify(const EC_KEY *key,
return ret;
}
-int sm2_sign(int type, const unsigned char *dgst, int dgstlen,
+int sm2_sign(const unsigned char *dgst, int dgstlen,
unsigned char *sig, unsigned int *siglen, EC_KEY *eckey)
{
BIGNUM *e = NULL;
@@ -290,11 +290,6 @@ int sm2_sign(int type, const unsigned char *dgst, int dgstlen,
int sigleni;
int ret = -1;
- if (type != NID_sm3 || dgstlen != 32) {
- SM2err(SM2_F_SM2_SIGN, SM2_R_INVALID_DIGEST_TYPE);
- goto done;
- }
-
e = BN_bin2bn(dgst, dgstlen, NULL);
if (e == NULL) {
SM2err(SM2_F_SM2_SIGN, ERR_R_BN_LIB);
@@ -318,7 +313,7 @@ int sm2_sign(int type, const unsigned char *dgst, int dgstlen,
return ret;
}
-int sm2_verify(int type, const unsigned char *dgst, int dgstlen,
+int sm2_verify(const unsigned char *dgst, int dgstlen,
const unsigned char *sig, int sig_len, EC_KEY *eckey)
{
ECDSA_SIG *s = NULL;
@@ -328,11 +323,6 @@ int sm2_verify(int type, const unsigned char *dgst, int dgstlen,
int derlen = -1;
int ret = -1;
- if (type != NID_sm3) {
- SM2err(SM2_F_SM2_VERIFY, SM2_R_INVALID_DIGEST_TYPE);
- goto done;
- }
-
s = ECDSA_SIG_new();
if (s == NULL) {
SM2err(SM2_F_SM2_VERIFY, ERR_R_MALLOC_FAILURE);