summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/arch/amd64
diff options
context:
space:
mode:
authorjsing <>2025-06-28 12:39:10 +0000
committerjsing <>2025-06-28 12:39:10 +0000
commit48723f4db60f6f8a8ad8424ffe5e0262d30f397c (patch)
treea759230fee0803d4b63c471498b9c879151a7c88 /src/lib/libcrypto/arch/amd64
parent6021a17fa478e42f9f97414c6114ffe64731e576 (diff)
downloadopenbsd-48723f4db60f6f8a8ad8424ffe5e0262d30f397c.tar.gz
openbsd-48723f4db60f6f8a8ad8424ffe5e0262d30f397c.tar.bz2
openbsd-48723f4db60f6f8a8ad8424ffe5e0262d30f397c.zip
Rework gcm128 implementation selection for amd64/i386.
Provide gcm128_amd64.c and gcm128_i386.c, which contain the appropriate gcm128 initialisation and CPU feature tests for the respective platform. This allows for all of the #define spagetti to be removed from gcm128.c and removes one of the two remaining consumers of crypto_cpu_caps_ia32(). ok tb@
Diffstat (limited to 'src/lib/libcrypto/arch/amd64')
-rw-r--r--src/lib/libcrypto/arch/amd64/Makefile.inc6
-rw-r--r--src/lib/libcrypto/arch/amd64/crypto_arch.h4
2 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/libcrypto/arch/amd64/Makefile.inc b/src/lib/libcrypto/arch/amd64/Makefile.inc
index 5ecf8f1390..649c507189 100644
--- a/src/lib/libcrypto/arch/amd64/Makefile.inc
+++ b/src/lib/libcrypto/arch/amd64/Makefile.inc
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile.inc,v 1.40 2025/06/15 15:11:50 jsing Exp $ 1# $OpenBSD: Makefile.inc,v 1.41 2025/06/28 12:39:10 jsing Exp $
2 2
3# amd64-specific libcrypto build rules 3# amd64-specific libcrypto build rules
4 4
@@ -38,11 +38,15 @@ SRCS += word_clz.S
38# md5 38# md5
39CFLAGS+= -DMD5_ASM 39CFLAGS+= -DMD5_ASM
40SRCS+= md5_amd64_generic.S 40SRCS+= md5_amd64_generic.S
41
41# modes 42# modes
42CFLAGS+= -DGHASH_ASM 43CFLAGS+= -DGHASH_ASM
43SSLASM+= modes ghash-x86_64 44SSLASM+= modes ghash-x86_64
45SRCS += gcm128_amd64.c
46
44# rc4 47# rc4
45SSLASM+= rc4 rc4-x86_64 48SSLASM+= rc4 rc4-x86_64
49
46# ripemd 50# ripemd
47# sha 51# sha
48SRCS+= sha1_amd64.c 52SRCS+= sha1_amd64.c
diff --git a/src/lib/libcrypto/arch/amd64/crypto_arch.h b/src/lib/libcrypto/arch/amd64/crypto_arch.h
index 213a5d903e..9f292cc530 100644
--- a/src/lib/libcrypto/arch/amd64/crypto_arch.h
+++ b/src/lib/libcrypto/arch/amd64/crypto_arch.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: crypto_arch.h,v 1.8 2025/06/28 12:20:39 jsing Exp $ */ 1/* $OpenBSD: crypto_arch.h,v 1.9 2025/06/28 12:39:10 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2024 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -40,6 +40,8 @@ extern uint64_t crypto_cpu_caps_amd64;
40#define HAVE_AES_CBC_ENCRYPT_INTERNAL 40#define HAVE_AES_CBC_ENCRYPT_INTERNAL
41#define HAVE_AES_CTR32_ENCRYPT_INTERNAL 41#define HAVE_AES_CTR32_ENCRYPT_INTERNAL
42 42
43#define HAVE_GCM128_INIT
44
43#define HAVE_RC4_INTERNAL 45#define HAVE_RC4_INTERNAL
44#define HAVE_RC4_SET_KEY_INTERNAL 46#define HAVE_RC4_SET_KEY_INTERNAL
45 47