Lines Matching refs:tfm

24 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key,  in setkey_unaligned()  argument
27 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey_unaligned()
28 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
40 ret = cia->cia_setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
47 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
49 struct cipher_alg *cia = &tfm->__crt_alg->cra_cipher; in setkey()
50 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
52 tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK; in setkey()
54 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
59 return setkey_unaligned(tfm, key, keylen); in setkey()
61 return cia->cia_setkey(tfm, key, keylen); in setkey()
66 struct crypto_tfm *tfm, in cipher_crypt_unaligned() argument
69 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_crypt_unaligned()
70 unsigned int size = crypto_tfm_alg_blocksize(tfm); in cipher_crypt_unaligned()
75 fn(tfm, tmp, tmp); in cipher_crypt_unaligned()
79 static void cipher_encrypt_unaligned(struct crypto_tfm *tfm, in cipher_encrypt_unaligned() argument
82 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_encrypt_unaligned()
83 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in cipher_encrypt_unaligned()
86 cipher_crypt_unaligned(cipher->cia_encrypt, tfm, dst, src); in cipher_encrypt_unaligned()
90 cipher->cia_encrypt(tfm, dst, src); in cipher_encrypt_unaligned()
93 static void cipher_decrypt_unaligned(struct crypto_tfm *tfm, in cipher_decrypt_unaligned() argument
96 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in cipher_decrypt_unaligned()
97 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in cipher_decrypt_unaligned()
100 cipher_crypt_unaligned(cipher->cia_decrypt, tfm, dst, src); in cipher_decrypt_unaligned()
104 cipher->cia_decrypt(tfm, dst, src); in cipher_decrypt_unaligned()
107 int crypto_init_cipher_ops(struct crypto_tfm *tfm) in crypto_init_cipher_ops() argument
109 struct cipher_tfm *ops = &tfm->crt_cipher; in crypto_init_cipher_ops()
110 struct cipher_alg *cipher = &tfm->__crt_alg->cra_cipher; in crypto_init_cipher_ops()
113 ops->cit_encrypt_one = crypto_tfm_alg_alignmask(tfm) ? in crypto_init_cipher_ops()
115 ops->cit_decrypt_one = crypto_tfm_alg_alignmask(tfm) ? in crypto_init_cipher_ops()