Lines Matching refs:tfm

23 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key,  in setkey_unaligned()  argument
26 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey_unaligned()
27 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
39 ret = cia->cia_setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
46 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
48 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey()
49 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
51 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey()
53 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
58 return setkey_unaligned(tfm, key, keylen); in setkey()
60 return cia->cia_setkey(tfm, key, keylen); in setkey()
65 struct crypto_tfm *tfm, in cipher_crypt_unaligned() argument
68 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_crypt_unaligned()
69 unsigned int size = crypto_tfm_alg_blocksize(tfm); in cipher_crypt_unaligned()
74 fn(tfm, tmp, tmp); in cipher_crypt_unaligned()
78 static void cipher_encrypt_unaligned(struct crypto_tfm *tfm, in cipher_encrypt_unaligned() argument
81 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_encrypt_unaligned()
82 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in cipher_encrypt_unaligned()
85 cipher_crypt_unaligned(cipher->cia_encrypt, tfm, dst, src); in cipher_encrypt_unaligned()
89 cipher->cia_encrypt(tfm, dst, src); in cipher_encrypt_unaligned()
92 static void cipher_decrypt_unaligned(struct crypto_tfm *tfm, in cipher_decrypt_unaligned() argument
95 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_decrypt_unaligned()
96 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in cipher_decrypt_unaligned()
99 cipher_crypt_unaligned(cipher->cia_decrypt, tfm, dst, src); in cipher_decrypt_unaligned()
103 cipher->cia_decrypt(tfm, dst, src); in cipher_decrypt_unaligned()
106 int crypto_init_cipher_ops(struct crypto_tfm *tfm) in crypto_init_cipher_ops() argument
108 struct cipher_tfm *ops = &tfm->crt_cipher; in crypto_init_cipher_ops()
109 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in crypto_init_cipher_ops()
112 ops->cit_encrypt_one = crypto_tfm_alg_alignmask(tfm) ? in crypto_init_cipher_ops()
114 ops->cit_decrypt_one = crypto_tfm_alg_alignmask(tfm) ? in crypto_init_cipher_ops()
120 void crypto_exit_cipher_ops(struct crypto_tfm *tfm) in crypto_exit_cipher_ops() argument