From 73d924f643be938205d434dc7ba7aa642150ba84 Mon Sep 17 00:00:00 2001 From: Brent Cook Date: Thu, 23 Mar 2023 06:07:31 -0500 Subject: fix mips/mips64 builds --- crypto/Makefile.am | 16 ++++++++++++---- crypto/Makefile.am.elf-mips | 24 ++++++++++++++++++++++++ crypto/Makefile.am.elf-mips64 | 24 ++++++++++++++++++++++++ crypto/bn/arch/mips/bn_arch.h | 24 ++++++++++++++++++++++++ 4 files changed, 84 insertions(+), 4 deletions(-) create mode 100644 crypto/Makefile.am.elf-mips create mode 100644 crypto/Makefile.am.elf-mips64 create mode 100644 crypto/bn/arch/mips/bn_arch.h (limited to 'crypto') diff --git a/crypto/Makefile.am b/crypto/Makefile.am index e456198..3939802 100644 --- a/crypto/Makefile.am +++ b/crypto/Makefile.am @@ -136,10 +136,6 @@ endif libcrypto_la_CPPFLAGS = -I$(top_srcdir)/crypto/hidden ${AM_CPPFLAGS} libcrypto_la_CPPFLAGS += -DLIBRESSL_INTERNAL libcrypto_la_CPPFLAGS += -DOPENSSL_NO_HW_PADLOCK -if OPENSSL_NO_ASM -libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM -else -endif if OPENSSLDIR_DEFINED libcrypto_la_CPPFLAGS += -DOPENSSLDIR=\"@OPENSSLDIR@\" @@ -247,16 +243,21 @@ libcrypto_la_SOURCES = EXTRA_libcrypto_la_SOURCES = include Makefile.am.elf-arm +include Makefile.am.elf-mips +include Makefile.am.elf-mips64 include Makefile.am.elf-x86_64 include Makefile.am.macosx-x86_64 include Makefile.am.masm-x86_64 include Makefile.am.mingw64-x86_64 if !HOST_ASM_ELF_ARM +if !HOST_ASM_ELF_MIPS +if !HOST_ASM_ELF_MIPS64 if !HOST_ASM_ELF_X86_64 if !HOST_ASM_MACOSX_X86_64 if !HOST_ASM_MASM_X86_64 if !HOST_ASM_MINGW64_X86_64 +libcrypto_la_CPPFLAGS += -DOPENSSL_NO_ASM libcrypto_la_SOURCES += aes/aes_cbc.c libcrypto_la_SOURCES += aes/aes_core.c libcrypto_la_SOURCES += camellia/camellia.c @@ -269,6 +270,8 @@ endif endif endif endif +endif +endif libcrypto_la_SOURCES += cpt_err.c libcrypto_la_SOURCES += cryptlib.c @@ -459,6 +462,11 @@ libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/i386/ endif noinst_HEADERS += bn/arch/i386/bn_arch.h +if HOST_MIPS +libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips/ +endif +noinst_HEADERS += bn/arch/mips/bn_arch.h + if HOST_MIPS64 libcrypto_la_CPPFLAGS += -I$(top_srcdir)/crypto/bn/arch/mips64/ endif diff --git a/crypto/Makefile.am.elf-mips b/crypto/Makefile.am.elf-mips new file mode 100644 index 0000000..9c4a70f --- /dev/null +++ b/crypto/Makefile.am.elf-mips @@ -0,0 +1,24 @@ +ASM_MIPS_ELF = aes/aes-mips.S +ASM_MIPS_ELF += bn/bn-mips.S +ASM_MIPS_ELF += bn/mont-mips.S +ASM_MIPS_ELF += sha/sha1-mips.S +ASM_MIPS_ELF += sha/sha512-mips.S +ASM_MIPS_ELF += sha/sha256-mips.S + +ASM_MIPS_ELF += aes/aes_cbc.c +ASM_MIPS_ELF += camellia/camellia.c +ASM_MIPS_ELF += camellia/cmll_cbc.c +ASM_MIPS_ELF += rc4/rc4_enc.c +ASM_MIPS_ELF += rc4/rc4_skey.c +ASM_MIPS_ELF += whrlpool/wp_block.c + +EXTRA_DIST += $(ASM_MIPS_ELF) + +if HOST_ASM_ELF_MIPS +libcrypto_la_CPPFLAGS += -DAES_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT +libcrypto_la_CPPFLAGS += -DSHA1_ASM +libcrypto_la_CPPFLAGS += -DSHA256_ASM +libcrypto_la_CPPFLAGS += -DSHA512_ASM +libcrypto_la_SOURCES += $(ASM_MIPS_ELF) +endif diff --git a/crypto/Makefile.am.elf-mips64 b/crypto/Makefile.am.elf-mips64 new file mode 100644 index 0000000..c599fa8 --- /dev/null +++ b/crypto/Makefile.am.elf-mips64 @@ -0,0 +1,24 @@ +ASM_MIPS64_ELF = aes/aes-mips.S +ASM_MIPS64_ELF += bn/bn-mips.S +ASM_MIPS64_ELF += bn/mont-mips.S +ASM_MIPS64_ELF += sha/sha1-mips.S +ASM_MIPS64_ELF += sha/sha512-mips.S +ASM_MIPS64_ELF += sha/sha256-mips.S + +ASM_MIPS64_ELF += aes/aes_cbc.c +ASM_MIPS64_ELF += camellia/camellia.c +ASM_MIPS64_ELF += camellia/cmll_cbc.c +ASM_MIPS64_ELF += rc4/rc4_enc.c +ASM_MIPS64_ELF += rc4/rc4_skey.c +ASM_MIPS64_ELF += whrlpool/wp_block.c + +EXTRA_DIST += $(ASM_MIPS64_ELF) + +if HOST_ASM_ELF_MIPS64 +libcrypto_la_CPPFLAGS += -DAES_ASM +libcrypto_la_CPPFLAGS += -DOPENSSL_BN_ASM_MONT +libcrypto_la_CPPFLAGS += -DSHA1_ASM +libcrypto_la_CPPFLAGS += -DSHA256_ASM +libcrypto_la_CPPFLAGS += -DSHA512_ASM +libcrypto_la_SOURCES += $(ASM_MIPS64_ELF) +endif diff --git a/crypto/bn/arch/mips/bn_arch.h b/crypto/bn/arch/mips/bn_arch.h new file mode 100644 index 0000000..4d6571f --- /dev/null +++ b/crypto/bn/arch/mips/bn_arch.h @@ -0,0 +1,24 @@ +/* $OpenBSD: bn_arch.h,v 1.1 2023/01/20 10:04:34 jsing Exp $ */ +/* + * Copyright (c) 2023 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_BN_ARCH_H +#define HEADER_BN_ARCH_H + +#ifndef OPENSSL_NO_ASM + +#endif +#endif -- cgit v1.2.3-55-g6feb