diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-05-17 17:35:36 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-05-17 17:35:36 +0200 |
commit | 614a672e7efd87b82c514b471ccc66c081c380d4 (patch) | |
tree | 6d330873fe585b300613ca841e713f6228b72260 /aes-set-decrypt-key.c | |
parent | ff29d0a9c9b7d17e0bc15bbba88993244903222b (diff) | |
download | nettle-614a672e7efd87b82c514b471ccc66c081c380d4.tar.gz |
Rearranged struct aes_ctx.
Diffstat (limited to 'aes-set-decrypt-key.c')
-rw-r--r-- | aes-set-decrypt-key.c | 14 |
1 files changed, 7 insertions, 7 deletions
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]); } |