mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-24 05:53:49 +01:00
pkg/driver_cryptocell_310: add psa ecc P256R1 pub key deriv.
This commit is contained in:
parent
4b69d6aada
commit
5be3e25da9
@ -75,6 +75,22 @@ psa_status_t cryptocell_310_common_ecc_generate_key_pair(uint8_t *priv_key_buffe
|
||||
uint32_t *pub_key_buffer_length,
|
||||
CRYS_ECPKI_DomainID_t domain);
|
||||
|
||||
/**
|
||||
* @brief Common ECC public key derivation function (not supported)
|
||||
*
|
||||
* @param priv_key_buffer Input buffer to read ECC private key
|
||||
* @param pub_key_buffer Output buffer to write ECC public key
|
||||
* @param priv_key_buffer_length Length of private key
|
||||
* @param pub_key_buffer_length Output pointer to write public key length
|
||||
* @param domain ECC domain of type @c CRYS_ECPKI_DomainID_t
|
||||
* @return psa_status_t
|
||||
*/
|
||||
psa_status_t cryptocell_310_common_ecc_derive_pub_key(const uint8_t *priv_key_buffer,
|
||||
uint8_t *pub_key_buffer,
|
||||
uint32_t priv_key_buffer_length,
|
||||
uint32_t *pub_key_buffer_length,
|
||||
CRYS_ECPKI_DomainID_t domain);
|
||||
|
||||
/**
|
||||
* @brief Common ECC signature function
|
||||
*
|
||||
|
||||
@ -72,6 +72,21 @@ psa_status_t cryptocell_310_common_ecc_generate_key_pair(uint8_t *priv_key_buffe
|
||||
return PSA_SUCCESS;
|
||||
}
|
||||
|
||||
psa_status_t cryptocell_310_common_ecc_derive_pub_key(const uint8_t *priv_key_buffer,
|
||||
uint8_t *pub_key_buffer,
|
||||
uint32_t priv_key_buffer_length,
|
||||
uint32_t *pub_key_buffer_length,
|
||||
CRYS_ECPKI_DomainID_t domain)
|
||||
{
|
||||
(void) priv_key_buffer;
|
||||
(void) pub_key_buffer;
|
||||
(void) priv_key_buffer_length;
|
||||
(void) pub_key_buffer_length;
|
||||
(void) domain;
|
||||
DEBUG("cryptocell_310 does not support key derivation.\n");
|
||||
return PSA_ERROR_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
psa_status_t cryptocell_310_common_ecc_sign(const uint8_t *priv_key,
|
||||
uint32_t priv_key_size,
|
||||
const uint8_t *input,
|
||||
|
||||
@ -35,6 +35,16 @@ psa_status_t psa_generate_ecc_p256r1_key_pair( const psa_key_attributes_t *attr
|
||||
CRYS_ECPKI_DomainID_secp256r1);
|
||||
}
|
||||
|
||||
psa_status_t psa_derive_ecc_p256r1_public_key( const uint8_t *priv_key_buffer, uint8_t *pub_key_buffer,
|
||||
size_t priv_key_buffer_length,
|
||||
size_t *pub_key_buffer_length)
|
||||
{
|
||||
return cryptocell_310_common_ecc_derive_pub_key(priv_key_buffer, pub_key_buffer,
|
||||
(uint32_t)priv_key_buffer_length,
|
||||
(uint32_t *)pub_key_buffer_length,
|
||||
CRYS_ECPKI_DomainID_secp256r1);
|
||||
}
|
||||
|
||||
psa_status_t psa_ecc_p256r1_sign_hash( const psa_key_attributes_t *attributes,
|
||||
psa_algorithm_t alg,
|
||||
const uint8_t *key_buffer,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user