summaryrefslogtreecommitdiff
path: root/cipher/chacha20.c
diff options
context:
space:
mode:
authorJussi Kivilinna <jussi.kivilinna@iki.fi>2022-06-12 21:51:34 +0300
committerJussi Kivilinna <jussi.kivilinna@iki.fi>2022-06-12 22:02:48 +0300
commit2c5e5ab6843d747c4b877d2c6f47226f61e9ff14 (patch)
tree0e5d1b88c23fc83c8a1dc339efc1a3735d468656 /cipher/chacha20.c
parent88fe7ac33eb4cb4dff76a5cc7fca50da5fb0ee3a (diff)
downloadlibgcrypt-2c5e5ab6843d747c4b877d2c6f47226f61e9ff14.tar.gz
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>
Diffstat (limited to 'cipher/chacha20.c')
-rw-r--r--cipher/chacha20.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cipher/chacha20.c b/cipher/chacha20.c
index 3518d95a..f0a2697e 100644
--- a/cipher/chacha20.c
+++ b/cipher/chacha20.c
@@ -504,6 +504,11 @@ chacha20_do_setkey (CHACHA20_context_t *ctx,
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