Lines Matching refs:tctx
68 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_setkey() local
69 SHASH_DESC_ON_STACK(desc, tctx->hash); in essiv_skcipher_setkey()
73 crypto_skcipher_clear_flags(tctx->u.skcipher, CRYPTO_TFM_REQ_MASK); in essiv_skcipher_setkey()
74 crypto_skcipher_set_flags(tctx->u.skcipher, in essiv_skcipher_setkey()
77 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen); in essiv_skcipher_setkey()
79 crypto_skcipher_get_flags(tctx->u.skcipher) & in essiv_skcipher_setkey()
84 desc->tfm = tctx->hash; in essiv_skcipher_setkey()
89 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK); in essiv_skcipher_setkey()
90 crypto_cipher_set_flags(tctx->essiv_cipher, in essiv_skcipher_setkey()
93 err = crypto_cipher_setkey(tctx->essiv_cipher, salt, in essiv_skcipher_setkey()
94 crypto_shash_digestsize(tctx->hash)); in essiv_skcipher_setkey()
96 crypto_cipher_get_flags(tctx->essiv_cipher) & in essiv_skcipher_setkey()
105 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_setkey() local
106 SHASH_DESC_ON_STACK(desc, tctx->hash); in essiv_aead_setkey()
111 crypto_aead_clear_flags(tctx->u.aead, CRYPTO_TFM_REQ_MASK); in essiv_aead_setkey()
112 crypto_aead_set_flags(tctx->u.aead, crypto_aead_get_flags(tfm) & in essiv_aead_setkey()
114 err = crypto_aead_setkey(tctx->u.aead, key, keylen); in essiv_aead_setkey()
115 crypto_aead_set_flags(tfm, crypto_aead_get_flags(tctx->u.aead) & in essiv_aead_setkey()
125 desc->tfm = tctx->hash; in essiv_aead_setkey()
132 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK); in essiv_aead_setkey()
133 crypto_cipher_set_flags(tctx->essiv_cipher, crypto_aead_get_flags(tfm) & in essiv_aead_setkey()
135 err = crypto_cipher_setkey(tctx->essiv_cipher, salt, in essiv_aead_setkey()
136 crypto_shash_digestsize(tctx->hash)); in essiv_aead_setkey()
137 crypto_aead_set_flags(tfm, crypto_cipher_get_flags(tctx->essiv_cipher) & in essiv_aead_setkey()
146 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_setauthsize() local
148 return crypto_aead_setauthsize(tctx->u.aead, authsize); in essiv_aead_setauthsize()
161 const struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_crypt() local
164 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv); in essiv_skcipher_crypt()
166 skcipher_request_set_tfm(subreq, tctx->u.skcipher); in essiv_skcipher_crypt()
199 const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_crypt() local
205 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv); in essiv_aead_crypt()
218 u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset; in essiv_aead_crypt()
259 aead_request_set_tfm(subreq, tctx->u.aead); in essiv_aead_crypt()
284 struct essiv_tfm_ctx *tctx) in essiv_init_tfm() argument
300 tctx->essiv_cipher = essiv_cipher; in essiv_init_tfm()
301 tctx->hash = hash; in essiv_init_tfm()
314 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_init_tfm() local
325 err = essiv_init_tfm(ictx, tctx); in essiv_skcipher_init_tfm()
331 tctx->u.skcipher = skcipher; in essiv_skcipher_init_tfm()
339 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_init_tfm() local
354 tctx->ivoffset = offsetof(struct essiv_aead_request_ctx, aead_req) + in essiv_aead_init_tfm()
356 crypto_aead_set_reqsize(tfm, tctx->ivoffset + crypto_aead_ivsize(aead)); in essiv_aead_init_tfm()
358 err = essiv_init_tfm(ictx, tctx); in essiv_aead_init_tfm()
364 tctx->u.aead = aead; in essiv_aead_init_tfm()
370 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_exit_tfm() local
372 crypto_free_skcipher(tctx->u.skcipher); in essiv_skcipher_exit_tfm()
373 crypto_free_cipher(tctx->essiv_cipher); in essiv_skcipher_exit_tfm()
374 crypto_free_shash(tctx->hash); in essiv_skcipher_exit_tfm()
379 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_exit_tfm() local
381 crypto_free_aead(tctx->u.aead); in essiv_aead_exit_tfm()
382 crypto_free_cipher(tctx->essiv_cipher); in essiv_aead_exit_tfm()
383 crypto_free_shash(tctx->hash); in essiv_aead_exit_tfm()