Source-Changes-HG archive

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

[src/trunk]: src/sys/crypto/blowfish Constify, to make it compile (at least).



details:   https://anonhg.NetBSD.org/src/rev/71cec6323b27
branches:  trunk
changeset: 581617:71cec6323b27
user:      martin <martin%NetBSD.org@localhost>
date:      Fri Jun 03 11:31:57 2005 +0000

description:
Constify, to make it compile (at least).

XXX - I'm not sure with what args this is called, but my bet is that
there is no chance this code will work on alignment requiring archs.

diffstat:

 sys/crypto/blowfish/bf_locl.h |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (24 lines):

diff -r 6d2019e630fc -r 71cec6323b27 sys/crypto/blowfish/bf_locl.h
--- a/sys/crypto/blowfish/bf_locl.h     Fri Jun 03 11:22:08 2005 +0000
+++ b/sys/crypto/blowfish/bf_locl.h     Fri Jun 03 11:31:57 2005 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bf_locl.h,v 1.2 2000/08/31 06:46:21 itojun Exp $       */
+/*     $NetBSD: bf_locl.h,v 1.3 2005/06/03 11:31:57 martin Exp $       */
 /*     $KAME: bf_locl.h,v 1.5 2000/08/31 06:03:48 itojun Exp $ */
 
 /* crypto/bf/bf_local.h */
@@ -205,10 +205,10 @@
 
 #define BF_ENC(LL,R,S,P) \
        LL^=P; \
-       LL^= (((*(BF_LONG *)((unsigned char *)&(S[  0])+((R>>BF_0)&BF_M))+ \
-               *(BF_LONG *)((unsigned char *)&(S[256])+((R>>BF_1)&BF_M)))^ \
-               *(BF_LONG *)((unsigned char *)&(S[512])+((R>>BF_2)&BF_M)))+ \
-               *(BF_LONG *)((unsigned char *)&(S[768])+((R<<BF_3)&BF_M)));
+       LL^= (((*(const BF_LONG *)((const unsigned char *)&(S[  0])+((R>>BF_0)&BF_M))+ \
+               *(const BF_LONG *)((const unsigned char *)&(S[256])+((R>>BF_1)&BF_M)))^ \
+               *(const BF_LONG *)((const unsigned char *)&(S[512])+((R>>BF_2)&BF_M)))+ \
+               *(const BF_LONG *)((const unsigned char *)&(S[768])+((R<<BF_3)&BF_M)));
 #else
 
 /* This will always work, even on 64 bit machines and strangly enough,



Home | Main Index | Thread Index | Old Index