Lines Matching refs:tfm

34 static int skcipher_setkey_blkcipher(struct crypto_skcipher *tfm,  in skcipher_setkey_blkcipher()  argument
37 struct crypto_blkcipher **ctx = crypto_skcipher_ctx(tfm); in skcipher_setkey_blkcipher()
42 crypto_blkcipher_set_flags(blkcipher, crypto_skcipher_get_flags(tfm) & in skcipher_setkey_blkcipher()
45 crypto_skcipher_set_flags(tfm, crypto_blkcipher_get_flags(blkcipher) & in skcipher_setkey_blkcipher()
57 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in skcipher_crypt_blkcipher() local
58 struct crypto_blkcipher **ctx = crypto_skcipher_ctx(tfm); in skcipher_crypt_blkcipher()
60 .tfm = *ctx, in skcipher_crypt_blkcipher()
72 struct crypto_tfm *tfm = crypto_skcipher_tfm(skcipher); in skcipher_encrypt_blkcipher() local
73 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in skcipher_encrypt_blkcipher()
81 struct crypto_tfm *tfm = crypto_skcipher_tfm(skcipher); in skcipher_decrypt_blkcipher() local
82 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in skcipher_decrypt_blkcipher()
87 static void crypto_exit_skcipher_ops_blkcipher(struct crypto_tfm *tfm) in crypto_exit_skcipher_ops_blkcipher() argument
89 struct crypto_blkcipher **ctx = crypto_tfm_ctx(tfm); in crypto_exit_skcipher_ops_blkcipher()
94 static int crypto_init_skcipher_ops_blkcipher(struct crypto_tfm *tfm) in crypto_init_skcipher_ops_blkcipher() argument
96 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_skcipher_ops_blkcipher()
97 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm); in crypto_init_skcipher_ops_blkcipher()
98 struct crypto_blkcipher **ctx = crypto_tfm_ctx(tfm); in crypto_init_skcipher_ops_blkcipher()
114 tfm->exit = crypto_exit_skcipher_ops_blkcipher; in crypto_init_skcipher_ops_blkcipher()
126 static int skcipher_setkey_ablkcipher(struct crypto_skcipher *tfm, in skcipher_setkey_ablkcipher() argument
129 struct crypto_ablkcipher **ctx = crypto_skcipher_ctx(tfm); in skcipher_setkey_ablkcipher()
135 crypto_skcipher_get_flags(tfm) & in skcipher_setkey_ablkcipher()
138 crypto_skcipher_set_flags(tfm, in skcipher_setkey_ablkcipher()
148 struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req); in skcipher_crypt_ablkcipher() local
149 struct crypto_ablkcipher **ctx = crypto_skcipher_ctx(tfm); in skcipher_crypt_ablkcipher()
164 struct crypto_tfm *tfm = crypto_skcipher_tfm(skcipher); in skcipher_encrypt_ablkcipher() local
165 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; in skcipher_encrypt_ablkcipher()
173 struct crypto_tfm *tfm = crypto_skcipher_tfm(skcipher); in skcipher_decrypt_ablkcipher() local
174 struct ablkcipher_alg *alg = &tfm->__crt_alg->cra_ablkcipher; in skcipher_decrypt_ablkcipher()
179 static void crypto_exit_skcipher_ops_ablkcipher(struct crypto_tfm *tfm) in crypto_exit_skcipher_ops_ablkcipher() argument
181 struct crypto_ablkcipher **ctx = crypto_tfm_ctx(tfm); in crypto_exit_skcipher_ops_ablkcipher()
186 static int crypto_init_skcipher_ops_ablkcipher(struct crypto_tfm *tfm) in crypto_init_skcipher_ops_ablkcipher() argument
188 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_skcipher_ops_ablkcipher()
189 struct crypto_skcipher *skcipher = __crypto_skcipher_cast(tfm); in crypto_init_skcipher_ops_ablkcipher()
190 struct crypto_ablkcipher **ctx = crypto_tfm_ctx(tfm); in crypto_init_skcipher_ops_ablkcipher()
205 tfm->exit = crypto_exit_skcipher_ops_ablkcipher; in crypto_init_skcipher_ops_ablkcipher()
219 static int crypto_skcipher_init_tfm(struct crypto_tfm *tfm) in crypto_skcipher_init_tfm() argument
221 if (tfm->__crt_alg->cra_type == &crypto_blkcipher_type) in crypto_skcipher_init_tfm()
222 return crypto_init_skcipher_ops_blkcipher(tfm); in crypto_skcipher_init_tfm()
224 BUG_ON(tfm->__crt_alg->cra_type != &crypto_ablkcipher_type && in crypto_skcipher_init_tfm()
225 tfm->__crt_alg->cra_type != &crypto_givcipher_type); in crypto_skcipher_init_tfm()
227 return crypto_init_skcipher_ops_ablkcipher(tfm); in crypto_skcipher_init_tfm()