diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-08-07 09:58:18 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-08-07 09:58:18 +0200 |
commit | 31a51477fd313ccafbc53afc5a105c9c1d01e8ed (patch) | |
tree | 31c0528f0a77da806ece6dcd19b9584a8b6dd3fd /umac-set-key.c | |
parent | ffbcdcb9abf70a51503502e22a9ffc7874752917 (diff) | |
download | nettle-31a51477fd313ccafbc53afc5a105c9c1d01e8ed.tar.gz |
Adapted umac code to use new aes128 interface.
Diffstat (limited to 'umac-set-key.c')
-rw-r--r-- | umac-set-key.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/umac-set-key.c b/umac-set-key.c index 03057a46..63a1a7e3 100644 --- a/umac-set-key.c +++ b/umac-set-key.c @@ -32,7 +32,7 @@ #include "macros.h" static void -umac_kdf (struct aes_ctx *aes, unsigned index, unsigned length, uint8_t *dst) +umac_kdf (struct aes128_ctx *aes, unsigned index, unsigned length, uint8_t *dst) { uint8_t block[AES_BLOCK_SIZE]; uint64_t count; @@ -41,12 +41,12 @@ umac_kdf (struct aes_ctx *aes, unsigned index, unsigned length, uint8_t *dst) length -= AES_BLOCK_SIZE, dst += AES_BLOCK_SIZE, count++) { WRITE_UINT64 (block + 8, count); - aes_encrypt (aes, AES_BLOCK_SIZE, dst, block); + aes128_encrypt (aes, AES_BLOCK_SIZE, dst, block); } if (length > 0) { WRITE_UINT64 (block + 8, count); - aes_encrypt (aes, AES_BLOCK_SIZE, block, block); + aes128_encrypt (aes, AES_BLOCK_SIZE, block, block); memcpy (dst, block, length); } } @@ -71,12 +71,12 @@ umac_kdf (struct aes_ctx *aes, unsigned index, unsigned length, uint8_t *dst) void _umac_set_key (uint32_t *l1_key, uint32_t *l2_key, uint64_t *l3_key1, uint32_t *l3_key2, - struct aes_ctx *aes, const uint8_t *key, unsigned n) + struct aes128_ctx *aes, const uint8_t *key, unsigned n) { unsigned size; uint8_t buffer[UMAC_KEY_SIZE]; - aes_set_encrypt_key (aes, UMAC_KEY_SIZE, key); + aes128_set_encrypt_key (aes, key); size = UMAC_DATA_SIZE / 4 + 4*(n-1); umac_kdf (aes, 1, size * sizeof(uint32_t), (uint8_t *) l1_key); @@ -94,5 +94,5 @@ _umac_set_key (uint32_t *l1_key, uint32_t *l2_key, umac_kdf (aes, 4, n * sizeof(uint32_t), (uint8_t *) l3_key2); umac_kdf (aes, 0, UMAC_KEY_SIZE, buffer); - aes_set_encrypt_key (aes, UMAC_KEY_SIZE, buffer); + aes128_set_encrypt_key (aes, buffer); } |