22#define SM2_BIT_LEN (256)
23#define SM2_BYTE_LEN (32)
24#define SM2_WORD_LEN (8)
25#define SM3_DIGEST_BYTE_LEN SM2_BYTE_LEN
26#define SM2_MAX_ID_BYTE_LEN (1 << 13)
62uint32_t
sm2_getZ(uint8_t *ID, uint32_t byteLenofID, uint8_t pubKey[65],
65uint32_t
sm2_getE(uint8_t *M, uint32_t byteLen, uint8_t Z[32], uint8_t E[32]);
69uint32_t
sm2_getkey(uint8_t priKey[32], uint8_t pubKey[65]);
72 uint8_t *k, uint32_t kByteLen);
Semidrive CRYPTO pke header file.
@ PKE_SUCCESS
Definition: pke.h:101
const uint32_t sm2p256v1_n_1[8]
sm2_exchange_role_e
Definition: sm2_basic.h:42
@ SM2_ROLE_RESPONSOR
Definition: sm2_basic.h:44
@ SM2_ROLE_MAX
Definition: sm2_basic.h:45
@ SM2_ROLE_SPONSOR
Definition: sm2_basic.h:43
SM2_RET_CODE
Definition: sm2_basic.h:29
@ SM2_NOT_ON_CURVE
Definition: sm2_basic.h:32
@ SM2_SUCCESS
Definition: sm2_basic.h:30
@ SM2_BUFFER_NULL
Definition: sm2_basic.h:31
@ SM2_INPUT_INVALID
Definition: sm2_basic.h:34
@ SM2_EXCHANGE_ROLE_INVALID
Definition: sm2_basic.h:33
@ SM2_INTEGER_TOO_BIG
Definition: sm2_basic.h:36
@ SM2_ZERO_ALL
Definition: sm2_basic.h:35
@ SM2_VERIFY_FAILED
Definition: sm2_basic.h:37
@ SM2_DECRYPT_VERIFY_FAILED
Definition: sm2_basic.h:38
uint32_t sm2_get_pubkey_from_prikey(uint8_t priKey[32], uint8_t pubKey[65])
const uint32_t sm2p256v1_Gx[8]
const uint32_t sm2p256v1_n_h[8]
uint32_t sm2_getZ(uint8_t *ID, uint32_t byteLenofID, uint8_t pubKey[65], uint8_t Z[32])
const uint32_t sm2p256v1_n[8]
const eccp_curve_t sm2_curve[1]
uint32_t sm2_kdf_with_xor(uint8_t *in, uint32_t inByteLen, uint8_t *m, uint8_t *k, uint32_t kByteLen)
uint32_t sm2_getE(uint8_t *M, uint32_t byteLen, uint8_t Z[32], uint8_t E[32])
sm2_cipher_order_e
Definition: sm2_basic.h:49
@ SM2_C1C3C2
Definition: sm2_basic.h:50
@ SM2_C1C2C3
Definition: sm2_basic.h:51
uint32_t sm2_getkey(uint8_t priKey[32], uint8_t pubKey[65])
void uint32_BigNum_Add_One(uint32_t *a, uint32_t wordLen)
const uint32_t sm2p256v1_Gy[8]
Definition: eccp_curve.h:32