Lines Matching refs:tfm

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