Lines Matching refs:GHASH_BLOCK_SIZE
29 #define GHASH_BLOCK_SIZE 16 macro
44 u8 buf[GHASH_BLOCK_SIZE];
103 src += GHASH_BLOCK_SIZE; in ghash_do_update()
106 crypto_xor((u8 *)&dst, in, GHASH_BLOCK_SIZE); in ghash_do_update()
116 #define MAX_BLOCKS (SZ_64K / GHASH_BLOCK_SIZE)
126 unsigned int partial = ctx->count % GHASH_BLOCK_SIZE; in __ghash_update()
130 if ((partial + len) >= GHASH_BLOCK_SIZE) { in __ghash_update()
135 int p = GHASH_BLOCK_SIZE - partial; in __ghash_update()
142 blocks = len / GHASH_BLOCK_SIZE; in __ghash_update()
143 len %= GHASH_BLOCK_SIZE; in __ghash_update()
153 src += chunk * GHASH_BLOCK_SIZE; in __ghash_update()
177 unsigned int partial = ctx->count % GHASH_BLOCK_SIZE; in ghash_final_p8()
182 memset(ctx->buf + partial, 0, GHASH_BLOCK_SIZE - partial); in ghash_final_p8()
197 unsigned int partial = ctx->count % GHASH_BLOCK_SIZE; in ghash_final_p64()
202 memset(ctx->buf + partial, 0, GHASH_BLOCK_SIZE - partial); in ghash_final_p64()
231 memcpy(&key->k, inkey, GHASH_BLOCK_SIZE); in __ghash_setkey()
253 if (keylen != GHASH_BLOCK_SIZE) { in ghash_setkey()
265 .base.cra_blocksize = GHASH_BLOCK_SIZE,
279 .base.cra_blocksize = GHASH_BLOCK_SIZE,
307 u8 key[GHASH_BLOCK_SIZE]; in gcm_setkey()
338 int buf_added = min(count, GHASH_BLOCK_SIZE - *buf_count); in gcm_update_mac()
347 if (count >= GHASH_BLOCK_SIZE || *buf_count == GHASH_BLOCK_SIZE) { in gcm_update_mac()
348 int blocks = count / GHASH_BLOCK_SIZE; in gcm_update_mac()
354 src += blocks * GHASH_BLOCK_SIZE; in gcm_update_mac()
355 count %= GHASH_BLOCK_SIZE; in gcm_update_mac()
369 u8 buf[GHASH_BLOCK_SIZE]; in gcm_calculate_auth_mac()
395 memset(&buf[buf_count], 0, GHASH_BLOCK_SIZE - buf_count); in gcm_calculate_auth_mac()
504 u8 buf[GHASH_BLOCK_SIZE]; in gcm_encrypt()
512 if (walk.nbytes > GHASH_BLOCK_SIZE) { in gcm_encrypt()
514 dst += GHASH_BLOCK_SIZE; in gcm_encrypt()
515 nbytes %= GHASH_BLOCK_SIZE; in gcm_encrypt()
519 memset(buf + nbytes, 0, GHASH_BLOCK_SIZE - nbytes); in gcm_encrypt()
546 u8 buf[2 * GHASH_BLOCK_SIZE]; in gcm_decrypt()
644 if (walk.nbytes > GHASH_BLOCK_SIZE) { in gcm_decrypt()
646 src += GHASH_BLOCK_SIZE; in gcm_decrypt()
647 nbytes %= GHASH_BLOCK_SIZE; in gcm_decrypt()
651 memset(buf + nbytes, 0, GHASH_BLOCK_SIZE - nbytes); in gcm_decrypt()