I have installed the patch below. It seems the example Rijndael
implementation didn't implement CBC mode correctly...
--- rijndael-api-fst.c 14 Oct 2005 15:33:22 +0200 1.1
+++ rijndael-api-fst.c 19 Oct 2005 16:08:10 +0200
@@ -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:
_______________________________________________
bug-gnulib mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-gnulib