aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2018-09-18 02:45:03 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2018-09-18 04:21:16 +0200
commit43a55a6e8eb3b707193049b8d7616ca4ff57b06f (patch)
treeec3757b7c0adb01af0a2583f24f01a4f9b1ced77 /src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
parentcrypto: allow for disabling simd in zinc modules (diff)
downloadwireguard-monolithic-historical-43a55a6e8eb3b707193049b8d7616ca4ff57b06f.tar.xz
wireguard-monolithic-historical-43a55a6e8eb3b707193049b8d7616ca4ff57b06f.zip
poly1305-x86_64: show full struct for state
Diffstat (limited to '')
-rw-r--r--src/crypto/zinc/poly1305/poly1305-x86_64-glue.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
index 2158863..d6495cd 100644
--- a/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
+++ b/src/crypto/zinc/poly1305/poly1305-x86_64-glue.h
@@ -61,8 +61,11 @@ static inline bool poly1305_init_arch(void *ctx,
}
struct poly1305_arch_internal {
- u32 state[5];
- u32 simd_is_engaged;
+ u32 h[5];
+ u32 is_base2_26;
+ u64 r[2];
+ u64 pad;
+ struct { u32 r2, r1, r4, r3; } rn[9];
};
static inline bool poly1305_blocks_arch(void *ctx, const u8 *inp,
@@ -72,7 +75,7 @@ static inline bool poly1305_blocks_arch(void *ctx, const u8 *inp,
struct poly1305_arch_internal *state = ctx;
if (!poly1305_use_avx ||
- (len < (POLY1305_BLOCK_SIZE * 18) && !state->simd_is_engaged) ||
+ (len < (POLY1305_BLOCK_SIZE * 18) && !state->is_base2_26) ||
!simd_use(simd_context))
poly1305_blocks_x86_64(ctx, inp, len, padbit);
else
@@ -101,8 +104,7 @@ static inline bool poly1305_emit_arch(void *ctx, u8 mac[POLY1305_MAC_SIZE],
{
struct poly1305_arch_internal *state = ctx;
- if (!poly1305_use_avx || !state->simd_is_engaged ||
- !simd_use(simd_context))
+ if (!poly1305_use_avx || !state->is_base2_26 ||!simd_use(simd_context))
poly1305_emit_x86_64(ctx, mac, nonce);
else
#ifdef CONFIG_AS_AVX512