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.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/lib/libcrypto/des/des_enc.c b/src/lib/libcrypto/des/des_enc.c
index a8d8bd7ecb..7319639c82 100644
--- a/src/lib/libcrypto/des/des_enc.c
+++ b/src/lib/libcrypto/des/des_enc.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: des_enc.c,v 1.14 2023/07/08 07:11:07 beck Exp $ */ 1/* $OpenBSD: des_enc.c,v 1.15 2023/07/08 07:34:34 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -110,8 +110,7 @@ DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
110 D_ENCRYPT(l, r, 28); /* 15 */ 110 D_ENCRYPT(l, r, 28); /* 15 */
111 D_ENCRYPT(r, l, 30); /* 16 */ 111 D_ENCRYPT(r, l, 30); /* 16 */
112#else 112#else
113 for (i = 0; i < 32; i += 4) 113 for (i = 0; i < 32; i += 4) {
114 {
115 D_ENCRYPT(l, r, i + 0); /* 1 */ 114 D_ENCRYPT(l, r, i + 0); /* 1 */
116 D_ENCRYPT(r, l, i + 2); /* 2 */ 115 D_ENCRYPT(r, l, i + 2); /* 2 */
117 } 116 }
@@ -135,8 +134,7 @@ DES_encrypt1(DES_LONG *data, DES_key_schedule *ks, int enc)
135 D_ENCRYPT(l, r, 2); /* 2 */ 134 D_ENCRYPT(l, r, 2); /* 2 */
136 D_ENCRYPT(r, l, 0); /* 1 */ 135 D_ENCRYPT(r, l, 0); /* 1 */
137#else 136#else
138 for (i = 30; i > 0; i -= 4) 137 for (i = 30; i > 0; i -= 4) {
139 {
140 D_ENCRYPT(l, r, i - 0); /* 16 */ 138 D_ENCRYPT(l, r, i - 0); /* 16 */
141 D_ENCRYPT(r, l, i - 2); /* 15 */ 139 D_ENCRYPT(r, l, i - 2); /* 15 */
142 } 140 }
@@ -200,8 +198,7 @@ DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
200 D_ENCRYPT(l, r, 28); /* 15 */ 198 D_ENCRYPT(l, r, 28); /* 15 */
201 D_ENCRYPT(r, l, 30); /* 16 */ 199 D_ENCRYPT(r, l, 30); /* 16 */
202#else 200#else
203 for (i = 0; i < 32; i += 4) 201 for (i = 0; i < 32; i += 4) {
204 {
205 D_ENCRYPT(l, r, i + 0); /* 1 */ 202 D_ENCRYPT(l, r, i + 0); /* 1 */
206 D_ENCRYPT(r, l, i + 2); /* 2 */ 203 D_ENCRYPT(r, l, i + 2); /* 2 */
207 } 204 }
@@ -225,8 +222,7 @@ DES_encrypt2(DES_LONG *data, DES_key_schedule *ks, int enc)
225 D_ENCRYPT(l, r, 2); /* 2 */ 222 D_ENCRYPT(l, r, 2); /* 2 */
226 D_ENCRYPT(r, l, 0); /* 1 */ 223 D_ENCRYPT(r, l, 0); /* 1 */
227#else 224#else
228 for (i = 30; i > 0; i -= 4) 225 for (i = 30; i > 0; i -= 4) {
229 {
230 D_ENCRYPT(l, r, i - 0); /* 16 */ 226 D_ENCRYPT(l, r, i - 0); /* 16 */
231 D_ENCRYPT(r, l, i - 2); /* 15 */ 227 D_ENCRYPT(r, l, i - 2); /* 15 */
232 } 228 }
@@ -308,8 +304,7 @@ DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
308 if (enc) { 304 if (enc) {
309 c2l(iv, tout0); 305 c2l(iv, tout0);
310 c2l(iv, tout1); 306 c2l(iv, tout1);
311 for (l -= 8; l >= 0; l -= 8) 307 for (l -= 8; l >= 0; l -= 8) {
312 {
313 c2l(in, tin0); 308 c2l(in, tin0);
314 c2l(in, tin1); 309 c2l(in, tin1);
315 tin0 ^= tout0; 310 tin0 ^= tout0;
@@ -346,8 +341,7 @@ DES_ede3_cbc_encrypt(const unsigned char *input, unsigned char *output,
346 341
347 c2l(iv, xor0); 342 c2l(iv, xor0);
348 c2l(iv, xor1); 343 c2l(iv, xor1);
349 for (l -= 8; l >= 0; l -= 8) 344 for (l -= 8; l >= 0; l -= 8) {
350 {
351 c2l(in, tin0); 345 c2l(in, tin0);
352 c2l(in, tin1); 346 c2l(in, tin1);
353 347