Lines Matching refs:op
73 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_cipher_fallback() local
84 skcipher_request_set_tfm(&rctx->fallback_req, op->fallback_tfm); in sun8i_ss_cipher_fallback()
99 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_setup_ivs() local
100 struct sun8i_ss_dev *ss = op->ss; in sun8i_ss_setup_ivs()
162 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_cipher() local
163 struct sun8i_ss_dev *ss = op->ss; in sun8i_ss_cipher()
181 op->keylen); in sun8i_ss_cipher()
189 rctx->keylen = op->keylen; in sun8i_ss_cipher()
191 rctx->p_key = dma_map_single(ss->dev, op->key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
305 dma_unmap_single(ss->dev, rctx->p_key, op->keylen, DMA_TO_DEVICE); in sun8i_ss_cipher()
328 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_skdecrypt() local
339 e = sun8i_ss_get_engine_number(op->ss); in sun8i_ss_skdecrypt()
340 engine = op->ss->flows[e].engine; in sun8i_ss_skdecrypt()
349 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_skencrypt() local
360 e = sun8i_ss_get_engine_number(op->ss); in sun8i_ss_skencrypt()
361 engine = op->ss->flows[e].engine; in sun8i_ss_skencrypt()
369 struct sun8i_cipher_tfm_ctx *op = crypto_tfm_ctx(tfm); in sun8i_ss_cipher_init() local
376 memset(op, 0, sizeof(struct sun8i_cipher_tfm_ctx)); in sun8i_ss_cipher_init()
379 op->ss = algt->ss; in sun8i_ss_cipher_init()
381 op->fallback_tfm = crypto_alloc_skcipher(name, 0, CRYPTO_ALG_NEED_FALLBACK); in sun8i_ss_cipher_init()
382 if (IS_ERR(op->fallback_tfm)) { in sun8i_ss_cipher_init()
383 dev_err(op->ss->dev, "ERROR: Cannot allocate fallback for %s %ld\n", in sun8i_ss_cipher_init()
384 name, PTR_ERR(op->fallback_tfm)); in sun8i_ss_cipher_init()
385 return PTR_ERR(op->fallback_tfm); in sun8i_ss_cipher_init()
389 crypto_skcipher_reqsize(op->fallback_tfm); in sun8i_ss_cipher_init()
392 dev_info(op->ss->dev, "Fallback for %s is %s\n", in sun8i_ss_cipher_init()
394 crypto_tfm_alg_driver_name(crypto_skcipher_tfm(op->fallback_tfm))); in sun8i_ss_cipher_init()
396 op->enginectx.op.do_one_request = sun8i_ss_handle_cipher_request; in sun8i_ss_cipher_init()
397 op->enginectx.op.prepare_request = NULL; in sun8i_ss_cipher_init()
398 op->enginectx.op.unprepare_request = NULL; in sun8i_ss_cipher_init()
400 err = pm_runtime_resume_and_get(op->ss->dev); in sun8i_ss_cipher_init()
402 dev_err(op->ss->dev, "pm error %d\n", err); in sun8i_ss_cipher_init()
408 crypto_free_skcipher(op->fallback_tfm); in sun8i_ss_cipher_init()
414 struct sun8i_cipher_tfm_ctx *op = crypto_tfm_ctx(tfm); in sun8i_ss_cipher_exit() local
416 kfree_sensitive(op->key); in sun8i_ss_cipher_exit()
417 crypto_free_skcipher(op->fallback_tfm); in sun8i_ss_cipher_exit()
418 pm_runtime_put_sync(op->ss->dev); in sun8i_ss_cipher_exit()
424 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_aes_setkey() local
425 struct sun8i_ss_dev *ss = op->ss; in sun8i_ss_aes_setkey()
438 kfree_sensitive(op->key); in sun8i_ss_aes_setkey()
439 op->keylen = keylen; in sun8i_ss_aes_setkey()
440 op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA); in sun8i_ss_aes_setkey()
441 if (!op->key) in sun8i_ss_aes_setkey()
444 crypto_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK); in sun8i_ss_aes_setkey()
445 crypto_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); in sun8i_ss_aes_setkey()
447 return crypto_skcipher_setkey(op->fallback_tfm, key, keylen); in sun8i_ss_aes_setkey()
453 struct sun8i_cipher_tfm_ctx *op = crypto_skcipher_ctx(tfm); in sun8i_ss_des3_setkey() local
454 struct sun8i_ss_dev *ss = op->ss; in sun8i_ss_des3_setkey()
461 kfree_sensitive(op->key); in sun8i_ss_des3_setkey()
462 op->keylen = keylen; in sun8i_ss_des3_setkey()
463 op->key = kmemdup(key, keylen, GFP_KERNEL | GFP_DMA); in sun8i_ss_des3_setkey()
464 if (!op->key) in sun8i_ss_des3_setkey()
467 crypto_skcipher_clear_flags(op->fallback_tfm, CRYPTO_TFM_REQ_MASK); in sun8i_ss_des3_setkey()
468 crypto_skcipher_set_flags(op->fallback_tfm, tfm->base.crt_flags & CRYPTO_TFM_REQ_MASK); in sun8i_ss_des3_setkey()
470 return crypto_skcipher_setkey(op->fallback_tfm, key, keylen); in sun8i_ss_des3_setkey()