GHASH_BLOCK_SIZE
u8 buf[GHASH_BLOCK_SIZE] = {};
if (keylen != GHASH_BLOCK_SIZE)
memcpy(&key->k, inkey, GHASH_BLOCK_SIZE);
.base.cra_blocksize = GHASH_BLOCK_SIZE,
int buf_added = min(count, GHASH_BLOCK_SIZE - *buf_count);
if (count >= GHASH_BLOCK_SIZE || *buf_count == GHASH_BLOCK_SIZE) {
int blocks = count / GHASH_BLOCK_SIZE;
src += blocks * GHASH_BLOCK_SIZE;
count %= GHASH_BLOCK_SIZE;
u8 buf[GHASH_BLOCK_SIZE];
memset(&buf[buf_count], 0, GHASH_BLOCK_SIZE - buf_count);
blocks = len / GHASH_BLOCK_SIZE;
return len - blocks * GHASH_BLOCK_SIZE;
src += chunk * GHASH_BLOCK_SIZE;
u8 buf[GHASH_BLOCK_SIZE] = {};
if (keylen != GHASH_BLOCK_SIZE)
memcpy(&key->k, inkey, GHASH_BLOCK_SIZE);
.base.cra_blocksize = GHASH_BLOCK_SIZE,
u8 key[GHASH_BLOCK_SIZE];
memcpy(&ctx->ghash_key.k, key, GHASH_BLOCK_SIZE);
int buf_added = min(count, GHASH_BLOCK_SIZE - *buf_count);
if (count >= GHASH_BLOCK_SIZE || *buf_count == GHASH_BLOCK_SIZE) {
int blocks = count / GHASH_BLOCK_SIZE;
src += blocks * GHASH_BLOCK_SIZE;
count %= GHASH_BLOCK_SIZE;
u8 buf[GHASH_BLOCK_SIZE];
memset(&buf[buf_count], 0, GHASH_BLOCK_SIZE - buf_count);
#define MAX_BLOCKS (SZ_64K / GHASH_BLOCK_SIZE)
blocks = len / GHASH_BLOCK_SIZE;
len -= blocks * GHASH_BLOCK_SIZE;
nblocks = n / GHASH_BLOCK_SIZE;
p += nblocks * GHASH_BLOCK_SIZE;
buflen = n % GHASH_BLOCK_SIZE;
memset(&buffer[buflen], 0, GHASH_BLOCK_SIZE - buflen);
u8 __aligned(8) buffer[GHASH_BLOCK_SIZE];
if (n + buflen < GHASH_BLOCK_SIZE) {
unsigned int l = GHASH_BLOCK_SIZE - buflen;
crypto_xor((u8 *)dctx->shash, src, GHASH_BLOCK_SIZE);
srclen -= GHASH_BLOCK_SIZE;
src += GHASH_BLOCK_SIZE;
u8 buf[GHASH_BLOCK_SIZE] = {};
.cra_blocksize = GHASH_BLOCK_SIZE,
if (keylen != GHASH_BLOCK_SIZE)
memcpy(&ctx->key, key, GHASH_BLOCK_SIZE);
gcm_ghash_p8(dctx->shash, ctx->htable, src, GHASH_BLOCK_SIZE);
crypto_xor((u8 *)dctx->shash, src, GHASH_BLOCK_SIZE);
int remain = srclen - round_down(srclen, GHASH_BLOCK_SIZE);
riscv64_ghash_blocks(tctx, dctx, buf, GHASH_BLOCK_SIZE);
.cra_blocksize = GHASH_BLOCK_SIZE,
if (keylen != GHASH_BLOCK_SIZE)
memcpy(&tctx->key, key, GHASH_BLOCK_SIZE);
GHASH_BLOCK_SIZE);
src += GHASH_BLOCK_SIZE;
srclen -= GHASH_BLOCK_SIZE;
round_down(srclen, GHASH_BLOCK_SIZE));
return srclen - round_down(srclen, GHASH_BLOCK_SIZE);
u8 buf[GHASH_BLOCK_SIZE] = {};
u8 j0[GHASH_BLOCK_SIZE];/* initial counter value */
.ivsize = GHASH_BLOCK_SIZE - sizeof(u32),
memcpy(dctx->key, ctx->key, GHASH_BLOCK_SIZE);
.cra_blocksize = GHASH_BLOCK_SIZE,
u8 key[GHASH_BLOCK_SIZE];
u8 icv[GHASH_BLOCK_SIZE];
u8 key[GHASH_BLOCK_SIZE];
memcpy(dctx->key, ctx->key, GHASH_BLOCK_SIZE);
if (keylen != GHASH_BLOCK_SIZE)
memcpy(ctx->key, key, GHASH_BLOCK_SIZE);
n = srclen & ~(GHASH_BLOCK_SIZE - 1);
u8 buf[GHASH_BLOCK_SIZE] = {};
cpacf_kimd(CPACF_KIMD_GHASH, dctx, buf, GHASH_BLOCK_SIZE);
memcpy(dst, dctx->icv, GHASH_BLOCK_SIZE);
memcpy(dst, buf, GHASH_BLOCK_SIZE);
.cra_blocksize = GHASH_BLOCK_SIZE,
if (keylen != GHASH_BLOCK_SIZE)
memcpy(dst, buf, GHASH_BLOCK_SIZE);
.cra_blocksize = GHASH_BLOCK_SIZE,
if (keylen != GHASH_BLOCK_SIZE)
BUILD_BUG_ON(sizeof(k) != GHASH_BLOCK_SIZE);
memcpy(&k, key, GHASH_BLOCK_SIZE); /* avoid violating alignment rules */
memzero_explicit(&k, GHASH_BLOCK_SIZE);
crypto_xor(dst, src, GHASH_BLOCK_SIZE);
src += GHASH_BLOCK_SIZE;
srclen -= GHASH_BLOCK_SIZE;
} while (srclen >= GHASH_BLOCK_SIZE);
ctx->state_sz = GHASH_BLOCK_SIZE;
u8 buffer[GHASH_BLOCK_SIZE];
crypto_xor((u8 *)ghash, src, min(len, GHASH_BLOCK_SIZE));
src += GHASH_BLOCK_SIZE;
len -= GHASH_BLOCK_SIZE;