Mercurial > hg > octave-lyh > gnulib-hg
changeset 6416:3249ff532a18
* rijndael-api-fst.c: Fix bugs in CBC mode for more than one
block.
author | Simon Josefsson <simon@josefsson.org> |
---|---|
date | Fri, 21 Oct 2005 13:45:23 +0000 |
parents | 8fdeec35e290 |
children | 764fd03c3ff9 |
files | lib/ChangeLog lib/rijndael-api-fst.c |
diffstat | 2 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2005-10-21 Simon Josefsson <jas@extundo.com> + + * rijndael-api-fst.c: Fix bugs in CBC mode for more than one + block. + 2005-10-21 Simon Josefsson <jas@extundo.com> * gc-gnulib.c: Support ARCTWO in CBC mode.
--- a/lib/rijndael-api-fst.c +++ b/lib/rijndael-api-fst.c @@ -244,7 +244,7 @@ ((uint32_t *) block)[3] = ((uint32_t *) input)[3] ^ ((uint32_t *) iv)[3]; rijndaelEncrypt (key->rk, key->Nr, block, outBuffer); - iv = outBuffer; + memcpy (cipher->IV, outBuffer, 16); input += 16; outBuffer += 16; } @@ -327,7 +327,7 @@ ((uint32_t *) block)[3] = ((uint32_t *) input)[3] ^ ((uint32_t *) iv)[3]; rijndaelEncrypt (key->rk, key->Nr, block, outBuffer); - iv = outBuffer; + memcpy (cipher->IV, outBuffer, 16); input += 16; outBuffer += 16; } @@ -342,6 +342,7 @@ block[i] = (char) padLen ^ iv[i]; } rijndaelEncrypt (key->rk, key->Nr, block, outBuffer); + memcpy (cipher->IV, outBuffer, 16); break; default: