Set the key size as an attribute

Instead of passing a separate parameter for the key size to
psa_generate_key and psa_generator_import_key, set it through the
attributes, like the key type and other metadata.
This commit is contained in:
Gilles Peskine 2019-04-26 13:49:28 +02:00
parent 30afafd527
commit 3a4f1f8e46
7 changed files with 54 additions and 44 deletions

View file

@ -333,6 +333,12 @@ static inline psa_key_type_t psa_get_key_type(
return( attributes->type );
}
static inline void psa_set_key_bits(psa_key_attributes_t *attributes,
size_t bits)
{
attributes->bits = bits;
}
static inline size_t psa_get_key_bits(
const psa_key_attributes_t *attributes)
{