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()
484 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_init() local
486 dctx->partial_size = 0; in vmac_init()
487 dctx->first_block_processed = false; in vmac_init()
488 memcpy(dctx->polytmp, tctx->polykey, sizeof(dctx->polytmp)); in vmac_init()
489 dctx->nonce_size = 0; in vmac_init()
496 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_update() local
500 if (dctx->nonce_size < VMAC_NONCEBYTES) { in vmac_update()
501 n = min(len, VMAC_NONCEBYTES - dctx->nonce_size); in vmac_update()
502 memcpy(&dctx->nonce.bytes[dctx->nonce_size], p, n); in vmac_update()
503 dctx->nonce_size += n; in vmac_update()
508 if (dctx->partial_size) { in vmac_update()
509 n = min(len, VMAC_NHBYTES - dctx->partial_size); in vmac_update()
510 memcpy(&dctx->partial[dctx->partial_size], p, n); in vmac_update()
511 dctx->partial_size += n; in vmac_update()
514 if (dctx->partial_size == VMAC_NHBYTES) { in vmac_update()
515 vhash_blocks(tctx, dctx, dctx->partial_words, 1); in vmac_update()
516 dctx->partial_size = 0; in vmac_update()
523 vhash_blocks(tctx, dctx, (const __le64 *)p, n / VMAC_NHBYTES); in vmac_update()
529 memcpy(dctx->partial, p, len); in vmac_update()
530 dctx->partial_size = len; in vmac_update()
537 struct vmac_desc_ctx *dctx) in vhash_final() argument
539 unsigned int partial = dctx->partial_size; in vhash_final()
540 u64 ch = dctx->polytmp[0]; in vhash_final()
541 u64 cl = dctx->polytmp[1]; in vhash_final()
549 memset(&dctx->partial[partial], 0, n - partial); in vhash_final()
550 nh_16(dctx->partial_words, tctx->nhkey, n / 8, rh, rl); in vhash_final()
552 if (dctx->first_block_processed) in vhash_final()
566 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_final() local
570 if (dctx->nonce_size != VMAC_NONCEBYTES) in vmac_final()
579 if (dctx->nonce.bytes[0] & 0x80) in vmac_final()
583 hash = vhash_final(tctx, dctx); in vmac_final()
587 index = dctx->nonce.bytes[VMAC_NONCEBYTES - 1] & 1; in vmac_final()
588 dctx->nonce.bytes[VMAC_NONCEBYTES - 1] &= ~1; in vmac_final()
589 crypto_cipher_encrypt_one(tctx->cipher, dctx->nonce.bytes, in vmac_final()
590 dctx->nonce.bytes); in vmac_final()
591 pad = be64_to_cpu(dctx->nonce.pads[index]); in vmac_final()