Lines Matching refs:tfm
19 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
22 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey_unaligned()
23 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
35 ret = cia->cia_setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
42 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
44 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey()
45 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
47 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey()
49 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
54 return setkey_unaligned(tfm, key, keylen); in setkey()
56 return cia->cia_setkey(tfm, key, keylen); in setkey()
61 struct crypto_tfm *tfm, in cipher_crypt_unaligned() argument
64 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_crypt_unaligned()
65 unsigned int size = crypto_tfm_alg_blocksize(tfm); in cipher_crypt_unaligned()
70 fn(tfm, tmp, tmp); in cipher_crypt_unaligned()
74 static void cipher_encrypt_unaligned(struct crypto_tfm *tfm, in cipher_encrypt_unaligned() argument
77 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_encrypt_unaligned()
78 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in cipher_encrypt_unaligned()
81 cipher_crypt_unaligned(cipher->cia_encrypt, tfm, dst, src); in cipher_encrypt_unaligned()
85 cipher->cia_encrypt(tfm, dst, src); in cipher_encrypt_unaligned()
88 static void cipher_decrypt_unaligned(struct crypto_tfm *tfm, in cipher_decrypt_unaligned() argument
91 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_decrypt_unaligned()
92 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in cipher_decrypt_unaligned()
95 cipher_crypt_unaligned(cipher->cia_decrypt, tfm, dst, src); in cipher_decrypt_unaligned()
99 cipher->cia_decrypt(tfm, dst, src); in cipher_decrypt_unaligned()
102 int crypto_init_cipher_ops(struct crypto_tfm *tfm) in crypto_init_cipher_ops() argument
104 struct cipher_tfm *ops = &tfm->crt_cipher; in crypto_init_cipher_ops()
105 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in crypto_init_cipher_ops()
108 ops->cit_encrypt_one = crypto_tfm_alg_alignmask(tfm) ? in crypto_init_cipher_ops()
110 ops->cit_decrypt_one = crypto_tfm_alg_alignmask(tfm) ? in crypto_init_cipher_ops()