24#define SM2_BIT_LEN (256)
25#define SM2_BYTE_LEN (32)
26#define SM2_WORD_LEN (8)
27#define SM3_DIGEST_BYTE_LEN SM2_BYTE_LEN
28#define SM2_MAX_ID_BYTE_LEN (1 << 13)
30uint32_t
sm2_sign(uint8_t E[32], uint8_t rand_k[32], uint8_t priKey[32],
31 uint8_t signature[64]);
33uint32_t
sm2_verify(uint8_t E[32], uint8_t pubKey[65], uint8_t signature[64]);
35uint32_t
sm2_encrypt(uint8_t *M, uint32_t MByteLen, uint8_t rand_k[32],
39uint32_t
sm2_decrypt(uint8_t *C, uint32_t CByteLen, uint8_t priKey[32],
43 uint8_t *rA, uint8_t *RA, uint8_t *RB, uint8_t *ZA,
44 uint8_t *ZB, uint32_t kByteLen, uint8_t *KA,
45 uint8_t *S1, uint8_t *SA);
52enum SM2_RET_CODE_S { SM2_SUCCESS_S = 0x3E2FDB1A, SM2_ERROR_S = 0xCBAD735E };
54uint32_t sm2_sign_s(uint8_t E[32], uint8_t rand_k[32], uint8_t priKey[32],
55 uint8_t signature[64]);
57uint32_t sm2_verify_s(uint8_t E[32], uint8_t pubKey[65], uint8_t signature[64]);
59uint32_t sm2_encrypt_s(uint8_t *M, uint32_t MByteLen, uint8_t rand_k[32],
63uint32_t sm2_decrypt_s(uint8_t *C, uint32_t CByteLen, uint8_t priKey[32],
68 uint8_t *rA, uint8_t *RA, uint8_t *RB, uint8_t *ZA,
69 uint8_t *ZB, uint32_t kByteLen, uint8_t *KA,
70 uint8_t *S1, uint8_t *SA);
Semidrive CRYPTO pke header file.
uint32_t sm2_verify(uint8_t E[32], uint8_t pubKey[65], uint8_t signature[64])
uint32_t sm2_decrypt(uint8_t *C, uint32_t CByteLen, uint8_t priKey[32], sm2_cipher_order_e order, uint8_t *M, uint32_t *MByteLen)
uint32_t sm2_sign(uint8_t E[32], uint8_t rand_k[32], uint8_t priKey[32], uint8_t signature[64])
uint32_t sm2_exchangekey(sm2_exchange_role_e role, uint8_t *dA, uint8_t *PB, uint8_t *rA, uint8_t *RA, uint8_t *RB, uint8_t *ZA, uint8_t *ZB, uint32_t kByteLen, uint8_t *KA, uint8_t *S1, uint8_t *SA)
uint32_t sm2_encrypt(uint8_t *M, uint32_t MByteLen, uint8_t rand_k[32], uint8_t pubKey[65], sm2_cipher_order_e order, uint8_t *C, uint32_t *CByteLen)
sm2_exchange_role_e
Definition: sm2_basic.h:42
sm2_cipher_order_e
Definition: sm2_basic.h:49