summaryrefslogtreecommitdiffstats
path: root/crypto/include/internal/sm2.h
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/include/internal/sm2.h')
-rw-r--r--crypto/include/internal/sm2.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/crypto/include/internal/sm2.h b/crypto/include/internal/sm2.h
index 11af248b5a..26a90660ee 100644
--- a/crypto/include/internal/sm2.h
+++ b/crypto/include/internal/sm2.h
@@ -20,18 +20,28 @@
/* The default user id as specified in GM/T 0009-2012 */
# define SM2_DEFAULT_USERID "1234567812345678"
+int sm2_compute_userid_digest(uint8_t *out,
+ const EVP_MD *digest,
+ const uint8_t *id,
+ const size_t id_len,
+ const EC_KEY *key);
+
/*
* SM2 signature operation. Computes ZA (user id digest) and then signs
* H(ZA || msg) using SM2
*/
ECDSA_SIG *sm2_do_sign(const EC_KEY *key,
const EVP_MD *digest,
- const char *user_id, const uint8_t *msg, size_t msg_len);
+ const uint8_t *id,
+ const size_t id_len,
+ const uint8_t *msg, size_t msg_len);
int sm2_do_verify(const EC_KEY *key,
const EVP_MD *digest,
const ECDSA_SIG *signature,
- const char *user_id, const uint8_t *msg, size_t msg_len);
+ const uint8_t *id,
+ const size_t id_len,
+ const uint8_t *msg, size_t msg_len);
/*
* SM2 signature generation.