mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-04 14:08:39 +00:00
Rename psa_generate_key() and psa_generator_import_key()
This commit is contained in:
parent
971bd69696
commit
5a5a79ae2a
10 changed files with 41 additions and 41 deletions
|
|
@ -164,7 +164,7 @@ cipher_example_encrypt_decrypt_aes_cbc_nopad_1_block( void )
|
|||
psa_set_key_type( &attributes, PSA_KEY_TYPE_AES );
|
||||
psa_set_key_bits( &attributes, key_bits );
|
||||
|
||||
status = psa_generate_key( &attributes, &key_handle );
|
||||
status = psa_generate_random_key( &attributes, &key_handle );
|
||||
ASSERT_STATUS( status, PSA_SUCCESS );
|
||||
|
||||
status = cipher_encrypt( key_handle, alg, iv, sizeof( iv ),
|
||||
|
|
@ -215,7 +215,7 @@ static psa_status_t cipher_example_encrypt_decrypt_aes_cbc_pkcs7_multi( void )
|
|||
psa_set_key_type( &attributes, PSA_KEY_TYPE_AES );
|
||||
psa_set_key_bits( &attributes, key_bits );
|
||||
|
||||
status = psa_generate_key( &attributes, &key_handle );
|
||||
status = psa_generate_random_key( &attributes, &key_handle );
|
||||
ASSERT_STATUS( status, PSA_SUCCESS );
|
||||
|
||||
status = cipher_encrypt( key_handle, alg, iv, sizeof( iv ),
|
||||
|
|
@ -262,7 +262,7 @@ static psa_status_t cipher_example_encrypt_decrypt_aes_ctr_multi( void )
|
|||
psa_set_key_type( &attributes, PSA_KEY_TYPE_AES );
|
||||
psa_set_key_bits( &attributes, key_bits );
|
||||
|
||||
status = psa_generate_key( &attributes, &key_handle );
|
||||
status = psa_generate_random_key( &attributes, &key_handle );
|
||||
ASSERT_STATUS( status, PSA_SUCCESS );
|
||||
|
||||
status = cipher_encrypt( key_handle, alg, iv, sizeof( iv ),
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ static psa_status_t generate( const char *key_file_name )
|
|||
psa_set_key_type( &attributes, PSA_KEY_TYPE_DERIVE );
|
||||
psa_set_key_bits( &attributes, PSA_BYTES_TO_BITS( KEY_SIZE_BYTES ) );
|
||||
|
||||
PSA_CHECK( psa_generate_key( &attributes, &key_handle ) );
|
||||
PSA_CHECK( psa_generate_random_key( &attributes, &key_handle ) );
|
||||
|
||||
PSA_CHECK( save_key( key_handle, key_file_name ) );
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ static psa_status_t derive_key_ladder( const char *ladder[],
|
|||
*key_handle = 0;
|
||||
/* Use the generator obtained from the parent key to create
|
||||
* the next intermediate key. */
|
||||
PSA_CHECK( psa_generator_import_key( &attributes, key_handle,
|
||||
PSA_CHECK( psa_generate_derived_key( &attributes, key_handle,
|
||||
&generator ) );
|
||||
PSA_CHECK( psa_generator_abort( &generator ) );
|
||||
}
|
||||
|
|
@ -343,7 +343,7 @@ static psa_status_t derive_wrapping_key( psa_key_usage_t usage,
|
|||
WRAPPING_KEY_SALT, WRAPPING_KEY_SALT_LENGTH,
|
||||
NULL, 0,
|
||||
PSA_BITS_TO_BYTES( WRAPPING_KEY_BITS ) ) );
|
||||
PSA_CHECK( psa_generator_import_key( &attributes, wrapping_key_handle,
|
||||
PSA_CHECK( psa_generate_derived_key( &attributes, wrapping_key_handle,
|
||||
&generator ) );
|
||||
|
||||
exit:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue