Lines Matching refs:dctx

399 			 struct vmac_desc_ctx *dctx,  in vhash_blocks()  argument
405 u64 ch = dctx->polytmp[0]; in vhash_blocks()
406 u64 cl = dctx->polytmp[1]; in vhash_blocks()
409 if (!dctx->first_block_processed) { in vhash_blocks()
410 dctx->first_block_processed = true; in vhash_blocks()
425 dctx->polytmp[0] = ch; in vhash_blocks()
426 dctx->polytmp[1] = cl; in vhash_blocks()
482 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_init() local
484 dctx->partial_size = 0; in vmac_init()
485 dctx->first_block_processed = false; in vmac_init()
486 memcpy(dctx->polytmp, tctx->polykey, sizeof(dctx->polytmp)); in vmac_init()
487 dctx->nonce_size = 0; in vmac_init()
494 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_update() local
498 if (dctx->nonce_size < VMAC_NONCEBYTES) { in vmac_update()
499 n = min(len, VMAC_NONCEBYTES - dctx->nonce_size); in vmac_update()
500 memcpy(&dctx->nonce.bytes[dctx->nonce_size], p, n); in vmac_update()
501 dctx->nonce_size += n; in vmac_update()
506 if (dctx->partial_size) { in vmac_update()
507 n = min(len, VMAC_NHBYTES - dctx->partial_size); in vmac_update()
508 memcpy(&dctx->partial[dctx->partial_size], p, n); in vmac_update()
509 dctx->partial_size += n; in vmac_update()
512 if (dctx->partial_size == VMAC_NHBYTES) { in vmac_update()
513 vhash_blocks(tctx, dctx, dctx->partial_words, 1); in vmac_update()
514 dctx->partial_size = 0; in vmac_update()
521 vhash_blocks(tctx, dctx, (const __le64 *)p, n / VMAC_NHBYTES); in vmac_update()
527 memcpy(dctx->partial, p, len); in vmac_update()
528 dctx->partial_size = len; in vmac_update()
535 struct vmac_desc_ctx *dctx) in vhash_final() argument
537 unsigned int partial = dctx->partial_size; in vhash_final()
538 u64 ch = dctx->polytmp[0]; in vhash_final()
539 u64 cl = dctx->polytmp[1]; in vhash_final()
547 memset(&dctx->partial[partial], 0, n - partial); in vhash_final()
548 nh_16(dctx->partial_words, tctx->nhkey, n / 8, rh, rl); in vhash_final()
550 if (dctx->first_block_processed) in vhash_final()
564 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_final() local
568 if (dctx->nonce_size != VMAC_NONCEBYTES) in vmac_final()
577 if (dctx->nonce.bytes[0] & 0x80) in vmac_final()
581 hash = vhash_final(tctx, dctx); in vmac_final()
585 index = dctx->nonce.bytes[VMAC_NONCEBYTES - 1] & 1; in vmac_final()
586 dctx->nonce.bytes[VMAC_NONCEBYTES - 1] &= ~1; in vmac_final()
587 crypto_cipher_encrypt_one(tctx->cipher, dctx->nonce.bytes, in vmac_final()
588 dctx->nonce.bytes); in vmac_final()
589 pad = be64_to_cpu(dctx->nonce.pads[index]); in vmac_final()