Lines Matching refs:tctx
69 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
73 crypto_skcipher_clear_flags(tctx->u.skcipher, CRYPTO_TFM_REQ_MASK);
74 crypto_skcipher_set_flags(tctx->u.skcipher,
77 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen);
81 err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt);
85 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK);
86 crypto_cipher_set_flags(tctx->essiv_cipher,
89 return crypto_cipher_setkey(tctx->essiv_cipher, salt,
90 crypto_shash_digestsize(tctx->hash));
96 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
97 SHASH_DESC_ON_STACK(desc, tctx->hash);
102 crypto_aead_clear_flags(tctx->u.aead, CRYPTO_TFM_REQ_MASK);
103 crypto_aead_set_flags(tctx->u.aead, crypto_aead_get_flags(tfm) &
105 err = crypto_aead_setkey(tctx->u.aead, key, keylen);
112 desc->tfm = tctx->hash;
119 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK);
120 crypto_cipher_set_flags(tctx->essiv_cipher, crypto_aead_get_flags(tfm) &
122 return crypto_cipher_setkey(tctx->essiv_cipher, salt,
123 crypto_shash_digestsize(tctx->hash));
129 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
131 return crypto_aead_setauthsize(tctx->u.aead, authsize);
144 const struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
147 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
149 skcipher_request_set_tfm(subreq, tctx->u.skcipher);
186 const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
192 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv);
205 u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset;
246 aead_request_set_tfm(subreq, tctx->u.aead);
271 struct essiv_tfm_ctx *tctx)
287 tctx->essiv_cipher = essiv_cipher;
288 tctx->hash = hash;
301 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
312 err = essiv_init_tfm(ictx, tctx);
318 tctx->u.skcipher = skcipher;
326 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
341 tctx->ivoffset = offsetof(struct essiv_aead_request_ctx, aead_req) +
343 crypto_aead_set_reqsize(tfm, tctx->ivoffset + crypto_aead_ivsize(aead));
345 err = essiv_init_tfm(ictx, tctx);
351 tctx->u.aead = aead;
357 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm);
359 crypto_free_skcipher(tctx->u.skcipher);
360 crypto_free_cipher(tctx->essiv_cipher);
361 crypto_free_shash(tctx->hash);
366 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm);
368 crypto_free_aead(tctx->u.aead);
369 crypto_free_cipher(tctx->essiv_cipher);
370 crypto_free_shash(tctx->hash);