summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/des/des_enc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/des/des_enc.c')
-rw-r--r--src/lib/libcrypto/des/des_enc.c21
1 files changed, 5 insertions, 16 deletions
diff --git a/src/lib/libcrypto/des/des_enc.c b/src/lib/libcrypto/des/des_enc.c
index 22701e0669..5c47553a5a 100644
--- a/src/lib/libcrypto/des/des_enc.c
+++ b/src/lib/libcrypto/des/des_enc.c
@@ -57,6 +57,7 @@
57 */ 57 */
58 58
59#include "des_locl.h" 59#include "des_locl.h"
60#include "spr.h"
60 61
61#ifndef OPENBSD_DES_ASM 62#ifndef OPENBSD_DES_ASM
62 63
@@ -109,12 +110,10 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
109 D_ENCRYPT(l,r,28); /* 15 */ 110 D_ENCRYPT(l,r,28); /* 15 */
110 D_ENCRYPT(r,l,30); /* 16 */ 111 D_ENCRYPT(r,l,30); /* 16 */
111#else 112#else
112 for (i=0; i<32; i+=8) 113 for (i=0; i<32; i+=4)
113 { 114 {
114 D_ENCRYPT(l,r,i+0); /* 1 */ 115 D_ENCRYPT(l,r,i+0); /* 1 */
115 D_ENCRYPT(r,l,i+2); /* 2 */ 116 D_ENCRYPT(r,l,i+2); /* 2 */
116 D_ENCRYPT(l,r,i+4); /* 3 */
117 D_ENCRYPT(r,l,i+6); /* 4 */
118 } 117 }
119#endif 118#endif
120 } 119 }
@@ -138,12 +137,10 @@ void DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
138 D_ENCRYPT(l,r, 2); /* 2 */ 137 D_ENCRYPT(l,r, 2); /* 2 */
139 D_ENCRYPT(r,l, 0); /* 1 */ 138 D_ENCRYPT(r,l, 0); /* 1 */
140#else 139#else
141 for (i=30; i>0; i-=8) 140 for (i=30; i>0; i-=4)
142 { 141 {
143 D_ENCRYPT(l,r,i-0); /* 16 */ 142 D_ENCRYPT(l,r,i-0); /* 16 */
144 D_ENCRYPT(r,l,i-2); /* 15 */ 143 D_ENCRYPT(r,l,i-2); /* 15 */
145 D_ENCRYPT(l,r,i-4); /* 14 */
146 D_ENCRYPT(r,l,i-6); /* 13 */
147 } 144 }
148#endif 145#endif
149 } 146 }
@@ -205,12 +202,10 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
205 D_ENCRYPT(l,r,28); /* 15 */ 202 D_ENCRYPT(l,r,28); /* 15 */
206 D_ENCRYPT(r,l,30); /* 16 */ 203 D_ENCRYPT(r,l,30); /* 16 */
207#else 204#else
208 for (i=0; i<32; i+=8) 205 for (i=0; i<32; i+=4)
209 { 206 {
210 D_ENCRYPT(l,r,i+0); /* 1 */ 207 D_ENCRYPT(l,r,i+0); /* 1 */
211 D_ENCRYPT(r,l,i+2); /* 2 */ 208 D_ENCRYPT(r,l,i+2); /* 2 */
212 D_ENCRYPT(l,r,i+4); /* 3 */
213 D_ENCRYPT(r,l,i+6); /* 4 */
214 } 209 }
215#endif 210#endif
216 } 211 }
@@ -234,12 +229,10 @@ void DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
234 D_ENCRYPT(l,r, 2); /* 2 */ 229 D_ENCRYPT(l,r, 2); /* 2 */
235 D_ENCRYPT(r,l, 0); /* 1 */ 230 D_ENCRYPT(r,l, 0); /* 1 */
236#else 231#else
237 for (i=30; i>0; i-=8) 232 for (i=30; i>0; i-=4)
238 { 233 {
239 D_ENCRYPT(l,r,i-0); /* 16 */ 234 D_ENCRYPT(l,r,i-0); /* 16 */
240 D_ENCRYPT(r,l,i-2); /* 15 */ 235 D_ENCRYPT(r,l,i-2); /* 15 */
241 D_ENCRYPT(l,r,i-4); /* 14 */
242 D_ENCRYPT(r,l,i-6); /* 13 */
243 } 236 }
244#endif 237#endif
245 } 238 }
@@ -293,8 +286,6 @@ void DES_decrypt3(DES_LONG *data, DES_key_schedule *ks1,
293 286
294#ifndef DES_DEFAULT_OPTIONS 287#ifndef DES_DEFAULT_OPTIONS
295 288
296#if !defined(OPENSSL_FIPS_DES_ASM)
297
298#undef CBC_ENC_C__DONT_UPDATE_IV 289#undef CBC_ENC_C__DONT_UPDATE_IV
299#include "ncbc_enc.c" /* DES_ncbc_encrypt */ 290#include "ncbc_enc.c" /* DES_ncbc_encrypt */
300 291
@@ -410,6 +401,4 @@ void DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
410 tin[0]=tin[1]=0; 401 tin[0]=tin[1]=0;
411 } 402 }
412 403
413#endif
414
415#endif /* DES_DEFAULT_OPTIONS */ 404#endif /* DES_DEFAULT_OPTIONS */