diff options
| author | jsing <> | 2025-06-28 12:39:10 +0000 |
|---|---|---|
| committer | jsing <> | 2025-06-28 12:39:10 +0000 |
| commit | 48723f4db60f6f8a8ad8424ffe5e0262d30f397c (patch) | |
| tree | a759230fee0803d4b63c471498b9c879151a7c88 /src/lib/libcrypto/arch/amd64 | |
| parent | 6021a17fa478e42f9f97414c6114ffe64731e576 (diff) | |
| download | openbsd-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.inc | 6 | ||||
| -rw-r--r-- | src/lib/libcrypto/arch/amd64/crypto_arch.h | 4 |
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 |
| 39 | CFLAGS+= -DMD5_ASM | 39 | CFLAGS+= -DMD5_ASM |
| 40 | SRCS+= md5_amd64_generic.S | 40 | SRCS+= md5_amd64_generic.S |
| 41 | |||
| 41 | # modes | 42 | # modes |
| 42 | CFLAGS+= -DGHASH_ASM | 43 | CFLAGS+= -DGHASH_ASM |
| 43 | SSLASM+= modes ghash-x86_64 | 44 | SSLASM+= modes ghash-x86_64 |
| 45 | SRCS += gcm128_amd64.c | ||
| 46 | |||
| 44 | # rc4 | 47 | # rc4 |
| 45 | SSLASM+= rc4 rc4-x86_64 | 48 | SSLASM+= rc4 rc4-x86_64 |
| 49 | |||
| 46 | # ripemd | 50 | # ripemd |
| 47 | # sha | 51 | # sha |
| 48 | SRCS+= sha1_amd64.c | 52 | SRCS+= 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 | ||
