Lines Matching refs:GHASH_BLOCK_SIZE
31 #define GHASH_BLOCK_SIZE 16 macro
46 u8 buf[GHASH_BLOCK_SIZE];
107 src += GHASH_BLOCK_SIZE; in ghash_do_update()
110 crypto_xor((u8 *)&dst, in, GHASH_BLOCK_SIZE); in ghash_do_update()
120 #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()
152 src += chunk * GHASH_BLOCK_SIZE; in ghash_update()
164 unsigned int partial = ctx->count % GHASH_BLOCK_SIZE; in ghash_final()
169 memset(ctx->buf + partial, 0, GHASH_BLOCK_SIZE - partial); in ghash_final()
197 memcpy(&key->k, inkey, GHASH_BLOCK_SIZE); in __ghash_setkey()
219 if (keylen != GHASH_BLOCK_SIZE) { in ghash_setkey()
231 .base.cra_blocksize = GHASH_BLOCK_SIZE,
259 u8 key[GHASH_BLOCK_SIZE]; in gcm_setkey()
291 int buf_added = min(count, GHASH_BLOCK_SIZE - *buf_count); in gcm_update_mac()
300 if (count >= GHASH_BLOCK_SIZE || *buf_count == GHASH_BLOCK_SIZE) { in gcm_update_mac()
301 int blocks = count / GHASH_BLOCK_SIZE; in gcm_update_mac()
306 src += blocks * GHASH_BLOCK_SIZE; in gcm_update_mac()
307 count %= GHASH_BLOCK_SIZE; in gcm_update_mac()
321 u8 buf[GHASH_BLOCK_SIZE]; in gcm_calculate_auth_mac()
347 memset(&buf[buf_count], 0, GHASH_BLOCK_SIZE - buf_count); in gcm_calculate_auth_mac()
456 u8 buf[GHASH_BLOCK_SIZE]; in gcm_encrypt()
464 if (walk.nbytes > GHASH_BLOCK_SIZE) { in gcm_encrypt()
466 dst += GHASH_BLOCK_SIZE; in gcm_encrypt()
467 nbytes %= GHASH_BLOCK_SIZE; in gcm_encrypt()
471 memset(buf + nbytes, 0, GHASH_BLOCK_SIZE - nbytes); in gcm_encrypt()
497 u8 buf[2 * GHASH_BLOCK_SIZE]; in gcm_decrypt()
597 if (walk.nbytes > GHASH_BLOCK_SIZE) { in gcm_decrypt()
599 src += GHASH_BLOCK_SIZE; in gcm_decrypt()
600 nbytes %= GHASH_BLOCK_SIZE; in gcm_decrypt()
604 memset(buf + nbytes, 0, GHASH_BLOCK_SIZE - nbytes); in gcm_decrypt()