summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/aes/aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/aes/aes.c')
-rw-r--r--src/lib/libcrypto/aes/aes.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/lib/libcrypto/aes/aes.c b/src/lib/libcrypto/aes/aes.c
index d3bf85947d..9b25a21f4c 100644
--- a/src/lib/libcrypto/aes/aes.c
+++ b/src/lib/libcrypto/aes/aes.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: aes.c,v 1.1 2024/03/28 00:57:26 jsing Exp $ */ 1/* $OpenBSD: aes.c,v 1.2 2024/03/28 12:52:58 jsing Exp $ */
2/* ==================================================================== 2/* ====================================================================
3 * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. 3 * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved.
4 * 4 *
@@ -59,6 +59,31 @@ static const unsigned char aes_wrap_default_iv[] = {
59 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 59 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
60}; 60};
61 61
62#ifdef HAVE_AES_CBC_ENCRYPT_INTERNAL
63void aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out,
64 size_t len, const AES_KEY *key, unsigned char *ivec, const int enc);
65
66#else
67static inline void
68aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out,
69 size_t len, const AES_KEY *key, unsigned char *ivec, const int enc)
70{
71 if (enc)
72 CRYPTO_cbc128_encrypt(in, out, len, key, ivec,
73 (block128_f)AES_encrypt);
74 else
75 CRYPTO_cbc128_decrypt(in, out, len, key, ivec,
76 (block128_f)AES_decrypt);
77}
78#endif
79
80void
81AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
82 size_t len, const AES_KEY *key, unsigned char *ivec, const int enc)
83{
84 aes_cbc_encrypt_internal(in, out, len, key, ivec, enc);
85}
86
62/* 87/*
63 * The input and output encrypted as though 128bit cfb mode is being 88 * The input and output encrypted as though 128bit cfb mode is being
64 * used. The extra state information to record how much of the 89 * used. The extra state information to record how much of the