diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libcrypto/des/cfb_enc.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libcrypto/des/cfb_enc.c b/src/lib/libcrypto/des/cfb_enc.c index dd5237a86d..9bf6466bd2 100644 --- a/src/lib/libcrypto/des/cfb_enc.c +++ b/src/lib/libcrypto/des/cfb_enc.c | |||
@@ -58,6 +58,7 @@ | |||
58 | 58 | ||
59 | #include "des_locl.h" | 59 | #include "des_locl.h" |
60 | #include <assert.h> | 60 | #include <assert.h> |
61 | #include <machine/endian.h> | ||
61 | 62 | ||
62 | /* The input and output are loaded in multiples of 8 bits. | 63 | /* The input and output are loaded in multiples of 8 bits. |
63 | * What this means is that if you hame numbits=12 and length=2 | 64 | * What this means is that if you hame numbits=12 and length=2 |
@@ -76,7 +77,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
76 | register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; | 77 | register int num=numbits/8,n=(numbits+7)/8,i,rem=numbits%8; |
77 | DES_LONG ti[2]; | 78 | DES_LONG ti[2]; |
78 | unsigned char *iv; | 79 | unsigned char *iv; |
79 | #ifndef L_ENDIAN | 80 | #if _BYTE_ORDER != _LITTLE_ENDIAN |
80 | unsigned char ovec[16]; | 81 | unsigned char ovec[16]; |
81 | #else | 82 | #else |
82 | unsigned int sh[4]; | 83 | unsigned int sh[4]; |
@@ -114,7 +115,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
114 | { v0=d0; v1=d1; } | 115 | { v0=d0; v1=d1; } |
115 | else | 116 | else |
116 | { | 117 | { |
117 | #ifndef L_ENDIAN | 118 | #if _BYTE_ORDER != _LITTLE_ENDIAN |
118 | iv=&ovec[0]; | 119 | iv=&ovec[0]; |
119 | l2c(v0,iv); | 120 | l2c(v0,iv); |
120 | l2c(v1,iv); | 121 | l2c(v1,iv); |
@@ -129,7 +130,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
129 | for(i=0 ; i < 8 ; ++i) | 130 | for(i=0 ; i < 8 ; ++i) |
130 | ovec[i]=ovec[i+num]<<rem | | 131 | ovec[i]=ovec[i+num]<<rem | |
131 | ovec[i+num+1]>>(8-rem); | 132 | ovec[i+num+1]>>(8-rem); |
132 | #ifdef L_ENDIAN | 133 | #if _BYTE_ORDER == _LITTLE_ENDIAN |
133 | v0=sh[0], v1=sh[1]; | 134 | v0=sh[0], v1=sh[1]; |
134 | #else | 135 | #else |
135 | iv=&ovec[0]; | 136 | iv=&ovec[0]; |
@@ -157,7 +158,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
157 | { v0=d0; v1=d1; } | 158 | { v0=d0; v1=d1; } |
158 | else | 159 | else |
159 | { | 160 | { |
160 | #ifndef L_ENDIAN | 161 | #if _BYTE_ORDER != _LITTLE_ENDIAN |
161 | iv=&ovec[0]; | 162 | iv=&ovec[0]; |
162 | l2c(v0,iv); | 163 | l2c(v0,iv); |
163 | l2c(v1,iv); | 164 | l2c(v1,iv); |
@@ -172,7 +173,7 @@ void DES_cfb_encrypt(const unsigned char *in, unsigned char *out, int numbits, | |||
172 | for(i=0 ; i < 8 ; ++i) | 173 | for(i=0 ; i < 8 ; ++i) |
173 | ovec[i]=ovec[i+num]<<rem | | 174 | ovec[i]=ovec[i+num]<<rem | |
174 | ovec[i+num+1]>>(8-rem); | 175 | ovec[i+num+1]>>(8-rem); |
175 | #ifdef L_ENDIAN | 176 | #if _BYTE_ORDER == _LITTLE_ENDIAN |
176 | v0=sh[0], v1=sh[1]; | 177 | v0=sh[0], v1=sh[1]; |
177 | #else | 178 | #else |
178 | iv=&ovec[0]; | 179 | iv=&ovec[0]; |