Lines Matching refs:tctx

399 static void vhash_blocks(const struct vmac_tfm_ctx *tctx,  in vhash_blocks()  argument
403 const u64 *kptr = tctx->nhkey; in vhash_blocks()
404 const u64 pkh = tctx->polykey[0]; in vhash_blocks()
405 const u64 pkl = tctx->polykey[1]; in vhash_blocks()
433 struct vmac_tfm_ctx *tctx = crypto_shash_ctx(tfm); in vmac_setkey() local
442 err = crypto_cipher_setkey(tctx->cipher, key, keylen); in vmac_setkey()
448 for (i = 0; i < ARRAY_SIZE(tctx->nhkey); i += 2) { in vmac_setkey()
449 crypto_cipher_encrypt_one(tctx->cipher, (u8 *)out, in); in vmac_setkey()
450 tctx->nhkey[i] = be64_to_cpu(out[0]); in vmac_setkey()
451 tctx->nhkey[i+1] = be64_to_cpu(out[1]); in vmac_setkey()
458 for (i = 0; i < ARRAY_SIZE(tctx->polykey); i += 2) { in vmac_setkey()
459 crypto_cipher_encrypt_one(tctx->cipher, (u8 *)out, in); in vmac_setkey()
460 tctx->polykey[i] = be64_to_cpu(out[0]) & mpoly; in vmac_setkey()
461 tctx->polykey[i+1] = be64_to_cpu(out[1]) & mpoly; in vmac_setkey()
468 for (i = 0; i < ARRAY_SIZE(tctx->l3key); i += 2) { in vmac_setkey()
470 crypto_cipher_encrypt_one(tctx->cipher, (u8 *)out, in); in vmac_setkey()
471 tctx->l3key[i] = be64_to_cpu(out[0]); in vmac_setkey()
472 tctx->l3key[i+1] = be64_to_cpu(out[1]); in vmac_setkey()
474 } while (tctx->l3key[i] >= p64 || tctx->l3key[i+1] >= p64); in vmac_setkey()
482 const struct vmac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in vmac_init() local
487 memcpy(dctx->polytmp, tctx->polykey, sizeof(dctx->polytmp)); in vmac_init()
494 const struct vmac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in vmac_update() local
514 vhash_blocks(tctx, dctx, dctx->partial_words, 1); in vmac_update()
522 vhash_blocks(tctx, dctx, (const __le64 *)p, n / VMAC_NHBYTES); in vmac_update()
535 static u64 vhash_final(const struct vmac_tfm_ctx *tctx, in vhash_final() argument
549 nh_16(dctx->partial_words, tctx->nhkey, n / 8, rh, rl); in vhash_final()
552 poly_step(ch, cl, tctx->polykey[0], tctx->polykey[1], in vhash_final()
559 return l3hash(ch, cl, tctx->l3key[0], tctx->l3key[1], partial * 8); in vhash_final()
564 const struct vmac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in vmac_final() local
582 hash = vhash_final(tctx, dctx); in vmac_final()
588 crypto_cipher_encrypt_one(tctx->cipher, dctx->nonce.bytes, in vmac_final()
601 struct vmac_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in vmac_init_tfm() local
608 tctx->cipher = cipher; in vmac_init_tfm()
614 struct vmac_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in vmac_exit_tfm() local
616 crypto_free_cipher(tctx->cipher); in vmac_exit_tfm()