SemiDrive SSDK Appication Program Interface PTG3.0
sm2.h File Reference
#include <pke.h>
#include "sm2_basic.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

Function Documentation

◆ sm2_decrypt()

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 
)

◆ sm2_encrypt()

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_exchangekey()

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 
)

◆ sm2_sign()

uint32_t sm2_sign ( uint8_t  E[32],
uint8_t  rand_k[32],
uint8_t  priKey[32],
uint8_t  signature[64] 
)

◆ sm2_verify()

uint32_t sm2_verify ( uint8_t  E[32],
uint8_t  pubKey[65],
uint8_t  signature[64] 
)