Lines Matching refs:dctx
400 struct vmac_desc_ctx *dctx, in vhash_blocks() argument
406 u64 ch = dctx->polytmp[0]; in vhash_blocks()
407 u64 cl = dctx->polytmp[1]; in vhash_blocks()
410 if (!dctx->first_block_processed) { in vhash_blocks()
411 dctx->first_block_processed = true; in vhash_blocks()
426 dctx->polytmp[0] = ch; in vhash_blocks()
427 dctx->polytmp[1] = cl; in vhash_blocks()
483 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_init() local
485 dctx->partial_size = 0; in vmac_init()
486 dctx->first_block_processed = false; in vmac_init()
487 memcpy(dctx->polytmp, tctx->polykey, sizeof(dctx->polytmp)); in vmac_init()
488 dctx->nonce_size = 0; in vmac_init()
495 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_update() local
499 if (dctx->nonce_size < VMAC_NONCEBYTES) { in vmac_update()
500 n = min(len, VMAC_NONCEBYTES - dctx->nonce_size); in vmac_update()
501 memcpy(&dctx->nonce.bytes[dctx->nonce_size], p, n); in vmac_update()
502 dctx->nonce_size += n; in vmac_update()
507 if (dctx->partial_size) { in vmac_update()
508 n = min(len, VMAC_NHBYTES - dctx->partial_size); in vmac_update()
509 memcpy(&dctx->partial[dctx->partial_size], p, n); in vmac_update()
510 dctx->partial_size += n; in vmac_update()
513 if (dctx->partial_size == VMAC_NHBYTES) { in vmac_update()
514 vhash_blocks(tctx, dctx, dctx->partial_words, 1); in vmac_update()
515 dctx->partial_size = 0; in vmac_update()
522 vhash_blocks(tctx, dctx, (const __le64 *)p, n / VMAC_NHBYTES); in vmac_update()
528 memcpy(dctx->partial, p, len); in vmac_update()
529 dctx->partial_size = len; in vmac_update()
536 struct vmac_desc_ctx *dctx) in vhash_final() argument
538 unsigned int partial = dctx->partial_size; in vhash_final()
539 u64 ch = dctx->polytmp[0]; in vhash_final()
540 u64 cl = dctx->polytmp[1]; in vhash_final()
548 memset(&dctx->partial[partial], 0, n - partial); in vhash_final()
549 nh_16(dctx->partial_words, tctx->nhkey, n / 8, rh, rl); in vhash_final()
551 if (dctx->first_block_processed) in vhash_final()
565 struct vmac_desc_ctx *dctx = shash_desc_ctx(desc); in vmac_final() local
569 if (dctx->nonce_size != VMAC_NONCEBYTES) in vmac_final()
578 if (dctx->nonce.bytes[0] & 0x80) in vmac_final()
582 hash = vhash_final(tctx, dctx); in vmac_final()
586 index = dctx->nonce.bytes[VMAC_NONCEBYTES - 1] & 1; in vmac_final()
587 dctx->nonce.bytes[VMAC_NONCEBYTES - 1] &= ~1; in vmac_final()
588 crypto_cipher_encrypt_one(tctx->cipher, dctx->nonce.bytes, in vmac_final()
589 dctx->nonce.bytes); in vmac_final()
590 pad = be64_to_cpu(dctx->nonce.pads[index]); in vmac_final()