summaryrefslogtreecommitdiffstats
path: root/sys/crypto/blowfish/bf_locl.h
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
committerume <ume@FreeBSD.org>2001-06-11 12:39:29 +0000
commit832f8d224926758a9ae0b23a6b45353e44fbc87a (patch)
treea79fc7ad2b97862c4a404f352f0211ad93a7b5f1 /sys/crypto/blowfish/bf_locl.h
parent2693854b01a52b0395a91322aa3edf926bddff38 (diff)
downloadFreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.zip
FreeBSD-src-832f8d224926758a9ae0b23a6b45353e44fbc87a.tar.gz
Sync with recent KAME.
This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
Diffstat (limited to 'sys/crypto/blowfish/bf_locl.h')
-rw-r--r--sys/crypto/blowfish/bf_locl.h62
1 files changed, 35 insertions, 27 deletions
diff --git a/sys/crypto/blowfish/bf_locl.h b/sys/crypto/blowfish/bf_locl.h
index 07598d2..52585bb 100644
--- a/sys/crypto/blowfish/bf_locl.h
+++ b/sys/crypto/blowfish/bf_locl.h
@@ -1,5 +1,5 @@
/* $FreeBSD$ */
-/* $KAME: bf_locl.h,v 1.3 2000/03/27 04:36:26 sumikawa Exp $ */
+/* $KAME: bf_locl.h,v 1.5 2000/08/31 06:03:48 itojun Exp $ */
/* crypto/bf/bf_local.h */
/* Copyright (C) 1995-1997 Eric Young (eay@mincom.oz.au)
@@ -67,10 +67,10 @@
*/
#undef c2l
-#define c2l(c,l) (l =((unsigned long)(*((c)++))) , \
- l|=((unsigned long)(*((c)++)))<< 8L, \
- l|=((unsigned long)(*((c)++)))<<16L, \
- l|=((unsigned long)(*((c)++)))<<24L)
+#define c2l(c,l) (l =((BF_LONG)(*((c)++))) , \
+ l|=((BF_LONG)(*((c)++)))<< 8L, \
+ l|=((BF_LONG)(*((c)++)))<<16L, \
+ l|=((BF_LONG)(*((c)++)))<<24L)
/* NOTE - c is not incremented as per c2l */
#undef c2ln
@@ -78,14 +78,14 @@
c+=n; \
l1=l2=0; \
switch (n) { \
- case 8: l2 =((unsigned long)(*(--(c))))<<24L; \
- case 7: l2|=((unsigned long)(*(--(c))))<<16L; \
- case 6: l2|=((unsigned long)(*(--(c))))<< 8L; \
- case 5: l2|=((unsigned long)(*(--(c)))); \
- case 4: l1 =((unsigned long)(*(--(c))))<<24L; \
- case 3: l1|=((unsigned long)(*(--(c))))<<16L; \
- case 2: l1|=((unsigned long)(*(--(c))))<< 8L; \
- case 1: l1|=((unsigned long)(*(--(c)))); \
+ case 8: l2 =((BF_LONG)(*(--(c))))<<24L; \
+ case 7: l2|=((BF_LONG)(*(--(c))))<<16L; \
+ case 6: l2|=((BF_LONG)(*(--(c))))<< 8L; \
+ case 5: l2|=((BF_LONG)(*(--(c)))); \
+ case 4: l1 =((BF_LONG)(*(--(c))))<<24L; \
+ case 3: l1|=((BF_LONG)(*(--(c))))<<16L; \
+ case 2: l1|=((BF_LONG)(*(--(c))))<< 8L; \
+ case 1: l1|=((BF_LONG)(*(--(c)))); \
} \
}
@@ -116,14 +116,14 @@
c+=n; \
l1=l2=0; \
switch (n) { \
- case 8: l2 =((unsigned long)(*(--(c)))) ; \
- case 7: l2|=((unsigned long)(*(--(c))))<< 8; \
- case 6: l2|=((unsigned long)(*(--(c))))<<16; \
- case 5: l2|=((unsigned long)(*(--(c))))<<24; \
- case 4: l1 =((unsigned long)(*(--(c)))) ; \
- case 3: l1|=((unsigned long)(*(--(c))))<< 8; \
- case 2: l1|=((unsigned long)(*(--(c))))<<16; \
- case 1: l1|=((unsigned long)(*(--(c))))<<24; \
+ case 8: l2 =((BF_LONG)(*(--(c)))) ; \
+ case 7: l2|=((BF_LONG)(*(--(c))))<< 8; \
+ case 6: l2|=((BF_LONG)(*(--(c))))<<16; \
+ case 5: l2|=((BF_LONG)(*(--(c))))<<24; \
+ case 4: l1 =((BF_LONG)(*(--(c)))) ; \
+ case 3: l1|=((BF_LONG)(*(--(c))))<< 8; \
+ case 2: l1|=((BF_LONG)(*(--(c))))<<16; \
+ case 1: l1|=((BF_LONG)(*(--(c))))<<24; \
} \
}
@@ -143,10 +143,10 @@
}
#undef n2l
-#define n2l(c,l) (l =((unsigned long)(*((c)++)))<<24L, \
- l|=((unsigned long)(*((c)++)))<<16L, \
- l|=((unsigned long)(*((c)++)))<< 8L, \
- l|=((unsigned long)(*((c)++))))
+#define n2l(c,l) (l =((BF_LONG)(*((c)++)))<<24L, \
+ l|=((BF_LONG)(*((c)++)))<<16L, \
+ l|=((BF_LONG)(*((c)++)))<< 8L, \
+ l|=((BF_LONG)(*((c)++))))
#undef l2n
#define l2n(l,c) (*((c)++)=(unsigned char)(((l)>>24L)&0xff), \
@@ -161,9 +161,17 @@
* BF_PTR for sparc and MIPS/SGI
* use nothing for Alpha and HP.
*/
-#if !defined(BF_PTR) && !defined(BF_PTR2)
-#undef BF_PTR
+#undef BF_PTR
+#undef BF_PTR2
+#ifdef __NetBSD__
+#ifdef __i386__
+#define BF_PTR2
+#else
+#ifdef __mips__
+#define BF_PTR
+#endif
#endif
+#endif /*NetBSD*/
#define BF_M 0x3fc
#define BF_0 22L
OpenPOWER on IntegriCloud