From: jsing Date: Sun, 11 Aug 2024 13:02:39 +0000 (+0000) Subject: Provide and use crypto_arch.h. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=09b34817717f698ab3c27f656830649f1aaef7a9;p=openbsd Provide and use crypto_arch.h. Provide a per architecture crypto_arch.h - this will be used in a similar manner to bn_arch.h and will allow for architecture specific #defines and static inline functions. Move the HAVE_AES_* and HAVE_RC4_* defines here. ok tb@ --- diff --git a/lib/libcrypto/aes/aes.c b/lib/libcrypto/aes/aes.c index 4d040ea5f7e..d36a0063608 100644 --- a/lib/libcrypto/aes/aes.c +++ b/lib/libcrypto/aes/aes.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes.c,v 1.3 2024/03/30 05:14:12 joshua Exp $ */ +/* $OpenBSD: aes.c,v 1.4 2024/08/11 13:02:39 jsing Exp $ */ /* ==================================================================== * Copyright (c) 2002-2006 The OpenSSL Project. All rights reserved. * @@ -55,6 +55,8 @@ #include #include +#include "crypto_arch.h" + static const unsigned char aes_wrap_default_iv[] = { 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, }; diff --git a/lib/libcrypto/aes/aes_core.c b/lib/libcrypto/aes/aes_core.c index 335b1dba541..0472d5f4e23 100644 --- a/lib/libcrypto/aes/aes_core.c +++ b/lib/libcrypto/aes/aes_core.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_core.c,v 1.23 2024/03/30 05:14:12 joshua Exp $ */ +/* $OpenBSD: aes_core.c,v 1.24 2024/08/11 13:02:39 jsing Exp $ */ /** * rijndael-alg-fst.c * @@ -35,6 +35,7 @@ #include #include "aes_local.h" +#include "crypto_arch.h" #include "crypto_internal.h" /* diff --git a/lib/libcrypto/arch/aarch64/crypto_arch.h b/lib/libcrypto/arch/aarch64/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/aarch64/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/alpha/crypto_arch.h b/lib/libcrypto/arch/alpha/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/alpha/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/amd64/Makefile.inc b/lib/libcrypto/arch/amd64/Makefile.inc index 0cf212b1869..dd136f76a73 100644 --- a/lib/libcrypto/arch/amd64/Makefile.inc +++ b/lib/libcrypto/arch/amd64/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.28 2024/06/04 15:14:45 deraadt Exp $ +# $OpenBSD: Makefile.inc,v 1.29 2024/08/11 13:02:39 jsing Exp $ # amd64-specific libcrypto build rules @@ -13,11 +13,6 @@ SSLASM+= aes bsaes-x86_64 CFLAGS+= -DVPAES_ASM SSLASM+= aes vpaes-x86_64 SSLASM+= aes aesni-x86_64 -CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn CFLAGS+= -DOPENSSL_IA32_SSE2 CFLAGS+= -DRSA_ASM @@ -48,8 +43,6 @@ SSLASM+= md5 md5-x86_64 CFLAGS+= -DGHASH_ASM SSLASM+= modes ghash-x86_64 # rc4 -CFLAGS+= -DHAVE_RC4_INTERNAL -CFLAGS+= -DHAVE_RC4_SET_KEY_INTERNAL SSLASM+= rc4 rc4-x86_64 # ripemd # sha diff --git a/lib/libcrypto/arch/amd64/crypto_arch.h b/lib/libcrypto/arch/amd64/crypto_arch.h new file mode 100644 index 00000000000..8e91c255291 --- /dev/null +++ b/lib/libcrypto/arch/amd64/crypto_arch.h @@ -0,0 +1,34 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_CBC_ENCRYPT_INTERNAL +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#define HAVE_RC4_INTERNAL +#define HAVE_RC4_SET_KEY_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/arm/Makefile.inc b/lib/libcrypto/arch/arm/Makefile.inc index 43c0589eb6d..b09b54a5642 100644 --- a/lib/libcrypto/arch/arm/Makefile.inc +++ b/lib/libcrypto/arch/arm/Makefile.inc @@ -5,10 +5,6 @@ # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-armv4 -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn CFLAGS+= -DOPENSSL_BN_ASM_MONT SSLASM+= bn armv4-mont diff --git a/lib/libcrypto/arch/arm/crypto_arch.h b/lib/libcrypto/arch/arm/crypto_arch.h new file mode 100644 index 00000000000..4276dc31ea5 --- /dev/null +++ b/lib/libcrypto/arch/arm/crypto_arch.h @@ -0,0 +1,30 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/hppa/Makefile.inc b/lib/libcrypto/arch/hppa/Makefile.inc index 9796d3a8607..4e2675a6006 100644 --- a/lib/libcrypto/arch/hppa/Makefile.inc +++ b/lib/libcrypto/arch/hppa/Makefile.inc @@ -1,12 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.24 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.25 2024/08/11 13:02:39 jsing Exp $ # hppa-specific libcrypto build rules # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-parisc aes-parisc -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn SSLASM+= bn parisc-mont parisc-mont CFLAGS+= -DOPENSSL_BN_ASM_MONT -DBN_DIV2W diff --git a/lib/libcrypto/arch/hppa/crypto_arch.h b/lib/libcrypto/arch/hppa/crypto_arch.h new file mode 100644 index 00000000000..7f1fc36cac3 --- /dev/null +++ b/lib/libcrypto/arch/hppa/crypto_arch.h @@ -0,0 +1,28 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/i386/Makefile.inc b/lib/libcrypto/arch/i386/Makefile.inc index 37f6ba32b90..eeaed44f844 100644 --- a/lib/libcrypto/arch/i386/Makefile.inc +++ b/lib/libcrypto/arch/i386/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.24 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.25 2024/08/11 13:02:39 jsing Exp $ # i386-specific libcrypto build rules @@ -11,11 +11,6 @@ SSLASM+= aes aes-586 CFLAGS+= -DVPAES_ASM SSLASM+= aes vpaes-x86 SSLASM+= aes aesni-x86 -CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn CFLAGS+= -DOPENSSL_IA32_SSE2 SSLASM+= bn bn-586 @@ -29,8 +24,6 @@ SSLASM+= md5 md5-586 CFLAGS+= -DGHASH_ASM SSLASM+= modes ghash-x86 # rc4 -CFLAGS+= -DHAVE_RC4_INTERNAL -CFLAGS+= -DHAVE_RC4_SET_KEY_INTERNAL SSLASM+= rc4 rc4-586 # sha CFLAGS+= -DSHA1_ASM diff --git a/lib/libcrypto/arch/i386/crypto_arch.h b/lib/libcrypto/arch/i386/crypto_arch.h new file mode 100644 index 00000000000..8e91c255291 --- /dev/null +++ b/lib/libcrypto/arch/i386/crypto_arch.h @@ -0,0 +1,34 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_CBC_ENCRYPT_INTERNAL +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#define HAVE_RC4_INTERNAL +#define HAVE_RC4_SET_KEY_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/m88k/crypto_arch.h b/lib/libcrypto/arch/m88k/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/m88k/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/mips64/Makefile.inc b/lib/libcrypto/arch/mips64/Makefile.inc index 41d6b0e8884..9e08b442ac0 100644 --- a/lib/libcrypto/arch/mips64/Makefile.inc +++ b/lib/libcrypto/arch/mips64/Makefile.inc @@ -1,14 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.17 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.18 2024/08/11 13:02:39 jsing Exp $ # mips64-specific libcrypto build rules # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-mips aes-mips -CFLAGS+= -DHAVE_AES_SET_ENCRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_SET_DECRYPT_KEY_INTERNAL -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn SSLASM+= bn mips bn-mips SSLASM+= bn mips-mont mips-mont diff --git a/lib/libcrypto/arch/mips64/crypto_arch.h b/lib/libcrypto/arch/mips64/crypto_arch.h new file mode 100644 index 00000000000..4276dc31ea5 --- /dev/null +++ b/lib/libcrypto/arch/mips64/crypto_arch.h @@ -0,0 +1,30 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_SET_ENCRYPT_KEY_INTERNAL +#define HAVE_AES_SET_DECRYPT_KEY_INTERNAL +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/arch/powerpc/crypto_arch.h b/lib/libcrypto/arch/powerpc/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/powerpc/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/powerpc64/crypto_arch.h b/lib/libcrypto/arch/powerpc64/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/powerpc64/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/riscv64/crypto_arch.h b/lib/libcrypto/arch/riscv64/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/riscv64/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/sh/crypto_arch.h b/lib/libcrypto/arch/sh/crypto_arch.h new file mode 100644 index 00000000000..a3dd98d0cee --- /dev/null +++ b/lib/libcrypto/arch/sh/crypto_arch.h @@ -0,0 +1,21 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#endif diff --git a/lib/libcrypto/arch/sparc64/Makefile.inc b/lib/libcrypto/arch/sparc64/Makefile.inc index c4b303f4443..9101d8a89d0 100644 --- a/lib/libcrypto/arch/sparc64/Makefile.inc +++ b/lib/libcrypto/arch/sparc64/Makefile.inc @@ -1,12 +1,10 @@ -# $OpenBSD: Makefile.inc,v 1.18 2024/03/29 11:00:57 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.19 2024/08/11 13:02:39 jsing Exp $ # sparc64-specific libcrypto build rules # aes CFLAGS+= -DAES_ASM SSLASM+= aes aes-sparcv9 aes-sparcv9 -CFLAGS+= -DHAVE_AES_ENCRYPT_INTERNAL -CFLAGS+= -DHAVE_AES_DECRYPT_INTERNAL # bn # modes CFLAGS+= -DGHASH_ASM diff --git a/lib/libcrypto/arch/sparc64/crypto_arch.h b/lib/libcrypto/arch/sparc64/crypto_arch.h new file mode 100644 index 00000000000..7f1fc36cac3 --- /dev/null +++ b/lib/libcrypto/arch/sparc64/crypto_arch.h @@ -0,0 +1,28 @@ +/* $OpenBSD: crypto_arch.h,v 1.1 2024/08/11 13:02:39 jsing Exp $ */ +/* + * Copyright (c) 2024 Joel Sing + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + */ + +#ifndef HEADER_CRYPTO_ARCH_H +#define HEADER_CRYPTO_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#define HAVE_AES_ENCRYPT_INTERNAL +#define HAVE_AES_DECRYPT_INTERNAL + +#endif + +#endif diff --git a/lib/libcrypto/crypto_internal.h b/lib/libcrypto/crypto_internal.h index 8229db2d689..7676076f67a 100644 --- a/lib/libcrypto/crypto_internal.h +++ b/lib/libcrypto/crypto_internal.h @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto_internal.h,v 1.10 2024/04/17 14:43:37 jsing Exp $ */ +/* $OpenBSD: crypto_internal.h,v 1.11 2024/08/11 13:02:39 jsing Exp $ */ /* * Copyright (c) 2023 Joel Sing * @@ -20,6 +20,8 @@ #include #include +#include "crypto_arch.h" + #ifndef HEADER_CRYPTO_INTERNAL_H #define HEADER_CRYPTO_INTERNAL_H diff --git a/lib/libcrypto/rc4/rc4.c b/lib/libcrypto/rc4/rc4.c index 203fee4996b..930d0d9bb35 100644 --- a/lib/libcrypto/rc4/rc4.c +++ b/lib/libcrypto/rc4/rc4.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rc4.c,v 1.11 2024/03/28 12:11:26 jsing Exp $ */ +/* $OpenBSD: rc4.c,v 1.12 2024/08/11 13:02:39 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -60,6 +60,8 @@ #include +#include "crypto_arch.h" + /* RC4 as implemented from a posting from * Newsgroups: sci.crypt * From: sterndark@netcom.com (David Sterndark)