Skip to content

Commit f9e7fe3

Browse files
zx2c4herbertx
authored andcommitted
crypto: x86/poly1305 - emit does base conversion itself
The emit code does optional base conversion itself in assembly, so we don't need to do that here. Also, neither one of these functions uses simd instructions, so checking for that doesn't make sense either. Signed-off-by: Jason A. Donenfeld <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent 2203d3f commit f9e7fe3

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

arch/x86/crypto/poly1305_glue.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,9 @@ static void poly1305_simd_blocks(void *ctx, const u8 *inp, size_t len,
123123
static void poly1305_simd_emit(void *ctx, u8 mac[POLY1305_DIGEST_SIZE],
124124
const u32 nonce[4])
125125
{
126-
struct poly1305_arch_internal *state = ctx;
127-
128-
if (!IS_ENABLED(CONFIG_AS_AVX) || !static_branch_likely(&poly1305_use_avx) ||
129-
!state->is_base2_26 || !crypto_simd_usable()) {
130-
convert_to_base2_64(ctx);
126+
if (!IS_ENABLED(CONFIG_AS_AVX) || !static_branch_likely(&poly1305_use_avx))
131127
poly1305_emit_x86_64(ctx, mac, nonce);
132-
} else
128+
else
133129
poly1305_emit_avx(ctx, mac, nonce);
134130
}
135131

0 commit comments

Comments
 (0)