Split mbedtls_gcm_init() -> gcm_setkey()

This commit is contained in:
Manuel Pégourié-Gonnard 2015-04-28 21:42:17 +02:00
parent 6963ff0969
commit c34e8dd265
6 changed files with 43 additions and 13 deletions

View file

@ -332,7 +332,7 @@ static const mbedtls_cipher_info_t aes_256_ctr_info = {
static int gcm_aes_setkey_wrap( void *ctx, const unsigned char *key,
unsigned int key_length )
{
return mbedtls_gcm_init( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_AES,
return mbedtls_gcm_setkey( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_AES,
key, key_length );
}
@ -689,7 +689,7 @@ static const mbedtls_cipher_info_t camellia_256_ctr_info = {
static int gcm_camellia_setkey_wrap( void *ctx, const unsigned char *key,
unsigned int key_length )
{
return mbedtls_gcm_init( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_CAMELLIA,
return mbedtls_gcm_setkey( (mbedtls_gcm_context *) ctx, MBEDTLS_CIPHER_ID_CAMELLIA,
key, key_length );
}