|
SemiDrive SSDK Appication Program Interface PTG3.0
|
Go to the source code of this file.
Data Structures | |
| struct | cmd_sm2_getZ_t |
| struct | cmd_sm2_getE_t |
| struct | cmd_sm2_generatekey_t |
| struct | cmd_sm2_get_pubkey_from_prikey_t |
| struct | cmd_sm2_generatesignature_t |
| struct | cmd_sm2_verifysignature_t |
| struct | cmd_sm2_encrypt_t |
| struct | cmd_sm2_decrypt_t |
| struct | sm2_exc_key_input_ptr_t |
| struct | cmd_sm2_exchangekey_keyinfo_t |
| struct | cmd_sm2_exchangekey_t |
Functions | |
| sdrv_crypto_error_status_e | cmd_sm2_get_z (uint8_t *id, uint32_t id_len, uint8_t *pubkey, uint8_t *z_buf) |
| sdrv_crypto_error_status_e | cmd_sm2_get_e (uint8_t *msg, uint32_t msg_len, uint8_t *z_buf, uint8_t *e_buf) |
| sdrv_crypto_error_status_e | cmd_sm2_get_pubkey_from_prikey (uint8_t *prikey, uint8_t *pubkey) |
| sdrv_crypto_error_status_e | cmd_sm2_generatekey (cmd_key_type_e generate_key_type, uint16_t generate_key_id, uint8_t *prikey, uint8_t *pubkey, uint8_t *mac_buf) |
| sdrv_crypto_error_status_e | cmd_sm2_sign (uint8_t *e, uint8_t *prikey, cmd_key_type_e generate_sign_key_type, uint16_t generate_sign_key_id, uint8_t *signature, uint8_t *mac_buf) |
| sdrv_crypto_error_status_e | cmd_sm2_verify (uint8_t *e, uint8_t *pubkey, uint8_t *signature) |
| sdrv_crypto_error_status_e | cmd_sm2_enc (uint8_t *msg, uint32_t msg_len, uint8_t *pubkey, uint8_t *cipher) |
| sdrv_crypto_error_status_e | cmd_sm2_dec (uint8_t *prikey, uint8_t *msg, uint8_t *cipher, uint32_t cipher_len, cmd_key_type_e decrypt_key_type, uint16_t decrypt_key_id, uint8_t *mac_buf) |
| sdrv_crypto_error_status_e | cmd_sm2_set_exckey_input_ptr (uint8_t *dA, uint8_t *RA, uint8_t *rA, uint8_t *RB, uint8_t *PB, uint8_t *ZA, uint8_t *ZB, sm2_exc_key_input_ptr_t *cmd_sm2_exc_key_input) |
| sdrv_crypto_error_status_e | cmd_sm2_exchange_key (cmd_sm2_exchange_role_e role, cmd_sm2_exchangekey_keyinfo_t *cmd_sm2_exckey_keyinfo, sm2_exc_key_input_ptr_t *cmd_sm2_exc_key_input, uint32_t kbytelen, uint8_t *S1, uint8_t *SA, uint8_t *KA, uint8_t *mac_buf) |
| sdrv_crypto_error_status_e cmd_sm2_dec | ( | uint8_t * | prikey, |
| uint8_t * | msg, | ||
| uint8_t * | cipher, | ||
| uint32_t | cipher_len, | ||
| cmd_key_type_e | decrypt_key_type, | ||
| uint16_t | decrypt_key_id, | ||
| uint8_t * | mac_buf | ||
| ) |
sm2 dec
This function sm2 dec
| [in] | prikey | prikey buff |
| [out] | msg | msg buff |
| [in] | cipher | cipher buff |
| [in] | cipher_len | cipher_len |
| [in] | decrypt_key_type | key type |
| [in] | decrypt_key_id | key id |
| [in] | mac_buff | mac buff |
| sdrv_crypto_error_status_e cmd_sm2_enc | ( | uint8_t * | msg, |
| uint32_t | msg_len, | ||
| uint8_t * | pubkey, | ||
| uint8_t * | cipher | ||
| ) |
sm2 enc
This function sm2 enc
| [in] | msg | msg buff |
| [in] | msg_len | msg_len |
| [in] | pubkey | pubkey buff |
| [out] | cipher | cipher buff |
| sdrv_crypto_error_status_e cmd_sm2_exchange_key | ( | cmd_sm2_exchange_role_e | role, |
| cmd_sm2_exchangekey_keyinfo_t * | cmd_sm2_exckey_keyinfo, | ||
| sm2_exc_key_input_ptr_t * | cmd_sm2_exc_key_input, | ||
| uint32_t | kbytelen, | ||
| uint8_t * | S1, | ||
| uint8_t * | SA, | ||
| uint8_t * | KA, | ||
| uint8_t * | mac_buf | ||
| ) |
sm2 exchange key
This function exchange key, mac_buf len is CMD_BASIC_TWO_KEY_MAC_BUFF_LEN 64
| [in] | role | exchange key role |
| [in] | cmd_sm2_exckey_keyinfo | exckey keyinfo |
| [in] | cmd_sm2_exc_key_input | exckey key input |
| [in] | kbytelen | kbytelen |
| [in] | S1 | S1 buff |
| [in] | SA | SA buff |
| [out] | KA | KA buff |
| [in] | mac_buff | mac buff |
| sdrv_crypto_error_status_e cmd_sm2_generatekey | ( | cmd_key_type_e | generate_key_type, |
| uint16_t | generate_key_id, | ||
| uint8_t * | prikey, | ||
| uint8_t * | pubkey, | ||
| uint8_t * | mac_buf | ||
| ) |
sm2 generatekey
This function sm2 generatekey.
| [in] | generate_key_type | out put key type |
| [in] | generate_key_id | enc key id |
| [out] | prikey | prikey buff |
| [out] | pubkey | pubkey buff |
| [in] | mac_buf | mac buff |
| sdrv_crypto_error_status_e cmd_sm2_get_e | ( | uint8_t * | msg, |
| uint32_t | msg_len, | ||
| uint8_t * | z_buf, | ||
| uint8_t * | e_buf | ||
| ) |
get e value
This function sm2 get e value
| [in] | msg | msg buff |
| [in] | msg_len | msg len |
| [in] | z_buff | z buff |
| [out] | e_buff | out buff |
| sdrv_crypto_error_status_e cmd_sm2_get_pubkey_from_prikey | ( | uint8_t * | prikey, |
| uint8_t * | pubkey | ||
| ) |
sm2 get pubkey
This function get pubkey from prikey.
| [in] | prikey | prikey buff |
| [out] | pubkey | out buff |
| sdrv_crypto_error_status_e cmd_sm2_get_z | ( | uint8_t * | id, |
| uint32_t | id_len, | ||
| uint8_t * | pubkey, | ||
| uint8_t * | z_buf | ||
| ) |
sm2 get z value
This function get z.
| [in] | id | id buff |
| [in] | id_len | id len |
| [in] | pubkey | pubkey buff |
| [out] | z_buff | out buff |
| sdrv_crypto_error_status_e cmd_sm2_set_exckey_input_ptr | ( | uint8_t * | dA, |
| uint8_t * | RA, | ||
| uint8_t * | rA, | ||
| uint8_t * | RB, | ||
| uint8_t * | PB, | ||
| uint8_t * | ZA, | ||
| uint8_t * | ZB, | ||
| sm2_exc_key_input_ptr_t * | cmd_sm2_exc_key_input | ||
| ) |
sm2 set exckey value
This function set exckey value
| [in] | dA | dA buff |
| [in] | RA | RA buff |
| [in] | rA | rA buff |
| [in] | RB | RB buff |
| [in] | PB | PB buff |
| [in] | ZA | ZA buff |
| [in] | ZB | ZB buff |
| [out] | cmd_sm2_exc_key_input | exc_key_input buff |
| sdrv_crypto_error_status_e cmd_sm2_sign | ( | uint8_t * | e, |
| uint8_t * | prikey, | ||
| cmd_key_type_e | generate_sign_key_type, | ||
| uint16_t | generate_sign_key_id, | ||
| uint8_t * | signature, | ||
| uint8_t * | mac_buf | ||
| ) |
sm2 sign
This function sm2 sign
| [in] | e | e buff |
| [in] | prikey | prikey buff |
| [in] | generate_sign_key_type | sign key type |
| [in] | generate_sign_key_id | sign key id |
| [out] | signature | signature buff |
| [in] | mac_buf | mac buff |
| sdrv_crypto_error_status_e cmd_sm2_verify | ( | uint8_t * | e, |
| uint8_t * | pubkey, | ||
| uint8_t * | signature | ||
| ) |
sm2 verify
This function sm2 verify
| [in] | e | e buff |
| [in] | pubkey | pubkey buff |
| [out] | signature | signature buff |