summaryrefslogtreecommitdiffstats
path: root/crypto/include
diff options
context:
space:
mode:
authorPaul Yang <yang.yang@baishancloud.com>2018-09-04 01:24:55 +0800
committerPaul Yang <yang.yang@baishancloud.com>2018-09-07 18:12:26 +0800
commit00433bad41bfa492f2e204675d42061314028ff2 (patch)
tree3be74f013f2cc7900f301e6f67dc753137393566 /crypto/include
parent0a8fdef7523ae796ca2e734c279791737148c001 (diff)
Make SM2 ID stick to specification
Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/7113)
Diffstat (limited to 'crypto/include')
-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.