From 614a672e7efd87b82c514b471ccc66c081c380d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Fri, 17 May 2013 17:35:36 +0200 Subject: Rearranged struct aes_ctx. --- aes-set-decrypt-key.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'aes-set-decrypt-key.c') diff --git a/aes-set-decrypt-key.c b/aes-set-decrypt-key.c index 04e4c992..f8e8ef71 100644 --- a/aes-set-decrypt-key.c +++ b/aes-set-decrypt-key.c @@ -126,10 +126,10 @@ void aes_invert_key(struct aes_ctx *dst, const struct aes_ctx *src) { - unsigned nrounds; + unsigned rounds; unsigned i; - nrounds = src->nrounds; + rounds = src->rounds; /* Reverse the order of subkeys, in groups of 4. */ /* FIXME: Instead of reordering the subkeys, change the access order @@ -138,7 +138,7 @@ aes_invert_key(struct aes_ctx *dst, { unsigned j, k; - for (i = 0, j = nrounds * 4; + for (i = 0, j = rounds * 4; i < j; i += 4, j -= 4) for (k = 0; k<4; k++) @@ -148,14 +148,14 @@ aes_invert_key(struct aes_ctx *dst, { unsigned k; - dst->nrounds = nrounds; - for (i = 0; i <= nrounds * 4; i += 4) + dst->rounds = rounds; + for (i = 0; i <= rounds * 4; i += 4) for (k = 0; k < 4; k++) - dst->keys[i+k] = src->keys[nrounds * 4 - i + k]; + dst->keys[i+k] = src->keys[rounds * 4 - i + k]; } /* Transform all subkeys but the first and last. */ - for (i = 4; i < 4 * nrounds; i++) + for (i = 4; i < 4 * rounds; i++) MIX_COLUMN (mtable, dst->keys[i]); } -- cgit v1.2.1