Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/kame/racoon/missing/crypto/rijndael Turn on stri...



details:   https://anonhg.NetBSD.org/src/rev/f7effc41a8e1
branches:  trunk
changeset: 537590:f7effc41a8e1
user:      elric <elric%NetBSD.org@localhost>
date:      Wed Oct 02 17:53:11 2002 +0000

description:
Turn on strict alignment #define's, because racoon reliably core
dumps on machines which require strict alignment such as sparc64.

diffstat:

 crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.c |  13 +++++----
 1 files changed, 7 insertions(+), 6 deletions(-)

diffs (59 lines):

diff -r 35b1e27334b8 -r f7effc41a8e1 crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.c
--- a/crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.c        Wed Oct 02 17:30:08 2002 +0000
+++ b/crypto/dist/kame/racoon/missing/crypto/rijndael/rijndael-api-fst.c        Wed Oct 02 17:53:11 2002 +0000
@@ -112,7 +112,7 @@
                break;
                
        case MODE_CBC:
-#if 0 /*STRICT_ALIGN*/
+#if 1 /*STRICT_ALIGN*/
                bcopy(cipher->IV, block, 16);
                bcopy(input, iv, 16);
                ((word32*)block)[0] ^= ((word32*)iv)[0];
@@ -128,8 +128,9 @@
                rijndaelEncrypt(block, outBuffer, key->keySched, key->ROUNDS);
                input += 16;
                for (i = numBlocks - 1; i > 0; i--) {
-#if 0 /*STRICT_ALIGN*/
+#if 1 /*STRICT_ALIGN*/
                        bcopy(outBuffer, block, 16);
+                       bcopy(input, iv, 16);
                        ((word32*)block)[0] ^= ((word32*)iv)[0];
                        ((word32*)block)[1] ^= ((word32*)iv)[1];
                        ((word32*)block)[2] ^= ((word32*)iv)[2];
@@ -147,7 +148,7 @@
                break;
        
        case MODE_CFB1:
-#if 0 /*STRICT_ALIGN*/
+#if 1 /*STRICT_ALIGN*/
                bcopy(cipher->IV, iv, 16); 
 #else  /* !STRICT_ALIGN */
                *((word32*)iv[0]) = *((word32*)(cipher->IV   ));
@@ -294,7 +295,7 @@
                break;
                
        case MODE_CBC:
-#if 0 /*STRICT_ALIGN */
+#if 1 /*STRICT_ALIGN */
                bcopy(cipher->IV, iv, 16); 
 #else
                *((word32*)iv[0]) = *((word32*)(cipher->IV   ));
@@ -308,7 +309,7 @@
                        ((word32*)block)[1] ^= *((word32*)iv[1]);
                        ((word32*)block)[2] ^= *((word32*)iv[2]);
                        ((word32*)block)[3] ^= *((word32*)iv[3]);
-#if 0 /*STRICT_ALIGN*/
+#if 1 /*STRICT_ALIGN*/
                        bcopy(input, iv, 16);
                        bcopy(block, outBuffer, 16);
 #else
@@ -323,7 +324,7 @@
                break;
        
        case MODE_CFB1:
-#if 0 /*STRICT_ALIGN */
+#if 1 /*STRICT_ALIGN */
                bcopy(cipher->IV, iv, 16); 
 #else
                *((word32*)iv[0]) = *((word32*)(cipher->IV));



Home | Main Index | Thread Index | Old Index