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