Moved GCM to use cipher layer instead of AES directly

This commit is contained in:
Paul Bakker 2013-09-09 00:10:27 +02:00
parent f46b6955e3
commit 43aff2aec4
4 changed files with 58 additions and 27 deletions

View file

@ -298,9 +298,10 @@ static void gcm_ctx_free( void *ctx )
polarssl_free( ctx );
}
static int gcm_setkey_wrap( void *ctx, const unsigned char *key, unsigned int key_length )
static int gcm_aes_setkey_wrap( void *ctx, const unsigned char *key, unsigned int key_length )
{
return gcm_init( (gcm_context *) ctx, key, key_length );
return gcm_init( (gcm_context *) ctx, POLARSSL_CIPHER_ID_AES,
key, key_length );
}
const cipher_base_t gcm_aes_info = {
@ -310,8 +311,8 @@ const cipher_base_t gcm_aes_info = {
NULL,
NULL,
NULL,
gcm_setkey_wrap,
gcm_setkey_wrap,
gcm_aes_setkey_wrap,
gcm_aes_setkey_wrap,
gcm_ctx_alloc,
gcm_ctx_free,
};