diff options
Diffstat (limited to 'src/crypto/zinc')
-rw-r--r-- | src/crypto/zinc/blake2s/blake2s-x86_64-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/blake2s/blake2s.c | 4 | ||||
-rw-r--r-- | src/crypto/zinc/chacha20/chacha20-arm-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/chacha20/chacha20-mips-glue.h | 4 | ||||
-rw-r--r-- | src/crypto/zinc/chacha20/chacha20-x86_64-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/chacha20/chacha20.c | 8 | ||||
-rw-r--r-- | src/crypto/zinc/curve25519/curve25519-arm-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/curve25519/curve25519-x86_64-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/curve25519/curve25519.c | 6 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305-arm-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305-mips-glue.h | 4 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305-x86_64-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305.c | 8 |
13 files changed, 22 insertions, 33 deletions
diff --git a/src/crypto/zinc/blake2s/blake2s-x86_64-glue.h b/src/crypto/zinc/blake2s/blake2s-x86_64-glue.h index f0b43e8..e7cbef7 100644 --- a/src/crypto/zinc/blake2s/blake2s-x86_64-glue.h +++ b/src/crypto/zinc/blake2s/blake2s-x86_64-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/blake2s.h> #include <asm/cpufeature.h> #include <asm/processor.h> #include <asm/fpu/api.h> @@ -60,5 +59,3 @@ static inline bool blake2s_arch(struct blake2s_state *state, const u8 *block, #endif return false; } - -#define HAVE_BLAKE2S_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/blake2s/blake2s.c b/src/crypto/zinc/blake2s/blake2s.c index d0b9bb9..bedff1e 100644 --- a/src/crypto/zinc/blake2s/blake2s.c +++ b/src/crypto/zinc/blake2s/blake2s.c @@ -111,7 +111,9 @@ void blake2s_init_key(struct blake2s_state *state, const size_t outlen, } EXPORT_SYMBOL(blake2s_init_key); -#ifndef HAVE_BLAKE2S_ARCH_IMPLEMENTATION +#if defined(CONFIG_ZINC_ARCH_X86_64) +#include "blake2s-x86_64-glue.h" +#else void __init blake2s_fpu_init(void) { } diff --git a/src/crypto/zinc/chacha20/chacha20-arm-glue.h b/src/crypto/zinc/chacha20/chacha20-arm-glue.h index 0c8c9d5..1de1a71 100644 --- a/src/crypto/zinc/chacha20/chacha20-arm-glue.h +++ b/src/crypto/zinc/chacha20/chacha20-arm-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/chacha20.h> #include <asm/hwcap.h> #include <asm/neon.h> @@ -46,5 +45,3 @@ static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce, { return false; } - -#define HAVE_CHACHA20_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/chacha20/chacha20-mips-glue.h b/src/crypto/zinc/chacha20/chacha20-mips-glue.h index e4185e1..4bdaea5 100644 --- a/src/crypto/zinc/chacha20/chacha20-mips-glue.h +++ b/src/crypto/zinc/chacha20/chacha20-mips-glue.h @@ -3,8 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/chacha20.h> - asmlinkage void chacha20_mips(u8 *out, const u8 *in, const size_t len, const u32 key[8], const u32 counter[4]); void __init chacha20_fpu_init(void) @@ -24,5 +22,3 @@ static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce, { return false; } - -#define HAVE_CHACHA20_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/chacha20/chacha20-x86_64-glue.h b/src/crypto/zinc/chacha20/chacha20-x86_64-glue.h index aef9697..e9a0d1e 100644 --- a/src/crypto/zinc/chacha20/chacha20-x86_64-glue.h +++ b/src/crypto/zinc/chacha20/chacha20-x86_64-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/chacha20.h> #include <asm/fpu/api.h> #include <asm/cpufeature.h> #include <asm/processor.h> @@ -101,5 +100,3 @@ static inline bool hchacha20_arch(u8 *derived_key, const u8 *nonce, #endif return false; } - -#define HAVE_CHACHA20_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/chacha20/chacha20.c b/src/crypto/zinc/chacha20/chacha20.c index da04d5b..a7156a9 100644 --- a/src/crypto/zinc/chacha20/chacha20.c +++ b/src/crypto/zinc/chacha20/chacha20.c @@ -12,7 +12,13 @@ #include <linux/kernel.h> #include <crypto/algapi.h> -#ifndef HAVE_CHACHA20_ARCH_IMPLEMENTATION +#if defined(CONFIG_ZINC_ARCH_X86_64) +#include "chacha20-x86_64-glue.h" +#elif defined(CONFIG_ZINC_ARCH_ARM) || defined(CONFIG_ZINC_ARCH_ARM64) +#include "chacha20-arm-glue.h" +#elif defined(CONFIG_ZINC_ARCH_MIPS) +#include "chacha20-mips-glue.h" +#else void __init chacha20_fpu_init(void) { } diff --git a/src/crypto/zinc/curve25519/curve25519-arm-glue.h b/src/crypto/zinc/curve25519/curve25519-arm-glue.h index 494fd3e..1b39920 100644 --- a/src/crypto/zinc/curve25519/curve25519-arm-glue.h +++ b/src/crypto/zinc/curve25519/curve25519-arm-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/curve25519.h> #include <asm/hwcap.h> #include <asm/neon.h> #include <asm/simd.h> @@ -42,5 +41,3 @@ static inline bool curve25519_base_arch(u8 pub[CURVE25519_POINT_SIZE], { return false; } - -#define HAVE_CURVE25519_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/curve25519/curve25519-x86_64-glue.h b/src/crypto/zinc/curve25519/curve25519-x86_64-glue.h index 3996b48..9159460 100644 --- a/src/crypto/zinc/curve25519/curve25519-x86_64-glue.h +++ b/src/crypto/zinc/curve25519/curve25519-x86_64-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/curve25519.h> #include <asm/cpufeature.h> #include <asm/processor.h> @@ -45,5 +44,3 @@ static inline bool curve25519_base_arch(u8 pub[CURVE25519_POINT_SIZE], } return false; } - -#define HAVE_CURVE25519_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/curve25519/curve25519.c b/src/crypto/zinc/curve25519/curve25519.c index a20b295..7d19fb9 100644 --- a/src/crypto/zinc/curve25519/curve25519.c +++ b/src/crypto/zinc/curve25519/curve25519.c @@ -17,7 +17,11 @@ #include <linux/random.h> #include <crypto/algapi.h> -#ifndef HAVE_CURVE25519_ARCH_IMPLEMENTATION +#if defined(CONFIG_ZINC_ARCH_X86_64) +#include "curve25519-x86_64-glue.h" +#elif defined(CONFIG_ZINC_ARCH_ARM) +#include "curve25519-arm-glue.h" +#else void __init curve25519_fpu_init(void) { } diff --git a/src/crypto/zinc/poly1305/poly1305-arm-glue.h b/src/crypto/zinc/poly1305/poly1305-arm-glue.h index 6ec2fc8..50fb519 100644 --- a/src/crypto/zinc/poly1305/poly1305-arm-glue.h +++ b/src/crypto/zinc/poly1305/poly1305-arm-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/poly1305.h> #include <asm/hwcap.h> #include <asm/neon.h> @@ -64,5 +63,3 @@ static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE], poly1305_emit_arm(ctx, mac, nonce); return true; } - -#define HAVE_POLY1305_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/poly1305/poly1305-mips-glue.h b/src/crypto/zinc/poly1305/poly1305-mips-glue.h index 0e72c8b..6af3f57 100644 --- a/src/crypto/zinc/poly1305/poly1305-mips-glue.h +++ b/src/crypto/zinc/poly1305/poly1305-mips-glue.h @@ -3,8 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/poly1305.h> - asmlinkage void poly1305_init_mips(void *ctx, const u8 key[16]); asmlinkage void poly1305_blocks_mips(void *ctx, const u8 *inp, const size_t len, const u32 padbit); @@ -35,5 +33,3 @@ static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE], poly1305_emit_mips(ctx, mac, nonce); return true; } - -#define HAVE_POLY1305_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h index a884d22..63e2a5c 100644 --- a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h +++ b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h @@ -3,7 +3,6 @@ * Copyright (C) 2015-2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved. */ -#include <zinc/poly1305.h> #include <asm/cpufeature.h> #include <asm/processor.h> #include <asm/intel-family.h> @@ -117,5 +116,3 @@ static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE], poly1305_emit_x86_64(ctx, mac, nonce); return true; } - -#define HAVE_POLY1305_ARCH_IMPLEMENTATION diff --git a/src/crypto/zinc/poly1305/poly1305.c b/src/crypto/zinc/poly1305/poly1305.c index a098b61..aad6587 100644 --- a/src/crypto/zinc/poly1305/poly1305.c +++ b/src/crypto/zinc/poly1305/poly1305.c @@ -13,7 +13,13 @@ #include <linux/kernel.h> #include <linux/string.h> -#ifndef HAVE_POLY1305_ARCH_IMPLEMENTATION +#if defined(CONFIG_ZINC_ARCH_X86_64) +#include "poly1305-x86_64-glue.h" +#elif defined(CONFIG_ZINC_ARCH_ARM) || defined(CONFIG_ZINC_ARCH_ARM64) +#include "poly1305-arm-glue.h" +#elif defined(CONFIG_ZINC_ARCH_MIPS) || defined(CONFIG_ZINC_ARCH_MIPS64) +#include "poly1305-mips-glue.h" +#else static inline bool poly1305_init_arch(void *ctx, const u8 key[POLY1305_KEY_SIZE]) { |