diff options
Diffstat (limited to 'src/crypto/zinc')
-rw-r--r-- | src/crypto/zinc/chacha20poly1305.c | 8 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305-arm-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305-mips-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305-x86_64-glue.h | 3 | ||||
-rw-r--r-- | src/crypto/zinc/poly1305/poly1305.c | 8 | ||||
-rw-r--r-- | src/crypto/zinc/selftest/chacha20poly1305.h | 2 | ||||
-rw-r--r-- | src/crypto/zinc/selftest/poly1305.h | 6 |
7 files changed, 13 insertions, 20 deletions
diff --git a/src/crypto/zinc/chacha20poly1305.c b/src/crypto/zinc/chacha20poly1305.c index ee9434b..92a5b9c 100644 --- a/src/crypto/zinc/chacha20poly1305.c +++ b/src/crypto/zinc/chacha20poly1305.c @@ -45,7 +45,7 @@ __chacha20poly1305_encrypt(u8 *dst, const u8 *src, const size_t src_len, chacha20_init(&chacha20_state, key, nonce); chacha20(&chacha20_state, b.block0, b.block0, sizeof(b.block0), simd_context); - poly1305_init(&poly1305_state, b.block0, simd_context); + poly1305_init(&poly1305_state, b.block0); poly1305_update(&poly1305_state, ad, ad_len, simd_context); poly1305_update(&poly1305_state, pad0, (0x10 - ad_len) & 0xf, @@ -102,7 +102,7 @@ bool chacha20poly1305_encrypt_sg(struct scatterlist *dst, chacha20_init(&chacha20_state, key, nonce); chacha20(&chacha20_state, b.block0, b.block0, sizeof(b.block0), simd_context); - poly1305_init(&poly1305_state, b.block0, simd_context); + poly1305_init(&poly1305_state, b.block0); poly1305_update(&poly1305_state, ad, ad_len, simd_context); poly1305_update(&poly1305_state, pad0, (0x10 - ad_len) & 0xf, @@ -173,7 +173,7 @@ __chacha20poly1305_decrypt(u8 *dst, const u8 *src, const size_t src_len, chacha20_init(&chacha20_state, key, nonce); chacha20(&chacha20_state, b.block0, b.block0, sizeof(b.block0), simd_context); - poly1305_init(&poly1305_state, b.block0, simd_context); + poly1305_init(&poly1305_state, b.block0); poly1305_update(&poly1305_state, ad, ad_len, simd_context); poly1305_update(&poly1305_state, pad0, (0x10 - ad_len) & 0xf, @@ -243,7 +243,7 @@ bool chacha20poly1305_decrypt_sg(struct scatterlist *dst, chacha20_init(&chacha20_state, key, nonce); chacha20(&chacha20_state, b.block0, b.block0, sizeof(b.block0), simd_context); - poly1305_init(&poly1305_state, b.block0, simd_context); + poly1305_init(&poly1305_state, b.block0); poly1305_update(&poly1305_state, ad, ad_len, simd_context); poly1305_update(&poly1305_state, pad0, (0x10 - ad_len) & 0xf, diff --git a/src/crypto/zinc/poly1305/poly1305-arm-glue.h b/src/crypto/zinc/poly1305/poly1305-arm-glue.h index 82135e2..8181703 100644 --- a/src/crypto/zinc/poly1305/poly1305-arm-glue.h +++ b/src/crypto/zinc/poly1305/poly1305-arm-glue.h @@ -31,8 +31,7 @@ void __init poly1305_fpu_init(void) } static inline bool poly1305_init_arch(void *ctx, - const u8 key[POLY1305_KEY_SIZE], - simd_context_t simd_context) + const u8 key[POLY1305_KEY_SIZE]) { poly1305_init_arm(ctx, key); return true; diff --git a/src/crypto/zinc/poly1305/poly1305-mips-glue.h b/src/crypto/zinc/poly1305/poly1305-mips-glue.h index 0d841ff..960abee 100644 --- a/src/crypto/zinc/poly1305/poly1305-mips-glue.h +++ b/src/crypto/zinc/poly1305/poly1305-mips-glue.h @@ -14,8 +14,7 @@ void __init poly1305_fpu_init(void) } static inline bool poly1305_init_arch(void *ctx, - const u8 key[POLY1305_KEY_SIZE], - simd_context_t simd_context) + const u8 key[POLY1305_KEY_SIZE]) { poly1305_init_mips(ctx, key); return true; diff --git a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h index 8cf3ac9..7f1af44 100644 --- a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h +++ b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h @@ -55,8 +55,7 @@ void __init poly1305_fpu_init(void) } static inline bool poly1305_init_arch(void *ctx, - const u8 key[POLY1305_KEY_SIZE], - simd_context_t simd_context) + const u8 key[POLY1305_KEY_SIZE]) { poly1305_init_x86_64(ctx, key); return true; diff --git a/src/crypto/zinc/poly1305/poly1305.c b/src/crypto/zinc/poly1305/poly1305.c index 51bbfb2..d8c103f 100644 --- a/src/crypto/zinc/poly1305/poly1305.c +++ b/src/crypto/zinc/poly1305/poly1305.c @@ -15,8 +15,7 @@ #ifndef HAVE_POLY1305_ARCH_IMPLEMENTATION static inline bool poly1305_init_arch(void *ctx, - const u8 key[POLY1305_KEY_SIZE], - simd_context_t simd_context) + const u8 key[POLY1305_KEY_SIZE]) { return false; } @@ -43,15 +42,14 @@ void __init poly1305_fpu_init(void) #include "poly1305-donna32.h" #endif -void poly1305_init(struct poly1305_ctx *ctx, const u8 key[POLY1305_KEY_SIZE], - simd_context_t simd_context) +void poly1305_init(struct poly1305_ctx *ctx, const u8 key[POLY1305_KEY_SIZE]) { ctx->nonce[0] = get_unaligned_le32(&key[16]); ctx->nonce[1] = get_unaligned_le32(&key[20]); ctx->nonce[2] = get_unaligned_le32(&key[24]); ctx->nonce[3] = get_unaligned_le32(&key[28]); - if (!poly1305_init_arch(ctx->opaque, key, simd_context)) + if (!poly1305_init_arch(ctx->opaque, key)) poly1305_init_generic(ctx->opaque, key); ctx->num = 0; diff --git a/src/crypto/zinc/selftest/chacha20poly1305.h b/src/crypto/zinc/selftest/chacha20poly1305.h index f0ad51c..e5e8de5 100644 --- a/src/crypto/zinc/selftest/chacha20poly1305.h +++ b/src/crypto/zinc/selftest/chacha20poly1305.h @@ -7649,7 +7649,7 @@ chacha20poly1305_selftest_encrypt_bignonce(u8 *dst, const u8 *src, chacha20_state.counter[3] = get_unaligned_le32(nonce + 8); chacha20(&chacha20_state, b.block0, b.block0, sizeof(b.block0), simd_context); - poly1305_init(&poly1305_state, b.block0, simd_context); + poly1305_init(&poly1305_state, b.block0); poly1305_update(&poly1305_state, ad, ad_len, simd_context); poly1305_update(&poly1305_state, pad0, (0x10 - ad_len) & 0xf, simd_context); diff --git a/src/crypto/zinc/selftest/poly1305.h b/src/crypto/zinc/selftest/poly1305.h index 0f439db..d02941f 100644 --- a/src/crypto/zinc/selftest/poly1305.h +++ b/src/crypto/zinc/selftest/poly1305.h @@ -830,8 +830,7 @@ bool __init poly1305_selftest(void) memset(out, 0, sizeof(out)); memset(&poly1305, 0, sizeof(poly1305)); - poly1305_init(&poly1305, poly1305_testvecs[i].key, - simd_context); + poly1305_init(&poly1305, poly1305_testvecs[i].key); poly1305_update(&poly1305, poly1305_testvecs[i].input, poly1305_testvecs[i].ilen, simd_context); poly1305_final(&poly1305, out, simd_context); @@ -848,8 +847,7 @@ bool __init poly1305_selftest(void) for (j = 1; j < poly1305_testvecs[i].ilen - 1; ++j) { memset(out, 0, sizeof(out)); memset(&poly1305, 0, sizeof(poly1305)); - poly1305_init(&poly1305, poly1305_testvecs[i].key, - simd_context); + poly1305_init(&poly1305, poly1305_testvecs[i].key); poly1305_update(&poly1305, poly1305_testvecs[i].input, j, simd_context); poly1305_update(&poly1305, |