Lines Matching refs:tfm

301 	walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm);  in blkcipher_walk_virt()
303 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt()
304 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt()
313 walk->walk_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_phys()
315 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_phys()
316 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_phys()
352 walk->cipher_blocksize = crypto_blkcipher_blocksize(desc->tfm); in blkcipher_walk_virt_block()
353 walk->ivsize = crypto_blkcipher_ivsize(desc->tfm); in blkcipher_walk_virt_block()
354 walk->alignmask = crypto_blkcipher_alignmask(desc->tfm); in blkcipher_walk_virt_block()
361 struct crypto_aead *tfm, in blkcipher_aead_walk_virt_block() argument
366 walk->cipher_blocksize = crypto_aead_blocksize(tfm); in blkcipher_aead_walk_virt_block()
367 walk->ivsize = crypto_aead_ivsize(tfm); in blkcipher_aead_walk_virt_block()
368 walk->alignmask = crypto_aead_alignmask(tfm); in blkcipher_aead_walk_virt_block()
373 static int setkey_unaligned(struct crypto_tfm *tfm, const u8 *key, in setkey_unaligned() argument
376 struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; in setkey_unaligned()
377 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey_unaligned()
389 ret = cipher->setkey(tfm, alignbuffer, keylen); in setkey_unaligned()
395 static int setkey(struct crypto_tfm *tfm, const u8 *key, unsigned int keylen) in setkey() argument
397 struct blkcipher_alg *cipher = &tfm->__crt_alg->cra_blkcipher; in setkey()
398 unsigned long alignmask = crypto_tfm_alg_alignmask(tfm); in setkey()
401 tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; in setkey()
406 return setkey_unaligned(tfm, key, keylen); in setkey()
408 return cipher->setkey(tfm, key, keylen); in setkey()
411 static int async_setkey(struct crypto_ablkcipher *tfm, const u8 *key, in async_setkey() argument
414 return setkey(crypto_ablkcipher_tfm(tfm), key, keylen); in async_setkey()
419 struct crypto_tfm *tfm = req->base.tfm; in async_encrypt() local
420 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_encrypt()
422 .tfm = __crypto_blkcipher_cast(tfm), in async_encrypt()
433 struct crypto_tfm *tfm = req->base.tfm; in async_decrypt() local
434 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in async_decrypt()
436 .tfm = __crypto_blkcipher_cast(tfm), in async_decrypt()
459 static int crypto_init_blkcipher_ops_async(struct crypto_tfm *tfm) in crypto_init_blkcipher_ops_async() argument
461 struct ablkcipher_tfm *crt = &tfm->crt_ablkcipher; in crypto_init_blkcipher_ops_async()
462 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_async()
467 crt->base = __crypto_ablkcipher_cast(tfm); in crypto_init_blkcipher_ops_async()
473 static int crypto_init_blkcipher_ops_sync(struct crypto_tfm *tfm) in crypto_init_blkcipher_ops_sync() argument
475 struct blkcipher_tfm *crt = &tfm->crt_blkcipher; in crypto_init_blkcipher_ops_sync()
476 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops_sync()
477 unsigned long align = crypto_tfm_alg_alignmask(tfm) + 1; in crypto_init_blkcipher_ops_sync()
484 addr = (unsigned long)crypto_tfm_ctx(tfm); in crypto_init_blkcipher_ops_sync()
486 addr += ALIGN(tfm->__crt_alg->cra_ctxsize, align); in crypto_init_blkcipher_ops_sync()
492 static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask) in crypto_init_blkcipher_ops() argument
494 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; in crypto_init_blkcipher_ops()
500 return crypto_init_blkcipher_ops_sync(tfm); in crypto_init_blkcipher_ops()
502 return crypto_init_blkcipher_ops_async(tfm); in crypto_init_blkcipher_ops()