| .. | .. |
|---|
| 12 | 12 | #include <crypto/algapi.h> |
|---|
| 13 | 13 | #include <crypto/internal/hash.h> |
|---|
| 14 | 14 | #include <crypto/internal/poly1305.h> |
|---|
| 15 | +#include <crypto/internal/simd.h> |
|---|
| 15 | 16 | #include <linux/cpufeature.h> |
|---|
| 16 | 17 | #include <linux/crypto.h> |
|---|
| 17 | 18 | #include <linux/jump_label.h> |
|---|
| .. | .. |
|---|
| 28 | 29 | |
|---|
| 29 | 30 | static __ro_after_init DEFINE_STATIC_KEY_FALSE(have_neon); |
|---|
| 30 | 31 | |
|---|
| 31 | | -void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 *key) |
|---|
| 32 | +void poly1305_init_arch(struct poly1305_desc_ctx *dctx, const u8 key[POLY1305_KEY_SIZE]) |
|---|
| 32 | 33 | { |
|---|
| 33 | 34 | poly1305_init_arm(&dctx->h, key); |
|---|
| 34 | 35 | dctx->s[0] = get_unaligned_le32(key + 16); |
|---|
| .. | .. |
|---|
| 125 | 126 | unsigned int srclen) |
|---|
| 126 | 127 | { |
|---|
| 127 | 128 | struct poly1305_desc_ctx *dctx = shash_desc_ctx(desc); |
|---|
| 128 | | - bool do_neon = may_use_simd() && srclen > 128; |
|---|
| 129 | + bool do_neon = crypto_simd_usable() && srclen > 128; |
|---|
| 129 | 130 | |
|---|
| 130 | 131 | if (static_branch_likely(&have_neon) && do_neon) |
|---|
| 131 | 132 | kernel_neon_begin(); |
|---|
| .. | .. |
|---|
| 139 | 140 | unsigned int nbytes) |
|---|
| 140 | 141 | { |
|---|
| 141 | 142 | bool do_neon = IS_ENABLED(CONFIG_KERNEL_MODE_NEON) && |
|---|
| 142 | | - may_use_simd(); |
|---|
| 143 | + crypto_simd_usable(); |
|---|
| 143 | 144 | |
|---|
| 144 | 145 | if (unlikely(dctx->buflen)) { |
|---|
| 145 | 146 | u32 bytes = min(nbytes, POLY1305_BLOCK_SIZE - dctx->buflen); |
|---|