Lines Matching refs:tctx
68 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_setkey() local
72 crypto_skcipher_clear_flags(tctx->u.skcipher, CRYPTO_TFM_REQ_MASK); in essiv_skcipher_setkey()
73 crypto_skcipher_set_flags(tctx->u.skcipher, in essiv_skcipher_setkey()
76 err = crypto_skcipher_setkey(tctx->u.skcipher, key, keylen); in essiv_skcipher_setkey()
80 err = crypto_shash_tfm_digest(tctx->hash, key, keylen, salt); in essiv_skcipher_setkey()
84 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK); in essiv_skcipher_setkey()
85 crypto_cipher_set_flags(tctx->essiv_cipher, in essiv_skcipher_setkey()
88 return crypto_cipher_setkey(tctx->essiv_cipher, salt, in essiv_skcipher_setkey()
89 crypto_shash_digestsize(tctx->hash)); in essiv_skcipher_setkey()
95 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_setkey() local
96 SHASH_DESC_ON_STACK(desc, tctx->hash); in essiv_aead_setkey()
101 crypto_aead_clear_flags(tctx->u.aead, CRYPTO_TFM_REQ_MASK); in essiv_aead_setkey()
102 crypto_aead_set_flags(tctx->u.aead, crypto_aead_get_flags(tfm) & in essiv_aead_setkey()
104 err = crypto_aead_setkey(tctx->u.aead, key, keylen); in essiv_aead_setkey()
111 desc->tfm = tctx->hash; in essiv_aead_setkey()
118 crypto_cipher_clear_flags(tctx->essiv_cipher, CRYPTO_TFM_REQ_MASK); in essiv_aead_setkey()
119 crypto_cipher_set_flags(tctx->essiv_cipher, crypto_aead_get_flags(tfm) & in essiv_aead_setkey()
121 return crypto_cipher_setkey(tctx->essiv_cipher, salt, in essiv_aead_setkey()
122 crypto_shash_digestsize(tctx->hash)); in essiv_aead_setkey()
128 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_setauthsize() local
130 return crypto_aead_setauthsize(tctx->u.aead, authsize); in essiv_aead_setauthsize()
143 const struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_crypt() local
146 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv); in essiv_skcipher_crypt()
148 skcipher_request_set_tfm(subreq, tctx->u.skcipher); in essiv_skcipher_crypt()
180 const struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_crypt() local
186 crypto_cipher_encrypt_one(tctx->essiv_cipher, req->iv, req->iv); in essiv_aead_crypt()
199 u8 *iv = (u8 *)aead_request_ctx(req) + tctx->ivoffset; in essiv_aead_crypt()
240 aead_request_set_tfm(subreq, tctx->u.aead); in essiv_aead_crypt()
265 struct essiv_tfm_ctx *tctx) in essiv_init_tfm() argument
281 tctx->essiv_cipher = essiv_cipher; in essiv_init_tfm()
282 tctx->hash = hash; in essiv_init_tfm()
295 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_init_tfm() local
306 err = essiv_init_tfm(ictx, tctx); in essiv_skcipher_init_tfm()
312 tctx->u.skcipher = skcipher; in essiv_skcipher_init_tfm()
320 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_init_tfm() local
335 tctx->ivoffset = offsetof(struct essiv_aead_request_ctx, aead_req) + in essiv_aead_init_tfm()
337 crypto_aead_set_reqsize(tfm, tctx->ivoffset + crypto_aead_ivsize(aead)); in essiv_aead_init_tfm()
339 err = essiv_init_tfm(ictx, tctx); in essiv_aead_init_tfm()
345 tctx->u.aead = aead; in essiv_aead_init_tfm()
351 struct essiv_tfm_ctx *tctx = crypto_skcipher_ctx(tfm); in essiv_skcipher_exit_tfm() local
353 crypto_free_skcipher(tctx->u.skcipher); in essiv_skcipher_exit_tfm()
354 crypto_free_cipher(tctx->essiv_cipher); in essiv_skcipher_exit_tfm()
355 crypto_free_shash(tctx->hash); in essiv_skcipher_exit_tfm()
360 struct essiv_tfm_ctx *tctx = crypto_aead_ctx(tfm); in essiv_aead_exit_tfm() local
362 crypto_free_aead(tctx->u.aead); in essiv_aead_exit_tfm()
363 crypto_free_cipher(tctx->essiv_cipher); in essiv_aead_exit_tfm()
364 crypto_free_shash(tctx->hash); in essiv_aead_exit_tfm()