summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-30 04:28:35 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-10-02 14:37:53 +0200
commit780269c181e73de1ccb4de3b42dee87754182058 (patch)
treef7432bd249448fd9d26663929aa7cde1084d90e4 /src
parent26a82eb11ce80f9f82cfdd3f3e9353c1d21e822e (diff)
crypto: use ZINC_ARCH macros
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'src')
-rw-r--r--src/crypto/zinc/chacha20/chacha20-arm-glue.h8
-rw-r--r--src/crypto/zinc/poly1305/poly1305-arm-glue.h10
2 files changed, 9 insertions, 9 deletions
diff --git a/src/crypto/zinc/chacha20/chacha20-arm-glue.h b/src/crypto/zinc/chacha20/chacha20-arm-glue.h
index 2504448..163815f 100644
--- a/src/crypto/zinc/chacha20/chacha20-arm-glue.h
+++ b/src/crypto/zinc/chacha20/chacha20-arm-glue.h
@@ -5,7 +5,7 @@
#include <asm/hwcap.h>
#include <asm/neon.h>
-#if defined(CONFIG_ARM)
+#if defined(CONFIG_ZINC_ARCH_ARM)
#include <asm/system_info.h>
#include <asm/cputype.h>
#endif
@@ -20,9 +20,9 @@ static bool chacha20_use_neon __ro_after_init;
static void __init chacha20_fpu_init(void)
{
-#if defined(CONFIG_ARM64)
+#if defined(CONFIG_ZINC_ARCH_ARM64)
chacha20_use_neon = elf_hwcap & HWCAP_ASIMD;
-#elif defined(CONFIG_ARM)
+#elif defined(CONFIG_ZINC_ARCH_ARM)
switch (read_cpuid_part()) {
case ARM_CPU_PART_CORTEX_A7:
case ARM_CPU_PART_CORTEX_A5:
@@ -73,7 +73,7 @@ static inline bool hchacha20_arch(u32 derived_key[CHACHA20_KEY_WORDS],
const u8 key[HCHACHA20_KEY_SIZE],
simd_context_t *simd_context)
{
- if (IS_ENABLED(CONFIG_ARM)) {
+ if (IS_ENABLED(CONFIG_ZINC_ARCH_ARM)) {
u32 x[] = { CHACHA20_CONSTANT_EXPA,
CHACHA20_CONSTANT_ND_3,
CHACHA20_CONSTANT_2_BY,
diff --git a/src/crypto/zinc/poly1305/poly1305-arm-glue.h b/src/crypto/zinc/poly1305/poly1305-arm-glue.h
index ca2ed5a..c694524 100644
--- a/src/crypto/zinc/poly1305/poly1305-arm-glue.h
+++ b/src/crypto/zinc/poly1305/poly1305-arm-glue.h
@@ -18,14 +18,14 @@ static bool poly1305_use_neon __ro_after_init;
static void __init poly1305_fpu_init(void)
{
-#if defined(CONFIG_ARM64)
+#if defined(CONFIG_ZINC_ARCH_ARM64)
poly1305_use_neon = elf_hwcap & HWCAP_ASIMD;
-#elif defined(CONFIG_ARM)
+#elif defined(CONFIG_ZINC_ARCH_ARM)
poly1305_use_neon = elf_hwcap & HWCAP_NEON;
#endif
}
-#if defined(CONFIG_ARM64)
+#if defined(CONFIG_ZINC_ARCH_ARM64)
struct poly1305_arch_internal {
union {
u32 h[5];
@@ -36,7 +36,7 @@ struct poly1305_arch_internal {
u64 is_base2_26;
u64 r[2];
};
-#elif defined(CONFIG_ARM)
+#elif defined(CONFIG_ZINC_ARCH_ARM)
struct poly1305_arch_internal {
union {
u32 h[5];
@@ -65,7 +65,7 @@ static void convert_to_base2_64(void *ctx)
state->h0 = ((u64)state->h[2] << 52) | ((u64)state->h[1] << 26) | state->h[0];
state->h1 = ((u64)state->h[4] << 40) | ((u64)state->h[3] << 14) | (state->h[2] >> 12);
state->h2 = state->h[4] >> 24;
- if (IS_ENABLED(CONFIG_ARM) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) {
+ if (IS_ENABLED(CONFIG_ZINC_ARCH_ARM) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN)) {
state->h0 = rol64(state->h0, 32);
state->h1 = rol64(state->h1, 32);
}