SemiDrive SSDK Appication Program Interface PTG3.0
sm2_basic.h File Reference
#include <pke.h>

Go to the source code of this file.

Macro Definition Documentation

◆ SM2_BIT_LEN

#define SM2_BIT_LEN   (256)

◆ SM2_BYTE_LEN

#define SM2_BYTE_LEN   (32)

◆ SM2_HIGH_SPEED

#define SM2_HIGH_SPEED

◆ SM2_MAX_ID_BYTE_LEN

#define SM2_MAX_ID_BYTE_LEN   (1 << 13)

◆ SM2_WORD_LEN

#define SM2_WORD_LEN   (8)

◆ SM3_DIGEST_BYTE_LEN

#define SM3_DIGEST_BYTE_LEN   SM2_BYTE_LEN

Enumeration Type Documentation

◆ sm2_cipher_order_e

Enumerator
SM2_C1C3C2 
SM2_C1C2C3 

◆ sm2_exchange_role_e

Enumerator
SM2_ROLE_SPONSOR 
SM2_ROLE_RESPONSOR 
SM2_ROLE_MAX 

◆ SM2_RET_CODE

Enumerator
SM2_SUCCESS 
SM2_BUFFER_NULL 
SM2_NOT_ON_CURVE 
SM2_EXCHANGE_ROLE_INVALID 
SM2_INPUT_INVALID 
SM2_ZERO_ALL 
SM2_INTEGER_TOO_BIG 
SM2_VERIFY_FAILED 
SM2_DECRYPT_VERIFY_FAILED 

Function Documentation

◆ sm2_get_pubkey_from_prikey()

uint32_t sm2_get_pubkey_from_prikey ( uint8_t  priKey[32],
uint8_t  pubKey[65] 
)

◆ sm2_getE()

uint32_t sm2_getE ( uint8_t *  M,
uint32_t  byteLen,
uint8_t  Z[32],
uint8_t  E[32] 
)

◆ sm2_getkey()

uint32_t sm2_getkey ( uint8_t  priKey[32],
uint8_t  pubKey[65] 
)

◆ sm2_getZ()

uint32_t sm2_getZ ( uint8_t *  ID,
uint32_t  byteLenofID,
uint8_t  pubKey[65],
uint8_t  Z[32] 
)

◆ sm2_kdf_with_xor()

uint32_t sm2_kdf_with_xor ( uint8_t *  in,
uint32_t  inByteLen,
uint8_t *  m,
uint8_t *  k,
uint32_t  kByteLen 
)

◆ uint32_BigNum_Add_One()

void uint32_BigNum_Add_One ( uint32_t *  a,
uint32_t  wordLen 
)

Variable Documentation

◆ sm2_curve

const eccp_curve_t sm2_curve[1]
extern

◆ sm2p256v1_Gx

const uint32_t sm2p256v1_Gx[8]
extern

◆ sm2p256v1_Gy

const uint32_t sm2p256v1_Gy[8]
extern

◆ sm2p256v1_n

const uint32_t sm2p256v1_n[8]
extern

◆ sm2p256v1_n_1

const uint32_t sm2p256v1_n_1[8]
extern

◆ sm2p256v1_n_h

const uint32_t sm2p256v1_n_h[8]
extern