Lines Matching +full:armv8 +full:- +full:based
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Glue code for POLYVAL using ARMv8 Crypto Extensions
5 * Copyright (c) 2007 Nokia Siemens Networks - Mikko Herranen <mh1@iki.fi>
12 * Glue code based on ghash-clmulni-intel_glue.c.
15 * ARMv8 Crypto Extensions instructions to implement the finite field operations.
56 polyval_update_non4k(keys->key_powers[NUM_KEY_POWERS-1], in, in internal_polyval_update()
79 return -EINVAL; in polyval_arm64_setkey()
81 memcpy(tctx->key_powers[NUM_KEY_POWERS-1], key, POLYVAL_BLOCK_SIZE); in polyval_arm64_setkey()
83 for (i = NUM_KEY_POWERS-2; i >= 0; i--) { in polyval_arm64_setkey()
84 memcpy(tctx->key_powers[i], key, POLYVAL_BLOCK_SIZE); in polyval_arm64_setkey()
85 internal_polyval_mul(tctx->key_powers[i], in polyval_arm64_setkey()
86 tctx->key_powers[i+1]); in polyval_arm64_setkey()
105 const struct polyval_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in polyval_arm64_update()
110 if (dctx->bytes) { in polyval_arm64_update()
111 n = min(srclen, dctx->bytes); in polyval_arm64_update()
112 pos = dctx->buffer + POLYVAL_BLOCK_SIZE - dctx->bytes; in polyval_arm64_update()
114 dctx->bytes -= n; in polyval_arm64_update()
115 srclen -= n; in polyval_arm64_update()
117 while (n--) in polyval_arm64_update()
120 if (!dctx->bytes) in polyval_arm64_update()
121 internal_polyval_mul(dctx->buffer, in polyval_arm64_update()
122 tctx->key_powers[NUM_KEY_POWERS-1]); in polyval_arm64_update()
128 internal_polyval_update(tctx, src, nblocks, dctx->buffer); in polyval_arm64_update()
129 srclen -= nblocks * POLYVAL_BLOCK_SIZE; in polyval_arm64_update()
134 dctx->bytes = POLYVAL_BLOCK_SIZE - srclen; in polyval_arm64_update()
135 pos = dctx->buffer; in polyval_arm64_update()
136 while (srclen--) in polyval_arm64_update()
146 const struct polyval_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in polyval_arm64_final()
148 if (dctx->bytes) { in polyval_arm64_final()
149 internal_polyval_mul(dctx->buffer, in polyval_arm64_final()
150 tctx->key_powers[NUM_KEY_POWERS-1]); in polyval_arm64_final()
153 memcpy(dst, dctx->buffer, POLYVAL_BLOCK_SIZE); in polyval_arm64_final()
167 .cra_driver_name = "polyval-ce",
189 MODULE_DESCRIPTION("POLYVAL hash function accelerated by ARMv8 Crypto Extensions");
191 MODULE_ALIAS_CRYPTO("polyval-ce");