Lines Matching refs:tfm
303 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt()
305 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt()
306 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt()
315 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_phys()
317 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_phys()
318 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_phys()
354 walk->cipher_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt_block()
355 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt_block()
356 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt_block()
363 struct crypto_aead *tfm, in blkcipher_aead_walk_virt_block() argument
368 walk->cipher_blocksize = crypto_aead_blocksize(tfm); in blkcipher_aead_walk_virt_block()
369 walk->ivsize = crypto_aead_ivsize(tfm); in blkcipher_aead_walk_virt_block()
370 walk->alignmask = crypto_aead_alignmask(tfm); in blkcipher_aead_walk_virt_block()
375 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
378 struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; in setkey_unaligned()
379 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
391 ret = cipher->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
397 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
399 struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; in setkey()
400 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
403 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
408 return setkey_unaligned(tfm, key, keylen); in setkey()
410 return cipher->setkey(tfm, key, keylen); in setkey()
413 static int async_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in async_setkey() argument
416 return setkey(crypto_ablkcipher_tfm(tfm), key, keylen); in async_setkey()
421 struct crypto_tfm *tfm = req->base.tfm; in async_encrypt() local
422 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_encrypt()
424 .tfm = __crypto_blkcipher_cast(tfm), in async_encrypt()
435 struct crypto_tfm *tfm = req->base.tfm; in async_decrypt() local
436 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_decrypt()
438 .tfm = __crypto_blkcipher_cast(tfm), in async_decrypt()
461 static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm) in crypto_init_blkcipher_ops_async() argument
463 struct ablkcipher_tfm *crt = &tfm->crt_ablkcipher; in crypto_init_blkcipher_ops_async()
464 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_async()
473 crt->base = __crypto_ablkcipher_cast(tfm); in crypto_init_blkcipher_ops_async()
479 static int crypto_init_blkcipher_ops_sync(struct crypto_tfm *tfm) in crypto_init_blkcipher_ops_sync() argument
481 struct blkcipher_tfm *crt = &tfm->crt_blkcipher; in crypto_init_blkcipher_ops_sync()
482 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_sync()
483 unsigned long align = crypto_tfm_alg_alignmask(tfm) + 1; in crypto_init_blkcipher_ops_sync()
490 addr = (unsigned long)crypto_tfm_ctx(tfm); in crypto_init_blkcipher_ops_sync()
492 addr += ALIGN(tfm->__crt_alg->cra_ctxsize, align); in crypto_init_blkcipher_ops_sync()
498 static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_init_blkcipher_ops() argument
500 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops()
506 return crypto_init_blkcipher_ops_sync(tfm); in crypto_init_blkcipher_ops()
508 return crypto_init_blkcipher_ops_async(tfm); in crypto_init_blkcipher_ops()
586 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key, in skcipher_geniv_alloc()
721 int skcipher_geniv_init(struct crypto_tfm *tfm) in skcipher_geniv_init() argument
723 struct crypto_instance *inst = (void *)tfm->__crt_alg; in skcipher_geniv_init()
730 tfm->crt_ablkcipher.base = cipher; in skcipher_geniv_init()
731 tfm->crt_ablkcipher.reqsize += crypto_ablkcipher_reqsize(cipher); in skcipher_geniv_init()
737 void skcipher_geniv_exit(struct crypto_tfm *tfm) in skcipher_geniv_exit() argument
739 crypto_free_ablkcipher(tfm->crt_ablkcipher.base); in skcipher_geniv_exit()