Lines Matching refs:tfm
302 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt()
304 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt()
305 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt()
314 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_phys()
316 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_phys()
317 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_phys()
353 walk->cipher_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt_block()
354 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt_block()
355 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt_block()
362 struct crypto_aead *tfm, in blkcipher_aead_walk_virt_block() argument
367 walk->cipher_blocksize = crypto_aead_blocksize(tfm); in blkcipher_aead_walk_virt_block()
368 walk->ivsize = crypto_aead_ivsize(tfm); in blkcipher_aead_walk_virt_block()
369 walk->alignmask = crypto_aead_alignmask(tfm); in blkcipher_aead_walk_virt_block()
374 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
377 struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; in setkey_unaligned()
378 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
390 ret = cipher->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
396 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
398 struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; in setkey()
399 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
402 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
407 return setkey_unaligned(tfm, key, keylen); in setkey()
409 return cipher->setkey(tfm, key, keylen); in setkey()
412 static int async_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in async_setkey() argument
415 return setkey(crypto_ablkcipher_tfm(tfm), key, keylen); in async_setkey()
420 struct crypto_tfm *tfm = req->base.tfm; in async_encrypt() local
421 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_encrypt()
423 .tfm = __crypto_blkcipher_cast(tfm), in async_encrypt()
434 struct crypto_tfm *tfm = req->base.tfm; in async_decrypt() local
435 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_decrypt()
437 .tfm = __crypto_blkcipher_cast(tfm), in async_decrypt()
460 static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm) in crypto_init_blkcipher_ops_async() argument
462 struct ablkcipher_tfm *crt = &tfm->crt_ablkcipher; in crypto_init_blkcipher_ops_async()
463 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_async()
472 crt->base = __crypto_ablkcipher_cast(tfm); in crypto_init_blkcipher_ops_async()
478 static int crypto_init_blkcipher_ops_sync(struct crypto_tfm *tfm) in crypto_init_blkcipher_ops_sync() argument
480 struct blkcipher_tfm *crt = &tfm->crt_blkcipher; in crypto_init_blkcipher_ops_sync()
481 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_sync()
482 unsigned long align = crypto_tfm_alg_alignmask(tfm) + 1; in crypto_init_blkcipher_ops_sync()
489 addr = (unsigned long)crypto_tfm_ctx(tfm); in crypto_init_blkcipher_ops_sync()
491 addr += ALIGN(tfm->__crt_alg->cra_ctxsize, align); in crypto_init_blkcipher_ops_sync()
497 static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_init_blkcipher_ops() argument
499 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops()
505 return crypto_init_blkcipher_ops_sync(tfm); in crypto_init_blkcipher_ops()
507 return crypto_init_blkcipher_ops_async(tfm); in crypto_init_blkcipher_ops()
585 int (*setkey)(struct crypto_ablkcipher *tfm, const u8 *key, in skcipher_geniv_alloc()
720 int skcipher_geniv_init(struct crypto_tfm *tfm) in skcipher_geniv_init() argument
722 struct crypto_instance *inst = (void *)tfm->__crt_alg; in skcipher_geniv_init()
729 tfm->crt_ablkcipher.base = cipher; in skcipher_geniv_init()
730 tfm->crt_ablkcipher.reqsize += crypto_ablkcipher_reqsize(cipher); in skcipher_geniv_init()
736 void skcipher_geniv_exit(struct crypto_tfm *tfm) in skcipher_geniv_exit() argument
738 crypto_free_ablkcipher(tfm->crt_ablkcipher.base); in skcipher_geniv_exit()