summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/modes/cbc128.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/lib/libcrypto/modes/cbc128.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/lib/libcrypto/modes/cbc128.c b/src/lib/libcrypto/modes/cbc128.c
index f8ebf79a87..1b6858ee25 100644
--- a/src/lib/libcrypto/modes/cbc128.c
+++ b/src/lib/libcrypto/modes/cbc128.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: cbc128.c,v 1.8 2023/07/08 14:56:54 beck Exp $ */ 1/* $OpenBSD: cbc128.c,v 1.11 2025/04/23 10:09:08 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2008 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -49,15 +49,11 @@
49 * 49 *
50 */ 50 */
51 51
52#include <openssl/crypto.h>
53#include "modes_local.h"
54#include <string.h> 52#include <string.h>
55 53
56#ifndef MODES_DEBUG 54#include <openssl/crypto.h>
57# ifndef NDEBUG 55
58# define NDEBUG 56#include "modes_local.h"
59# endif
60#endif
61 57
62#undef STRICT_ALIGNMENT 58#undef STRICT_ALIGNMENT
63#ifdef __STRICT_ALIGNMENT 59#ifdef __STRICT_ALIGNMENT
@@ -74,7 +70,6 @@ CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
74 size_t n; 70 size_t n;
75 const unsigned char *iv = ivec; 71 const unsigned char *iv = ivec;
76 72
77#if !defined(OPENSSL_SMALL_FOOTPRINT)
78 if (STRICT_ALIGNMENT && 73 if (STRICT_ALIGNMENT &&
79 ((size_t)in|(size_t)out|(size_t)ivec) % sizeof(size_t) != 0) { 74 ((size_t)in|(size_t)out|(size_t)ivec) % sizeof(size_t) != 0) {
80 while (len >= 16) { 75 while (len >= 16) {
@@ -98,7 +93,6 @@ CRYPTO_cbc128_encrypt(const unsigned char *in, unsigned char *out,
98 out += 16; 93 out += 16;
99 } 94 }
100 } 95 }
101#endif
102 while (len) { 96 while (len) {
103 for (n = 0; n < 16 && n < len; ++n) 97 for (n = 0; n < 16 && n < len; ++n)
104 out[n] = in[n] ^ iv[n]; 98 out[n] = in[n] ^ iv[n];
@@ -127,7 +121,6 @@ CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
127 unsigned char c[16]; 121 unsigned char c[16];
128 } tmp; 122 } tmp;
129 123
130#if !defined(OPENSSL_SMALL_FOOTPRINT)
131 if (in != out) { 124 if (in != out) {
132 const unsigned char *iv = ivec; 125 const unsigned char *iv = ivec;
133 126
@@ -192,7 +185,6 @@ CRYPTO_cbc128_decrypt(const unsigned char *in, unsigned char *out,
192 } 185 }
193 } 186 }
194 } 187 }
195#endif
196 while (len) { 188 while (len) {
197 unsigned char c; 189 unsigned char c;
198 (*block)(in, tmp.c, key); 190 (*block)(in, tmp.c, key);