Elliptic Curve keypair APIs. More...

Functions

gos_result_t gos_atca_calculate_public_key (uint16_t slot_id, uint8_t *public_key)
 
gos_result_t gos_atca_write_public_key (uint16_t slot_id, uint8_t *public_key)
 
gos_result_t gos_atca_generate_keypair (uint16_t slot_id, uint8_t *public_key)
 
gos_result_t gos_atca_get_public_key (uint16_t slot_id, uint8_t *public_key)
 

Detailed Description

Elliptic Curve keypair APIs.

Function Documentation

◆ gos_atca_calculate_public_key()

gos_result_t gos_atca_calculate_public_key ( uint16_t  slot_id,
uint8_t *  public_key 
)

Calculate the EC public key based on the private key at the specified slot

Parameters
[in]slot_idSlot with existing private key
[out]public_keyCalculated public key. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve.
Returns
gos_result_t result of API
Examples:
demo/secure_element/commands.c.

◆ gos_atca_generate_keypair()

gos_result_t gos_atca_generate_keypair ( uint16_t  slot_id,
uint8_t *  public_key 
)

Issues GenKey command, which generates a new random private key in slot and returns the public key.

Parameters
[in]slot_idSlot number where an ECC private key is configured. Can also be ATCA_TEMPKEY_KEYID to generate a private key in TempKey.
[out]public_keyPublic key will be returned here. Format will be the X and Y integers in big-endian format. 64 bytes for P256 curve. Set to NULL if public key isn't required.
Returns
gos_result_t result of API
Examples:
demo/secure_element/se_utils.c.

◆ gos_atca_get_public_key()

gos_result_t gos_atca_get_public_key ( uint16_t  slot_id,
uint8_t *  public_key 
)

Executes Read command to read an ECC P256 public key from a slot configured for clear reads.

This function assumes the public key is stored using the ECC public key format specified in the datasheet.

Parameters
[in]slot_idSlot number to read from. Only slots 8 to 15 are large enough for a public key.
[out]public_keyPublic key is returned here (64 bytes). Format will be the 32 byte X and Y big-endian integers concatenated.
Returns
gos_result_t result of API
Examples:
demo/secure_element/commands.c.

◆ gos_atca_write_public_key()

gos_result_t gos_atca_write_public_key ( uint16_t  slot_id,
uint8_t *  public_key 
)

Executes the Write command, which writes a public key to a data slot in the SE format

Parameters
[in]slot_idSlot number to write. Only slots 8 to 15 are large enough to store a public key.
[in]public_keyPublic key to write into the slot specified. X and Y integers in big-endian format. 64 bytes for P256 curve.
Returns
gos_result_t result of API
Examples:
demo/secure_element/commands.c.