Lines Matching refs:tfm

21 	struct crypto_tfm *tfm)  in __crypto_lskcipher_cast()  argument
23 return container_of(tfm, struct crypto_lskcipher, base); in __crypto_lskcipher_cast()
32 static int lskcipher_setkey_unaligned(struct crypto_lskcipher *tfm, in lskcipher_setkey_unaligned() argument
35 unsigned long alignmask = crypto_lskcipher_alignmask(tfm); in lskcipher_setkey_unaligned()
36 struct lskcipher_alg *cipher = crypto_lskcipher_alg(tfm); in lskcipher_setkey_unaligned()
48 ret = cipher->setkey(tfm, alignbuffer, keylen); in lskcipher_setkey_unaligned()
53 int crypto_lskcipher_setkey(struct crypto_lskcipher *tfm, const u8 *key, in crypto_lskcipher_setkey() argument
56 unsigned long alignmask = crypto_lskcipher_alignmask(tfm); in crypto_lskcipher_setkey()
57 struct lskcipher_alg *cipher = crypto_lskcipher_alg(tfm); in crypto_lskcipher_setkey()
63 return lskcipher_setkey_unaligned(tfm, key, keylen); in crypto_lskcipher_setkey()
65 return cipher->setkey(tfm, key, keylen); in crypto_lskcipher_setkey()
70 struct crypto_lskcipher *tfm, const u8 *src, u8 *dst, unsigned len, in crypto_lskcipher_crypt_unaligned() argument
71 u8 *iv, int (*crypt)(struct crypto_lskcipher *tfm, const u8 *src, in crypto_lskcipher_crypt_unaligned() argument
74 unsigned statesize = crypto_lskcipher_statesize(tfm); in crypto_lskcipher_crypt_unaligned()
75 unsigned ivsize = crypto_lskcipher_ivsize(tfm); in crypto_lskcipher_crypt_unaligned()
76 unsigned bs = crypto_lskcipher_blocksize(tfm); in crypto_lskcipher_crypt_unaligned()
77 unsigned cs = crypto_lskcipher_chunksize(tfm); in crypto_lskcipher_crypt_unaligned()
104 err = crypt(tfm, p, p, chunk, tiv, CRYPTO_LSKCIPHER_FLAG_FINAL); in crypto_lskcipher_crypt_unaligned()
123 static int crypto_lskcipher_crypt(struct crypto_lskcipher *tfm, const u8 *src, in crypto_lskcipher_crypt() argument
125 int (*crypt)(struct crypto_lskcipher *tfm, in crypto_lskcipher_crypt() argument
130 unsigned long alignmask = crypto_lskcipher_alignmask(tfm); in crypto_lskcipher_crypt()
134 return crypto_lskcipher_crypt_unaligned(tfm, src, dst, len, iv, in crypto_lskcipher_crypt()
137 return crypt(tfm, src, dst, len, iv, CRYPTO_LSKCIPHER_FLAG_FINAL); in crypto_lskcipher_crypt()
140 int crypto_lskcipher_encrypt(struct crypto_lskcipher *tfm, const u8 *src, in crypto_lskcipher_encrypt() argument
143 struct lskcipher_alg *alg = crypto_lskcipher_alg(tfm); in crypto_lskcipher_encrypt()
145 return crypto_lskcipher_crypt(tfm, src, dst, len, iv, alg->encrypt); in crypto_lskcipher_encrypt()
149 int crypto_lskcipher_decrypt(struct crypto_lskcipher *tfm, const u8 *src, in crypto_lskcipher_decrypt() argument
152 struct lskcipher_alg *alg = crypto_lskcipher_alg(tfm); in crypto_lskcipher_decrypt()
154 return crypto_lskcipher_crypt(tfm, src, dst, len, iv, alg->decrypt); in crypto_lskcipher_decrypt()
159 int (*crypt)(struct crypto_lskcipher *tfm, in crypto_lskcipher_crypt_sg() argument
167 struct crypto_lskcipher *tfm = *ctx; in crypto_lskcipher_crypt_sg() local
173 ivsize = crypto_lskcipher_ivsize(tfm); in crypto_lskcipher_crypt_sg()
188 err = crypt(tfm, walk.src.virt.addr, walk.dst.virt.addr, in crypto_lskcipher_crypt_sg()
219 static void crypto_lskcipher_exit_tfm(struct crypto_tfm *tfm) in crypto_lskcipher_exit_tfm() argument
221 struct crypto_lskcipher *skcipher = __crypto_lskcipher_cast(tfm); in crypto_lskcipher_exit_tfm()
227 static int crypto_lskcipher_init_tfm(struct crypto_tfm *tfm) in crypto_lskcipher_init_tfm() argument
229 struct crypto_lskcipher *skcipher = __crypto_lskcipher_cast(tfm); in crypto_lskcipher_init_tfm()
299 static void crypto_lskcipher_exit_tfm_sg(struct crypto_tfm *tfm) in crypto_lskcipher_exit_tfm_sg() argument
301 struct crypto_lskcipher **ctx = crypto_tfm_ctx(tfm); in crypto_lskcipher_exit_tfm_sg()
306 int crypto_init_lskcipher_ops_sg(struct crypto_tfm *tfm) in crypto_init_lskcipher_ops_sg() argument
308 struct crypto_lskcipher **ctx = crypto_tfm_ctx(tfm); in crypto_init_lskcipher_ops_sg()
309 struct crypto_alg *calg = tfm->__crt_alg; in crypto_init_lskcipher_ops_sg()
322 tfm->exit = crypto_lskcipher_exit_tfm_sg; in crypto_init_lskcipher_ops_sg()
425 static int lskcipher_setkey_simple(struct crypto_lskcipher *tfm, const u8 *key, in lskcipher_setkey_simple() argument
428 struct crypto_lskcipher *cipher = lskcipher_cipher_simple(tfm); in lskcipher_setkey_simple()
431 crypto_lskcipher_set_flags(cipher, crypto_lskcipher_get_flags(tfm) & in lskcipher_setkey_simple()
436 static int lskcipher_init_tfm_simple(struct crypto_lskcipher *tfm) in lskcipher_init_tfm_simple() argument
438 struct lskcipher_instance *inst = lskcipher_alg_instance(tfm); in lskcipher_init_tfm_simple()
439 struct crypto_lskcipher **ctx = crypto_lskcipher_ctx(tfm); in lskcipher_init_tfm_simple()
452 static void lskcipher_exit_tfm_simple(struct crypto_lskcipher *tfm) in lskcipher_exit_tfm_simple() argument
454 struct crypto_lskcipher **ctx = crypto_lskcipher_ctx(tfm); in lskcipher_exit_tfm_simple()