-# $OpenBSD: Makefile,v 1.184 2024/03/28 06:45:36 beck Exp $
+# $OpenBSD: Makefile,v 1.185 2024/03/28 12:52:58 jsing Exp $
LIB= crypto
LIBREBUILD=y
.else
CFLAGS+=-DOPENSSL_NO_ASM
SRCS+= aes_core.c
-SRCS+= aes_cbc.c
SRCS+= camellia.c
SRCS+= cmll_cbc.c
SRCS+= cmll_misc.c
-/* $OpenBSD: aes.c,v 1.1 2024/03/28 00:57:26 jsing Exp $ */
+/* $OpenBSD: aes.c,v 1.2 2024/03/28 12:52:58 jsing Exp $ */
/* ====================================================================
* Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved.
*
0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
};
+#ifdef HAVE_AES_CBC_ENCRYPT_INTERNAL
+void aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key, unsigned char *ivec, const int enc);
+
+#else
+static inline void
+aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key, unsigned char *ivec, const int enc)
+{
+ if (enc)
+ CRYPTO_cbc128_encrypt(in, out, len, key, ivec,
+ (block128_f)AES_encrypt);
+ else
+ CRYPTO_cbc128_decrypt(in, out, len, key, ivec,
+ (block128_f)AES_decrypt);
+}
+#endif
+
+void
+AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
+ size_t len, const AES_KEY *key, unsigned char *ivec, const int enc)
+{
+ aes_cbc_encrypt_internal(in, out, len, key, ivec, enc);
+}
+
/*
* The input and output encrypted as though 128bit cfb mode is being
* used. The extra state information to record how much of the
+++ /dev/null
-/* $OpenBSD: aes_cbc.c,v 1.13 2024/03/28 12:28:48 jsing Exp $ */
-/* ====================================================================
- * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- *
- * 3. All advertising materials mentioning features or use of this
- * software must display the following acknowledgment:
- * "This product includes software developed by the OpenSSL Project
- * for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
- *
- * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
- * endorse or promote products derived from this software without
- * prior written permission. For written permission, please contact
- * openssl-core@openssl.org.
- *
- * 5. Products derived from this software may not be called "OpenSSL"
- * nor may "OpenSSL" appear in their names without prior written
- * permission of the OpenSSL Project.
- *
- * 6. Redistributions of any form whatsoever must retain the following
- * acknowledgment:
- * "This product includes software developed by the OpenSSL Project
- * for use in the OpenSSL Toolkit (http://www.openssl.org/)"
- *
- * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
- * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
- * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- * ====================================================================
- *
- */
-
-#include <openssl/aes.h>
-#include <openssl/modes.h>
-
-#ifdef HAVE_AES_CBC_ENCRYPT_INTERNAL
-void aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out,
- size_t len, const AES_KEY *key, unsigned char *ivec, const int enc);
-
-#else
-static inline void
-aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out,
- size_t len, const AES_KEY *key, unsigned char *ivec, const int enc)
-{
- if (enc)
- CRYPTO_cbc128_encrypt(in, out, len, key, ivec,
- (block128_f)AES_encrypt);
- else
- CRYPTO_cbc128_decrypt(in, out, len, key, ivec,
- (block128_f)AES_decrypt);
-}
-#endif
-
-void
-AES_cbc_encrypt(const unsigned char *in, unsigned char *out,
- size_t len, const AES_KEY *key, unsigned char *ivec, const int enc)
-{
- aes_cbc_encrypt_internal(in, out, len, key, ivec, enc);
-}
-# $OpenBSD: Makefile.inc,v 1.9 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.10 2024/03/28 12:52:58 jsing Exp $
# aarch64-specific libcrypto build rules
# aes
-SRCS+= aes_core.c aes_cbc.c
+SRCS+= aes_core.c
# bn
# camellia
SRCS+= camellia.c cmll_cbc.c cmll_misc.c
-# $OpenBSD: Makefile.inc,v 1.10 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.11 2024/03/28 12:52:58 jsing Exp $
# alpha-specific libcrypto build rules
# aes
-SRCS+= aes_core.c aes_cbc.c
+SRCS+= aes_core.c
# bn
SSLASM+= bn alpha-mont
CFLAGS+= -DOPENSSL_BN_ASM_MONT
-# $OpenBSD: Makefile.inc,v 1.19 2024/03/28 12:28:48 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.20 2024/03/28 12:52:58 jsing Exp $
# amd64-specific libcrypto build rules
SSLASM+= aes vpaes-x86_64
SSLASM+= aes aesni-x86_64
CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL
-SRCS+= aes_cbc.c
# bn
CFLAGS+= -DOPENSSL_IA32_SSE2
CFLAGS+= -DRSA_ASM
# arm-specific libcrypto build rules
# aes
-SRCS+= aes_cbc.c
CFLAGS+= -DAES_ASM
SSLASM+= aes aes-armv4
# bn
-# $OpenBSD: Makefile.inc,v 1.19 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.20 2024/03/28 12:52:58 jsing Exp $
# hppa-specific libcrypto build rules
# aes
-SRCS+= aes_core.c aes_cbc.c
+SRCS+= aes_core.c
CFLAGS+= -DAES_ASM
SSLASM+= aes aes-parisc aes-parisc
# bn
-# $OpenBSD: Makefile.inc,v 1.16 2024/03/28 12:28:48 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.17 2024/03/28 12:52:58 jsing Exp $
# i386-specific libcrypto build rules
SSLASM+= aes vpaes-x86
SSLASM+= aes aesni-x86
CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL
-SRCS+= aes_cbc.c
# bn
CFLAGS+= -DOPENSSL_IA32_SSE2
SSLASM+= bn bn-586
-# $OpenBSD: Makefile.inc,v 1.11 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.12 2024/03/28 12:52:58 jsing Exp $
# mips64-specific libcrypto build rules
# aes
-SRCS+= aes_cbc.c
CFLAGS+= -DAES_ASM
SSLASM+= aes aes-mips aes-mips
# bn
-# $OpenBSD: Makefile.inc,v 1.8 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.9 2024/03/28 12:52:58 jsing Exp $
# powerpc-specific libcrypto build rules
# aes
-SRCS+= aes_core.c aes_cbc.c
+SRCS+= aes_core.c
# slower than C code
#CFLAGS+= -DAES_ASM
#SSLASM+= aes aes-ppc aes-ppc
-# $OpenBSD: Makefile.inc,v 1.10 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.11 2024/03/28 12:52:58 jsing Exp $
# powerpc-specific libcrypto build rules
# aes
-SRCS+= aes_core.c aes_cbc.c
+SRCS+= aes_core.c
# slower than C code
#CFLAGS+= -DAES_ASM
#SSLASM+= aes aes-ppc aes-ppc
-# $OpenBSD: Makefile.inc,v 1.6 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.7 2024/03/28 12:52:58 jsing Exp $
# riscv64 libcrypto build rules
# aes
SRCS+= aes_core.c
-SRCS+= aes_cbc.c
# camellia
SRCS+= camellia.c
-# $OpenBSD: Makefile.inc,v 1.13 2024/03/28 01:57:00 jsing Exp $
+# $OpenBSD: Makefile.inc,v 1.14 2024/03/28 12:52:58 jsing Exp $
# sparc64-specific libcrypto build rules
# aes
-SRCS+= aes_core.c aes_cbc.c
+SRCS+= aes_core.c
CFLAGS+= -DAES_ASM
SSLASM+= aes aes-sparcv9 aes-sparcv9
# bn