SemiDrive SSDK Appication Program Interface PTG3.0
Data Structures | Functions
sdrv_crypto_mailbox_eccp.h File Reference
#include "sdrv_crypto_mailbox_common.h"
#include "sdrv_crypto_mailbox_trng.h"

Go to the source code of this file.

Data Structures

struct  cmd_eccp_basic_vectors_t
 
struct  cmd_eccp_pointdoubling_t
 
struct  cmd_eccp_pointaddition_t
 
struct  cmd_eccp_pointmultiplication_t
 
struct  cmd_eccp_pointverifying_t
 
struct  cmd_eccp_generatekey_t
 
struct  cmd_ecdh_exchangekey_t
 
struct  cmd_ecdsa_generatesignature_t
 
struct  cmd_ecdsa_verifysignature_t
 

Functions

sdrv_crypto_error_status_e cmd_eccp_point_doubling (uint8_t curve_id, uint8_t *G_x_y, uint8_t *output_x_y)
 
sdrv_crypto_error_status_e cmd_eccp_point_addition (uint8_t curve_id, uint8_t *kG_x_y, uint8_t *dblG_x_y, uint8_t *output_x_y)
 
sdrv_crypto_error_status_e cmd_eccp_point_multiplication (uint8_t curve_id, uint8_t *G_x_y, uint8_t *k, uint8_t *output_x_y)
 
sdrv_crypto_error_status_e cmd_eccp_point_verify (uint8_t curve_id, uint8_t *G_x_y)
 
sdrv_crypto_error_status_e cmd_eccp_ecdh_generate_keypair (uint8_t curve_id, uint8_t *prikey, uint8_t *pubkey, cmd_key_type_e generate_key_type, uint16_t generate_key_id, uint8_t *mac_buf)
 
sdrv_crypto_error_status_e cmd_eccp_ecdh_exchange_key (uint8_t curve_id, uint8_t key_len, uint8_t *KA, uint8_t *pubkey_B, uint8_t *prikey_A, cmd_key_type_e ecdh_key_type, uint16_t ecdh_key_id, cmd_key_type_e output_key_type, uint16_t output_key_id, uint8_t *mac_buf)
 
sdrv_crypto_error_status_e cmd_eccp_ecdsa_gen_signature (uint8_t curve_id, uint8_t *e, uint32_t e_len, cmd_key_type_e sign_key_type, uint16_t sign_key_id, uint8_t *prikey, uint8_t *signature, uint8_t *mac_buf)
 
sdrv_crypto_error_status_e cmd_eccp_ecdsa_verify_signature (uint8_t curve_id, uint8_t *e, uint32_t e_len, uint8_t *pubkey, uint8_t *signature)
 

Detailed Description

Macro Definition Documentation

◆ ECDSA_RAND_TEST

#define ECDSA_RAND_TEST

◆ ECDSA_RAND_TEST_COUNT

#define ECDSA_RAND_TEST_COUNT   (2)

Enumeration Type Documentation

◆ crypto_ECCcurvetype

ECC curve type.

Enumerator
SECP192R1 
SECP224R1 
SECP256R1 
SECP384R1 
SECP521R1 

Function Documentation

◆ cmd_eccp_ecdh_exchange_key()

sdrv_crypto_error_status_e cmd_eccp_ecdh_exchange_key ( uint8_t  curve_id,
uint8_t  key_len,
uint8_t *  KA,
uint8_t *  pubkey_B,
uint8_t *  prikey_A,
cmd_key_type_e  ecdh_key_type,
uint16_t  ecdh_key_id,
cmd_key_type_e  output_key_type,
uint16_t  output_key_id,
uint8_t *  mac_buf 
)

ecdh exchange key

This function for ecdh exchange key.

Parameters
[in]curve_idcurved id
[in]key_lenkey len
[out]KAkey buff
[in]pubkey_BPeerPubKey buff
[in]prikey_AselfPrikey buff
[in]ecdh_key_typeselfPrikey type
[in]ecdh_key_idfor enc key
[in]output_key_typeoutput key type
[in]output_key_idfor enc key
[in]mac_bufkey_id mac buf
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_ecdh_generate_keypair()

sdrv_crypto_error_status_e cmd_eccp_ecdh_generate_keypair ( uint8_t  curve_id,
uint8_t *  prikey,
uint8_t *  pubkey,
cmd_key_type_e  generate_key_type,
uint16_t  generate_key_id,
uint8_t *  mac_buf 
)

eccp generate ecdh keypair

This function generate ecdh keypair.

Parameters
[in]curve_idcurved id
[out]prikeyprikey buff
[out]pubkeypubkey buff
[in]generate_key_typepri and pub key output type
[in]generate_key_idfor enc key
[in]mac_bufkey_id mac buf
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_ecdsa_gen_signature()

sdrv_crypto_error_status_e cmd_eccp_ecdsa_gen_signature ( uint8_t  curve_id,
uint8_t *  e,
uint32_t  e_len,
cmd_key_type_e  sign_key_type,
uint16_t  sign_key_id,
uint8_t *  prikey,
uint8_t *  signature,
uint8_t *  mac_buf 
)

eccp ecdsa gen signature

This function for ecdsa gen signature.

Parameters
[in]curve_idcurved id
[in]ee value
[out]e_lene len
[in]sign_key_typesign key type
[in]sign_key_idsign key id
[in]prikeyprikey value
[out]signaturesignature value
[in]mac_bufkey_id mac buf
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_ecdsa_verify_signature()

sdrv_crypto_error_status_e cmd_eccp_ecdsa_verify_signature ( uint8_t  curve_id,
uint8_t *  e,
uint32_t  e_len,
uint8_t *  pubkey,
uint8_t *  signature 
)

eccp point verify

This function verify eccp point.

Parameters
[in]curve_idcurved id
[in]ee value
[out]e_lene len
[in]pubkeypubkey value
[in]signaturesignature value
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_point_addition()

sdrv_crypto_error_status_e cmd_eccp_point_addition ( uint8_t  curve_id,
uint8_t *  kG_x_y,
uint8_t *  dblG_x_y,
uint8_t *  output_x_y 
)

eccp point addition

This function get eccp point addition.

Parameters
[in]curve_idcurve_id
[in]kG_x_ykG_x_y buff
[in]dblG_x_ydblG_x_y buff
[out]output_x_yout buff
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_point_doubling()

sdrv_crypto_error_status_e cmd_eccp_point_doubling ( uint8_t  curve_id,
uint8_t *  G_x_y,
uint8_t *  output_x_y 
)

eccp point doubling

This function get eccp point doubling.

Parameters
[in]curve_idcurve_id
[in]G_x_ycurve xy buff
[out]output_x_yout buff
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_point_multiplication()

sdrv_crypto_error_status_e cmd_eccp_point_multiplication ( uint8_t  curve_id,
uint8_t *  G_x_y,
uint8_t *  k,
uint8_t *  output_x_y 
)

eccp point multplication

This function get eccp point multplication.

Parameters
[in]curve_idcurved id
[in]G_x_ypoint value
[in]kscalar value
[out]output_x_yout buff
Returns
CMD_RETURN_SUCCESS or error code.

◆ cmd_eccp_point_verify()

sdrv_crypto_error_status_e cmd_eccp_point_verify ( uint8_t  curve_id,
uint8_t *  G_x_y 
)

eccp point verify

This function verify eccp point.

Parameters
[in]curve_idcurved id
[in]G_x_ypoint value
Returns
CMD_RETURN_SUCCESS or error code.