Skip to content
Snippets Groups Projects
Commit 346e45c5 authored by Niels Möller's avatar Niels Möller
Browse files

* twofish.c (twofish_decrypt): Fixed for();-bug in the block-loop.

Spotted by Jean-Pierre.
(twofish_encrypt): Likewise.

Rev: src/nettle/twofish.c:1.5
parent f7820752
No related branches found
No related tags found
No related merge requests found
...@@ -337,7 +337,7 @@ twofish_encrypt(struct twofish_ctx *context, ...@@ -337,7 +337,7 @@ twofish_encrypt(struct twofish_ctx *context,
uint32_t (*s_box)[256] = context->s_box; uint32_t (*s_box)[256] = context->s_box;
assert( !(length % TWOFISH_BLOCK_SIZE) ); assert( !(length % TWOFISH_BLOCK_SIZE) );
for ( ; length; length -= TWOFISH_BLOCK_SIZE); for ( ; length; length -= TWOFISH_BLOCK_SIZE)
{ {
uint32_t words[4]; uint32_t words[4];
uint32_t r0, r1, r2, r3, t0, t1; uint32_t r0, r1, r2, r3, t0, t1;
...@@ -408,7 +408,7 @@ twofish_decrypt(struct twofish_ctx *context, ...@@ -408,7 +408,7 @@ twofish_decrypt(struct twofish_ctx *context,
uint32_t (*s_box)[256] = context->s_box; uint32_t (*s_box)[256] = context->s_box;
assert( !(length % TWOFISH_BLOCK_SIZE) ); assert( !(length % TWOFISH_BLOCK_SIZE) );
for ( ; length; length -= TWOFISH_BLOCK_SIZE); for ( ; length; length -= TWOFISH_BLOCK_SIZE)
{ {
uint32_t words[4]; uint32_t words[4];
uint32_t r0, r1, r2, r3, t0, t1; uint32_t r0, r1, r2, r3, t0, t1;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment