forked from pool/libgcrypt
- Update to 1.11.0: * New and extended interfaces: - Add an API for Key Encapsulation Mechanism (KEM). [T6755] - Add Streamlined NTRU Prime sntrup761 algorithm. [rCcf9923e1a5] - Add Kyber algorithm according to FIPS 203 ipd 2023-08-24. [rC18e5c0d268] - Add Classic McEliece algorithm. [rC003367b912] - Add One-Step KDF with hash and MAC. [T5964] - Add KDF algorithm HKDF of RFC-5869. [T5964] - Add KDF algorithm X963KDF for use in CMS. [rC3abac420b3] - Add GMAC-SM4 and Poly1305-SM4. [rCd1ccc409d4] - Add ARIA block cipher algorithm. [rC316c6d7715] - Add explicit FIPS indicators for MD and MAC algorithms. [T6376] - Add support for SHAKE as MGF in RSA. [T6557] - Add gcry_md_read support for SHAKE algorithms. [T6539] - Add gcry_md_hash_buffers_ext function. [T7035] - Add cSHAKE hash algorithm. [rC065b3f4e02] - Support internal generation of IV for AEAD cipher mode. [T4873] * Performance: - Add SM3 ARMv8/AArch64/CE assembly implementation. [rCfe891ff4a3] - Add SM4 ARMv8/AArch64 assembly implementation. [rCd8825601f1] - Add SM4 GFNI/AVX2 and GFI/AVX512 implementation. [rC5095d60af4,rCeaed633c16] - Add SM4 ARMv9 SVE CE assembly implementation. [rC2dc2654006] - Add PowerPC vector implementation of SM4. [rC0b2da804ee] - Optimize ChaCha20 and Poly1305 for PPC P10 LE. [T6006] - Add CTR32LE bulk acceleration for AES on PPC. [rC84f2e2d0b5] - Add generic bulk acceleration for CTR32LE mode (GCM-SIV) for SM4 and Camellia. [rCcf956793af] - Add GFNI/AVX2 implementation of Camellia. [rC4e6896eb9f] - Add AVX2 and AVX512 accelerated implementations for GHASH (GCM) and POLYVAL (GCM-SIV). [rCd857e85cb4, rCe6f3600193] OBS-URL: https://build.opensuse.org/request/show/1183811 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/libgcrypt?expand=0&rev=180
77 lines
2.9 KiB
Diff
77 lines
2.9 KiB
Diff
commit 2c5e5ab6843d747c4b877d2c6f47226f61e9ff14
|
|
Author: Jussi Kivilinna <jussi.kivilinna@iki.fi>
|
|
Date: Sun Jun 12 21:51:34 2022 +0300
|
|
|
|
ppc enable P10 assembly with ENABLE_FORCE_SOFT_HWFEATURES on arch 3.00
|
|
|
|
* cipher/chacha20.c (chacha20_do_setkey) [USE_PPC_VEC]: Enable
|
|
P10 assembly for HWF_PPC_ARCH_3_00 if ENABLE_FORCE_SOFT_HWFEATURES is
|
|
defined.
|
|
* cipher/poly1305.c (poly1305_init) [POLY1305_USE_PPC_VEC]: Likewise.
|
|
* cipher/rijndael.c (do_setkey) [USE_PPC_CRYPTO_WITH_PPC9LE]: Likewise.
|
|
---
|
|
|
|
This change allows testing P10 implementations with P9 and with QEMU-PPC.
|
|
|
|
GnuPG-bug-id: 6006
|
|
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
|
|
|
|
Index: libgcrypt-1.10.2/cipher/chacha20.c
|
|
===================================================================
|
|
--- libgcrypt-1.10.2.orig/cipher/chacha20.c
|
|
+++ libgcrypt-1.10.2/cipher/chacha20.c
|
|
@@ -484,6 +484,11 @@ chacha20_do_setkey (CHACHA20_context_t *
|
|
ctx->use_ppc = (features & HWF_PPC_ARCH_2_07) != 0;
|
|
# ifndef WORDS_BIGENDIAN
|
|
ctx->use_p10 = (features & HWF_PPC_ARCH_3_10) != 0;
|
|
+# ifdef ENABLE_FORCE_SOFT_HWFEATURES
|
|
+ /* HWF_PPC_ARCH_3_10 above is used as soft HW-feature indicator for P10.
|
|
+ * Actual implementation works with HWF_PPC_ARCH_3_00 also. */
|
|
+ ctx->use_p10 |= (features & HWF_PPC_ARCH_3_00) != 0;
|
|
+# endif
|
|
# endif
|
|
#endif
|
|
#ifdef USE_S390X_VX
|
|
Index: libgcrypt-1.10.2/cipher/poly1305.c
|
|
===================================================================
|
|
--- libgcrypt-1.10.2.orig/cipher/poly1305.c
|
|
+++ libgcrypt-1.10.2/cipher/poly1305.c
|
|
@@ -90,11 +90,19 @@ static void poly1305_init (poly1305_cont
|
|
const byte key[POLY1305_KEYLEN])
|
|
{
|
|
POLY1305_STATE *st = &ctx->state;
|
|
+ unsigned int features = _gcry_get_hw_features ();
|
|
|
|
#ifdef POLY1305_USE_PPC_VEC
|
|
- ctx->use_p10 = (_gcry_get_hw_features () & HWF_PPC_ARCH_3_10) != 0;
|
|
+ ctx->use_p10 = (features & HWF_PPC_ARCH_3_10) != 0;
|
|
+# ifdef ENABLE_FORCE_SOFT_HWFEATURES
|
|
+ /* HWF_PPC_ARCH_3_10 above is used as soft HW-feature indicator for P10.
|
|
+ * Actual implementation works with HWF_PPC_ARCH_3_00 also. */
|
|
+ ctx->use_p10 |= (features & HWF_PPC_ARCH_3_00) != 0;
|
|
+# endif
|
|
#endif
|
|
|
|
+ (void)features;
|
|
+
|
|
ctx->leftover = 0;
|
|
|
|
st->h[0] = 0;
|
|
Index: libgcrypt-1.10.2/cipher/rijndael.c
|
|
===================================================================
|
|
--- libgcrypt-1.10.2.orig/cipher/rijndael.c
|
|
+++ libgcrypt-1.10.2/cipher/rijndael.c
|
|
@@ -605,6 +605,12 @@ do_setkey (RIJNDAEL_context *ctx, const
|
|
bulk_ops->xts_crypt = _gcry_aes_ppc9le_xts_crypt;
|
|
if (hwfeatures & HWF_PPC_ARCH_3_10) /* for P10 */
|
|
bulk_ops->gcm_crypt = _gcry_aes_p10le_gcm_crypt;
|
|
+# ifdef ENABLE_FORCE_SOFT_HWFEATURES
|
|
+ /* HWF_PPC_ARCH_3_10 above is used as soft HW-feature indicator for P10.
|
|
+ * Actual implementation works with HWF_PPC_ARCH_3_00 also. */
|
|
+ if (hwfeatures & HWF_PPC_ARCH_3_00)
|
|
+ bulk_ops->gcm_crypt = _gcry_aes_p10le_gcm_crypt;
|
|
+# endif
|
|
}
|
|
#endif
|
|
#ifdef USE_PPC_CRYPTO
|