Lines Matching refs:tctx

398 static void vhash_blocks(const struct vmac_tfm_ctx *tctx,  in vhash_blocks()  argument
402 const u64 *kptr = tctx->nhkey; in vhash_blocks()
403 const u64 pkh = tctx->polykey[0]; in vhash_blocks()
404 const u64 pkl = tctx->polykey[1]; in vhash_blocks()
432 struct vmac_tfm_ctx *tctx = crypto_shash_ctx(tfm); in vmac_setkey() local
441 err = crypto_cipher_setkey(tctx->cipher, key, keylen); in vmac_setkey()
447 for (i = 0; i < ARRAY_SIZE(tctx->nhkey); i += 2) { in vmac_setkey()
448 crypto_cipher_encrypt_one(tctx->cipher, (u8 *)out, in); in vmac_setkey()
449 tctx->nhkey[i] = be64_to_cpu(out[0]); in vmac_setkey()
450 tctx->nhkey[i+1] = be64_to_cpu(out[1]); in vmac_setkey()
457 for (i = 0; i < ARRAY_SIZE(tctx->polykey); i += 2) { in vmac_setkey()
458 crypto_cipher_encrypt_one(tctx->cipher, (u8 *)out, in); in vmac_setkey()
459 tctx->polykey[i] = be64_to_cpu(out[0]) & mpoly; in vmac_setkey()
460 tctx->polykey[i+1] = be64_to_cpu(out[1]) & mpoly; in vmac_setkey()
467 for (i = 0; i < ARRAY_SIZE(tctx->l3key); i += 2) { in vmac_setkey()
469 crypto_cipher_encrypt_one(tctx->cipher, (u8 *)out, in); in vmac_setkey()
470 tctx->l3key[i] = be64_to_cpu(out[0]); in vmac_setkey()
471 tctx->l3key[i+1] = be64_to_cpu(out[1]); in vmac_setkey()
473 } while (tctx->l3key[i] >= p64 || tctx->l3key[i+1] >= p64); in vmac_setkey()
481 const struct vmac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in vmac_init() local
486 memcpy(dctx->polytmp, tctx->polykey, sizeof(dctx->polytmp)); in vmac_init()
493 const struct vmac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in vmac_update() local
513 vhash_blocks(tctx, dctx, dctx->partial_words, 1); in vmac_update()
521 vhash_blocks(tctx, dctx, (const __le64 *)p, n / VMAC_NHBYTES); in vmac_update()
534 static u64 vhash_final(const struct vmac_tfm_ctx *tctx, in vhash_final() argument
548 nh_16(dctx->partial_words, tctx->nhkey, n / 8, rh, rl); in vhash_final()
551 poly_step(ch, cl, tctx->polykey[0], tctx->polykey[1], in vhash_final()
558 return l3hash(ch, cl, tctx->l3key[0], tctx->l3key[1], partial * 8); in vhash_final()
563 const struct vmac_tfm_ctx *tctx = crypto_shash_ctx(desc->tfm); in vmac_final() local
581 hash = vhash_final(tctx, dctx); in vmac_final()
587 crypto_cipher_encrypt_one(tctx->cipher, dctx->nonce.bytes, in vmac_final()
600 struct vmac_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in vmac_init_tfm() local
607 tctx->cipher = cipher; in vmac_init_tfm()
613 struct vmac_tfm_ctx *tctx = crypto_tfm_ctx(tfm); in vmac_exit_tfm() local
615 crypto_free_cipher(tctx->cipher); in vmac_exit_tfm()