Lines Matching defs:tfm
23 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen)
25 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher;
27 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK;
29 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN;
32 return cia->cia_setkey(tfm, key, keylen);
37 struct crypto_tfm *tfm,
40 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);
41 unsigned int size = crypto_tfm_alg_blocksize(tfm);
46 fn(tfm, tmp, tmp);
50 static void cipher_encrypt_unaligned(struct crypto_tfm *tfm,
53 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);
54 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher;
57 cipher_crypt_unaligned(cipher->cia_encrypt, tfm, dst, src);
61 cipher->cia_encrypt(tfm, dst, src);
64 static void cipher_decrypt_unaligned(struct crypto_tfm *tfm,
67 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm);
68 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher;
71 cipher_crypt_unaligned(cipher->cia_decrypt, tfm, dst, src);
75 cipher->cia_decrypt(tfm, dst, src);
78 int crypto_init_cipher_ops(struct crypto_tfm *tfm)
80 struct cipher_tfm *ops = &tfm->crt_cipher;
81 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher;
84 ops->cit_encrypt_one = crypto_tfm_alg_alignmask(tfm) ?
86 ops->cit_decrypt_one = crypto_tfm_alg_alignmask(tfm) ?
92 void crypto_exit_cipher_ops(struct crypto_tfm *tfm)