Lines Matching refs:tctx
68 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
72 crypto_skcipher_clear_flags(tctx->u.skcipher, CRYPTO_TFM_REQ_MASK);
73 crypto_skcipher_set_flags(tctx->u.skcipher,
76 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen);
80 err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt);
84 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK);
85 crypto_cipher_set_flags(tctx->essiv_cipher,
88 return crypto_cipher_setkey(tctx->essiv_cipher, salt,
89 crypto_shash_digestsize(tctx->hash));
95 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
96 SHASH_DESC_ON_STACK(desc, tctx->hash);
101 crypto_aead_clear_flags(tctx->u.aead, CRYPTO_TFM_REQ_MASK);
102 crypto_aead_set_flags(tctx->u.aead, crypto_aead_get_flags(tfm) &
104 err = crypto_aead_setkey(tctx->u.aead, key, keylen);
111 desc->tfm = tctx->hash;
118 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK);
119 crypto_cipher_set_flags(tctx->essiv_cipher, crypto_aead_get_flags(tfm) &
121 return crypto_cipher_setkey(tctx->essiv_cipher, salt,
122 crypto_shash_digestsize(tctx->hash));
128 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
130 return crypto_aead_setauthsize(tctx->u.aead, authsize);
143 const struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
146 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
148 skcipher_request_set_tfm(subreq, tctx->u.skcipher);
185 const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
191 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
204 u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset;
245 aead_request_set_tfm(subreq, tctx->u.aead);
270 struct essiv_tfm_ctx *tctx)
286 tctx->essiv_cipher = essiv_cipher;
287 tctx->hash = hash;
300 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
311 err = essiv_init_tfm(ictx, tctx);
317 tctx->u.skcipher = skcipher;
325 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
340 tctx->ivoffset = offsetof(struct essiv_aead_request_ctx, aead_req) +
342 crypto_aead_set_reqsize(tfm, tctx->ivoffset + crypto_aead_ivsize(aead));
344 err = essiv_init_tfm(ictx, tctx);
350 tctx->u.aead = aead;
356 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
358 crypto_free_skcipher(tctx->u.skcipher);
359 crypto_free_cipher(tctx->essiv_cipher);
360 crypto_free_shash(tctx->hash);
365 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
367 crypto_free_aead(tctx->u.aead);
368 crypto_free_cipher(tctx->essiv_cipher);
369 crypto_free_shash(tctx->hash);