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

* cbc.c (cbc_encrypt): Bug fix, encrypt block *after* XOR:ing the

iv.

Rev: src/nettle/cbc.c:1.4
parent 18eaed2f
Branches
Tags
No related merge requests found
...@@ -44,7 +44,7 @@ cbc_encrypt(void *ctx, void (*f)(void *ctx, ...@@ -44,7 +44,7 @@ cbc_encrypt(void *ctx, void (*f)(void *ctx,
for ( ; length; length -= block_size, src += block_size, dst += block_size) for ( ; length; length -= block_size, src += block_size, dst += block_size)
{ {
memxor(iv, src, block_size); memxor(iv, src, block_size);
f(ctx, block_size, dst, src); f(ctx, block_size, dst, iv);
memcpy(iv, dst, block_size); memcpy(iv, dst, block_size);
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment