• Home
  • Raw
  • Download

Lines Matching refs:op

56 	struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm);  in sun8i_ce_cipher_fallback()  local
67 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in sun8i_ce_cipher_fallback()
83 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_cipher_prepare() local
84 struct sun8i_ce_dev *ce = op->ce; in sun8i_ce_cipher_prepare()
104 op->keylen); in sun8i_ce_cipher_prepare()
128 len = op->keylen; in sun8i_ce_cipher_prepare()
144 rctx->addr_key = dma_map_single(ce->dev, op->key, op->keylen, DMA_TO_DEVICE); in sun8i_ce_cipher_prepare()
270 dma_unmap_single(ce->dev, rctx->addr_key, op->keylen, DMA_TO_DEVICE); in sun8i_ce_cipher_prepare()
280 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_cipher_run() local
281 struct sun8i_ce_dev *ce = op->ce; in sun8i_ce_cipher_run()
297 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_cipher_unprepare() local
298 struct sun8i_ce_dev *ce = op->ce; in sun8i_ce_cipher_unprepare()
334 dma_unmap_single(ce->dev, rctx->addr_key, op->keylen, DMA_TO_DEVICE); in sun8i_ce_cipher_unprepare()
342 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_skdecrypt() local
351 e = sun8i_ce_get_engine_number(op->ce); in sun8i_ce_skdecrypt()
353 engine = op->ce->chanlist[e].engine; in sun8i_ce_skdecrypt()
361 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_skencrypt() local
370 e = sun8i_ce_get_engine_number(op->ce); in sun8i_ce_skencrypt()
372 engine = op->ce->chanlist[e].engine; in sun8i_ce_skencrypt()
379 struct sun8i_cipher_tfm_ctx *op = crypto_tfm_ctx(tfm); in sun8i_ce_cipher_init() local
386 memset(op, 0, sizeof(struct sun8i_cipher_tfm_ctx)); in sun8i_ce_cipher_init()
389 op->ce = algt->ce; in sun8i_ce_cipher_init()
391 op->fallback_tfm = crypto_alloc_skcipher(name, 0, CRYPTO_ALG_NEED_FALLBACK); in sun8i_ce_cipher_init()
392 if (IS_ERR(op->fallback_tfm)) { in sun8i_ce_cipher_init()
393 dev_err(op->ce->dev, "ERROR: Cannot allocate fallback for %s %ld\n", in sun8i_ce_cipher_init()
394 name, PTR_ERR(op->fallback_tfm)); in sun8i_ce_cipher_init()
395 return PTR_ERR(op->fallback_tfm); in sun8i_ce_cipher_init()
399 crypto_skcipher_reqsize(op->fallback_tfm); in sun8i_ce_cipher_init()
402 dev_info(op->ce->dev, "Fallback for %s is %s\n", in sun8i_ce_cipher_init()
404 crypto_tfm_alg_driver_name(crypto_skcipher_tfm(op->fallback_tfm))); in sun8i_ce_cipher_init()
406 op->enginectx.op.do_one_request = sun8i_ce_cipher_run; in sun8i_ce_cipher_init()
407 op->enginectx.op.prepare_request = sun8i_ce_cipher_prepare; in sun8i_ce_cipher_init()
408 op->enginectx.op.unprepare_request = sun8i_ce_cipher_unprepare; in sun8i_ce_cipher_init()
410 err = pm_runtime_get_sync(op->ce->dev); in sun8i_ce_cipher_init()
416 pm_runtime_put_noidle(op->ce->dev); in sun8i_ce_cipher_init()
417 crypto_free_skcipher(op->fallback_tfm); in sun8i_ce_cipher_init()
423 struct sun8i_cipher_tfm_ctx *op = crypto_tfm_ctx(tfm); in sun8i_ce_cipher_exit() local
425 kfree_sensitive(op->key); in sun8i_ce_cipher_exit()
426 crypto_free_skcipher(op->fallback_tfm); in sun8i_ce_cipher_exit()
427 pm_runtime_put_sync_suspend(op->ce->dev); in sun8i_ce_cipher_exit()
433 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_aes_setkey() local
434 struct sun8i_ce_dev *ce = op->ce; in sun8i_ce_aes_setkey()
447 kfree_sensitive(op->key); in sun8i_ce_aes_setkey()
448 op->keylen = keylen; in sun8i_ce_aes_setkey()
449 op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA); in sun8i_ce_aes_setkey()
450 if (!op->key) in sun8i_ce_aes_setkey()
453 crypto_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK); in sun8i_ce_aes_setkey()
454 crypto_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); in sun8i_ce_aes_setkey()
456 return crypto_skcipher_setkey(op->fallback_tfm, key, keylen); in sun8i_ce_aes_setkey()
462 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ce_des3_setkey() local
469 kfree_sensitive(op->key); in sun8i_ce_des3_setkey()
470 op->keylen = keylen; in sun8i_ce_des3_setkey()
471 op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA); in sun8i_ce_des3_setkey()
472 if (!op->key) in sun8i_ce_des3_setkey()
475 crypto_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK); in sun8i_ce_des3_setkey()
476 crypto_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); in sun8i_ce_des3_setkey()
478 return crypto_skcipher_setkey(op->fallback_tfm, key, keylen); in sun8i_ce_des3_setkey()