cvs commit: src/sys/crypto/rijndael rijndael-api-fst.c
Nate Lawson
nate at root.org
Tue Oct 14 10:48:20 PDT 2003
On Tue, 14 Oct 2003, Hajimu UMEMOTO wrote:
> Modified files:
> sys/crypto/rijndael rijndael-api-fst.c
> Log:
> Fix alignment problem on 64 bit arch.
> I only tested if it doesn't break anything on i368. Since I
> have no 64 bit machine, I cannot test it, actually.
>
> Reported by: jmallett
>
> Revision Changes Path
> 1.9 +49 -0 src/sys/crypto/rijndael/rijndael-api-fst.c
>
> Index: src/sys/crypto/rijndael/rijndael-api-fst.c
> diff -u src/sys/crypto/rijndael/rijndael-api-fst.c:1.8 src/sys/crypto/rijndael/rijndael-api-fst.c:1.9
> --- src/sys/crypto/rijndael/rijndael-api-fst.c:1.8 Sun Oct 12 14:05:05 2003
> +++ src/sys/crypto/rijndael/rijndael-api-fst.c Tue Oct 14 06:37:37 2003
> @@ -103,7 +103,11 @@
> int rijndael_blockEncrypt(cipherInstance *cipher, keyInstance *key,
> BYTE *input, int inputLen, BYTE *outBuffer) {
> int i, k, t, numBlocks;
> +#if 1 /*STRICT_ALIGN*/
> + u_int8_t block[16], iv[16];
> +#else
> u_int8_t block[16], *iv;
> +#endif
>
> if (cipher == NULL ||
> key == NULL ||
Allocating data on the stack does not give you guaranteed alignment.
-Nate
More information about the cvs-src
mailing list