From patchwork Wed Jan 3 20:11:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Labbe X-Patchwork-Id: 123339 Delivered-To: patch@linaro.org Received: by 10.80.135.92 with SMTP id 28csp5927588edv; Wed, 3 Jan 2018 12:26:36 -0800 (PST) X-Google-Smtp-Source: ACJfBouhqzGQ5Jvff1nNCFB4IRhskp0EGCRwbxuf0njUpoKgflKYN7YyvA9O+KjUH7usO7QZjhgn X-Received: by 10.98.189.17 with SMTP id a17mr2449873pff.97.1515011196348; Wed, 03 Jan 2018 12:26:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515011196; cv=none; d=google.com; s=arc-20160816; b=gOaTznj7CAmwdRE6P8JYVhHkMA73l4w8r3RjxqknZ4TN95MLeTU4M35ZOtbItARpYO je9fRMQEJf4Pl74x26+UvPqgyGxosg4goG3j3heNxjgvy5wL3c2IwNWhUlN/+rOzjgs6 RckrzBqDCvXAdcdHECwAZ9Shqlpmvqx2Y3qOVxCyB2EYVF5lMLBlRnKfgiUa4wAw4ekb OKxRdG51HyQVBEVoxln356Tclw8uenKkd1un9ABoMf+Elg9MtdmwAgf9pHtHLjCr94Lc WF1xeRCLQXbR8BZESp64BpT00p/Af3lfLoxlM+arZy2oZNrp5wmXijg0xXbe+LNsWzTk OEnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=zunPPG2BwHmcsRUwRdvXiJcoUHQmQSE1n2d3Tf9FqSQ=; b=0d2OvzIDNi3cAcTO8sMCoxwPezfODF3ZUy2bBknBeFzkbuzDLomjfZ0FLrcJNXtskf h4AExcxphYSwattsrZKOx4+Sv2CFZX3exZfOMjZ4otNFBy2Te7jrdZu3E6WASWYoWDgu JsOwnrcw492DoFIMUu5QfCDxw3vIO/WznFmPB6+hecw6cJWWfZotaDHHIcrtREwAEWQj xgmfqO4BEV9GUw9UgvNSizwNtsKWHK5WyBFPEEH69Oe8jF2BmIKr1DiX3Z5ePzGzUd9U 4ueOflZ7t9ykTjheG2Dr3TSpuabjdjiysyzozAhj/uXYNO/tuLfpZvbotPdcglSk29Lu oxSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y9SWnsp0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z3si1156565pfh.370.2018.01.03.12.26.36; Wed, 03 Jan 2018 12:26:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Y9SWnsp0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752453AbeACU0d (ORCPT + 28 others); Wed, 3 Jan 2018 15:26:33 -0500 Received: from mail-wr0-f196.google.com ([209.85.128.196]:39037 "EHLO mail-wr0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbeACUNY (ORCPT ); Wed, 3 Jan 2018 15:13:24 -0500 Received: by mail-wr0-f196.google.com with SMTP id o101so2843940wrb.6; Wed, 03 Jan 2018 12:13:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=zunPPG2BwHmcsRUwRdvXiJcoUHQmQSE1n2d3Tf9FqSQ=; b=Y9SWnsp0Skjnd0rLYMPDnBRpIoo9F6TmPnjEls0bXglF4uFOmlocwkD2xjfLBb56vP aQe9M76+9i8qOZF7q3+infO/CyDB1HWVaPZTKeD8MVZPmIIfKoE5DscvLxEFCNbc98Fj dyH38gTtB5UTL7EJ8SaFkgXLAP6o03IN2cI47bjX+BQnrzcCeb+lGYNycaX3H8Gz+MZr IVZSN9JMrqMuc/GxCOPggPh6JSrAn8O6OJDCt8NL7OZ91RY/CC8cVPryMVaoheAn2Oto VGHQfMfJFdc/QxlZluaz00ptk+3j58DXJmQTh5+2k5RzEVM+0G1eLTt6+5/KKOmeJbzQ dEsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=zunPPG2BwHmcsRUwRdvXiJcoUHQmQSE1n2d3Tf9FqSQ=; b=dXY+/IXUTAo915aBRt0s+vk/6DGp1xq0wIT6ofdinqgnwrs4fjmAHZsWYHhwz3I6jD nCiHuj2rxsqOoR4ltz4FyAGcPHfF6gGUYMQPHCv0IcSuJ9ACXiRQhfEVwH815n29bvQZ cpLz1Qy486bAz32xYkKOA+ye31i3fu+w9Gl0qfD6zkLwqT0mGfx3wWWzjffR+MyVYFvq 4vfMoPYtieW7hXAXsus9fy6+GnwV3R3Ly+K2mGpxbUQ1Q2cX8QYc2/aCIgc4O1GCIXw7 DEdW9OWo7E1klDJ0DCKF0uRiVVHo18+QZseRpGwuy2x2IgLLzwgHmIg5DgQuQOHIxTQf IzMg== X-Gm-Message-State: AKGB3mJ0Iv/QQvF2qNkErCuaDb3tXCWBdEQ6vNWx3oGmpMOT6IzNrv2P ClKj37rqtF1QxNW42gNnQtY= X-Received: by 10.223.172.120 with SMTP id v111mr2643333wrc.195.1515010402297; Wed, 03 Jan 2018 12:13:22 -0800 (PST) Received: from Red.local (LFbn-1-6953-20.w90-116.abo.wanadoo.fr. [90.116.134.20]) by smtp.googlemail.com with ESMTPSA id p90sm1800627wmf.3.2018.01.03.12.13.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 12:13:21 -0800 (PST) From: Corentin Labbe To: alexandre.torgue@st.com, arei.gonglei@huawei.com, corbet@lwn.net, davem@davemloft.net, herbert@gondor.apana.org.au, jasowang@redhat.com, mcoquelin.stm32@gmail.com, mst@redhat.com Cc: linux-arm-kernel@lists.infradead.org, linux-crypto@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, fabien.dessenne@st.com, Corentin Labbe Subject: [PATCH 2/6] crypto: engine - Permit to enqueue all async requests Date: Wed, 3 Jan 2018 21:11:05 +0100 Message-Id: <20180103201109.16077-3-clabbe.montjoie@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180103201109.16077-1-clabbe.montjoie@gmail.com> References: <20180103201109.16077-1-clabbe.montjoie@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The crypto engine could actually only enqueue hash and ablkcipher request. This patch permit it to enqueue any type of crypto_async_request. Signed-off-by: Corentin Labbe --- crypto/crypto_engine.c | 230 ++++++++++++++++++++++++------------------------ include/crypto/engine.h | 59 +++++++------ 2 files changed, 148 insertions(+), 141 deletions(-) -- 2.13.6 diff --git a/crypto/crypto_engine.c b/crypto/crypto_engine.c index 61e7c4e02fd2..036270b61648 100644 --- a/crypto/crypto_engine.c +++ b/crypto/crypto_engine.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include "internal.h" @@ -34,11 +33,10 @@ static void crypto_pump_requests(struct crypto_engine *engine, bool in_kthread) { struct crypto_async_request *async_req, *backlog; - struct ahash_request *hreq; - struct ablkcipher_request *breq; unsigned long flags; bool was_busy = false; - int ret, rtype; + int ret; + struct crypto_engine_reqctx *enginectx; spin_lock_irqsave(&engine->queue_lock, flags); @@ -94,7 +92,6 @@ static void crypto_pump_requests(struct crypto_engine *engine, spin_unlock_irqrestore(&engine->queue_lock, flags); - rtype = crypto_tfm_alg_type(engine->cur_req->tfm); /* Until here we get the request need to be encrypted successfully */ if (!was_busy && engine->prepare_crypt_hardware) { ret = engine->prepare_crypt_hardware(engine); @@ -104,57 +101,31 @@ static void crypto_pump_requests(struct crypto_engine *engine, } } - switch (rtype) { - case CRYPTO_ALG_TYPE_AHASH: - hreq = ahash_request_cast(engine->cur_req); - if (engine->prepare_hash_request) { - ret = engine->prepare_hash_request(engine, hreq); - if (ret) { - dev_err(engine->dev, "failed to prepare request: %d\n", - ret); - goto req_err; - } - engine->cur_req_prepared = true; - } - ret = engine->hash_one_request(engine, hreq); - if (ret) { - dev_err(engine->dev, "failed to hash one request from queue\n"); - goto req_err; - } - return; - case CRYPTO_ALG_TYPE_ABLKCIPHER: - breq = ablkcipher_request_cast(engine->cur_req); - if (engine->prepare_cipher_request) { - ret = engine->prepare_cipher_request(engine, breq); - if (ret) { - dev_err(engine->dev, "failed to prepare request: %d\n", - ret); - goto req_err; - } - engine->cur_req_prepared = true; - } - ret = engine->cipher_one_request(engine, breq); + enginectx = crypto_tfm_ctx(async_req->tfm); + + if (enginectx->op.prepare_request) { + ret = enginectx->op.prepare_request(engine, async_req); if (ret) { - dev_err(engine->dev, "failed to cipher one request from queue\n"); + dev_err(engine->dev, "failed to prepare request: %d\n", + ret); goto req_err; } - return; - default: - dev_err(engine->dev, "failed to prepare request of unknown type\n"); - return; + engine->cur_req_prepared = true; + } + if (!enginectx->op.do_one_request) { + dev_err(engine->dev, "failed to do request\n"); + ret = -EINVAL; + goto req_err; + } + ret = enginectx->op.do_one_request(engine, async_req); + if (ret) { + dev_err(engine->dev, "Failed to do one request from queue: %d\n", ret); + goto req_err; } + return; req_err: - switch (rtype) { - case CRYPTO_ALG_TYPE_AHASH: - hreq = ahash_request_cast(engine->cur_req); - crypto_finalize_hash_request(engine, hreq, ret); - break; - case CRYPTO_ALG_TYPE_ABLKCIPHER: - breq = ablkcipher_request_cast(engine->cur_req); - crypto_finalize_cipher_request(engine, breq, ret); - break; - } + crypto_finalize_request(engine, async_req, ret); return; out: @@ -170,13 +141,12 @@ static void crypto_pump_work(struct kthread_work *work) } /** - * crypto_transfer_cipher_request - transfer the new request into the - * enginequeue + * crypto_transfer_request - transfer the new request into the engine queue * @engine: the hardware engine * @req: the request need to be listed into the engine queue */ -int crypto_transfer_cipher_request(struct crypto_engine *engine, - struct ablkcipher_request *req, +static int crypto_transfer_request(struct crypto_engine *engine, + struct crypto_async_request *req, bool need_pump) { unsigned long flags; @@ -189,7 +159,7 @@ int crypto_transfer_cipher_request(struct crypto_engine *engine, return -ESHUTDOWN; } - ret = ablkcipher_enqueue_request(&engine->queue, req); + ret = crypto_enqueue_request(&engine->queue, req); if (!engine->busy && need_pump) kthread_queue_work(engine->kworker, &engine->pump_requests); @@ -197,85 +167,97 @@ int crypto_transfer_cipher_request(struct crypto_engine *engine, spin_unlock_irqrestore(&engine->queue_lock, flags); return ret; } -EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request); +EXPORT_SYMBOL_GPL(crypto_transfer_request); /** - * crypto_transfer_cipher_request_to_engine - transfer one request to list + * crypto_transfer_request_to_engine - transfer one request to list * into the engine queue * @engine: the hardware engine * @req: the request need to be listed into the engine queue */ +static int crypto_transfer_request_to_engine(struct crypto_engine *engine, + struct crypto_async_request *req) +{ + return crypto_transfer_request(engine, req, true); +} + +/** + * crypto_transfer_cipher_request_to_engine - transfer one ablkcipher_request + * to list into the engine queue + * @engine: the hardware engine + * @req: the request need to be listed into the engine queue + * TODO: Remove this function when skcipher conversion is finished + */ int crypto_transfer_cipher_request_to_engine(struct crypto_engine *engine, struct ablkcipher_request *req) { - return crypto_transfer_cipher_request(engine, req, true); + return crypto_transfer_request_to_engine(engine, &req->base); } EXPORT_SYMBOL_GPL(crypto_transfer_cipher_request_to_engine); /** - * crypto_transfer_hash_request - transfer the new request into the - * enginequeue + * crypto_transfer_skcipher_request_to_engine - transfer one skcipher_request + * to list into the engine queue * @engine: the hardware engine * @req: the request need to be listed into the engine queue */ -int crypto_transfer_hash_request(struct crypto_engine *engine, - struct ahash_request *req, bool need_pump) +int crypto_transfer_skcipher_request_to_engine(struct crypto_engine *engine, + struct skcipher_request *req) { - unsigned long flags; - int ret; - - spin_lock_irqsave(&engine->queue_lock, flags); - - if (!engine->running) { - spin_unlock_irqrestore(&engine->queue_lock, flags); - return -ESHUTDOWN; - } - - ret = ahash_enqueue_request(&engine->queue, req); - - if (!engine->busy && need_pump) - kthread_queue_work(engine->kworker, &engine->pump_requests); + return crypto_transfer_request_to_engine(engine, &req->base); +} +EXPORT_SYMBOL_GPL(crypto_transfer_skcipher_request_to_engine); - spin_unlock_irqrestore(&engine->queue_lock, flags); - return ret; +/** + * crypto_transfer_akcipher_request_to_engine - transfer one akcipher_request + * to list into the engine queue + * @engine: the hardware engine + * @req: the request need to be listed into the engine queue + */ +int crypto_transfer_akcipher_request_to_engine(struct crypto_engine *engine, + struct akcipher_request *req) +{ + return crypto_transfer_request_to_engine(engine, &req->base); } -EXPORT_SYMBOL_GPL(crypto_transfer_hash_request); +EXPORT_SYMBOL_GPL(crypto_transfer_akcipher_request_to_engine); /** - * crypto_transfer_hash_request_to_engine - transfer one request to list - * into the engine queue + * crypto_transfer_hash_request_to_engine - transfer one ahash_request + * to list into the engine queue * @engine: the hardware engine * @req: the request need to be listed into the engine queue */ int crypto_transfer_hash_request_to_engine(struct crypto_engine *engine, struct ahash_request *req) { - return crypto_transfer_hash_request(engine, req, true); + return crypto_transfer_request_to_engine(engine, &req->base); } EXPORT_SYMBOL_GPL(crypto_transfer_hash_request_to_engine); /** - * crypto_finalize_cipher_request - finalize one request if the request is done + * crypto_finalize_request - finalize one request if the request is done * @engine: the hardware engine * @req: the request need to be finalized * @err: error number */ -void crypto_finalize_cipher_request(struct crypto_engine *engine, - struct ablkcipher_request *req, int err) +void crypto_finalize_request(struct crypto_engine *engine, + struct crypto_async_request *req, int err) { unsigned long flags; bool finalize_cur_req = false; int ret; + struct crypto_engine_reqctx *enginectx; spin_lock_irqsave(&engine->queue_lock, flags); - if (engine->cur_req == &req->base) + if (engine->cur_req == req) finalize_cur_req = true; spin_unlock_irqrestore(&engine->queue_lock, flags); if (finalize_cur_req) { + enginectx = crypto_tfm_ctx(req->tfm); if (engine->cur_req_prepared && - engine->unprepare_cipher_request) { - ret = engine->unprepare_cipher_request(engine, req); + enginectx->op.unprepare_request) { + ret = enginectx->op.unprepare_request(engine, req); if (ret) dev_err(engine->dev, "failed to unprepare request\n"); } @@ -285,46 +267,64 @@ void crypto_finalize_cipher_request(struct crypto_engine *engine, spin_unlock_irqrestore(&engine->queue_lock, flags); } - req->base.complete(&req->base, err); + req->complete(req, err); kthread_queue_work(engine->kworker, &engine->pump_requests); } -EXPORT_SYMBOL_GPL(crypto_finalize_cipher_request); /** - * crypto_finalize_hash_request - finalize one request if the request is done + * crypto_finalize_cipher_request - finalize one ablkcipher_request if + * the request is done * @engine: the hardware engine * @req: the request need to be finalized * @err: error number */ -void crypto_finalize_hash_request(struct crypto_engine *engine, - struct ahash_request *req, int err) +void crypto_finalize_cipher_request(struct crypto_engine *engine, + struct ablkcipher_request *req, int err) { - unsigned long flags; - bool finalize_cur_req = false; - int ret; - - spin_lock_irqsave(&engine->queue_lock, flags); - if (engine->cur_req == &req->base) - finalize_cur_req = true; - spin_unlock_irqrestore(&engine->queue_lock, flags); + return crypto_finalize_request(engine, &req->base, err); +} +EXPORT_SYMBOL_GPL(crypto_finalize_cipher_request); - if (finalize_cur_req) { - if (engine->cur_req_prepared && - engine->unprepare_hash_request) { - ret = engine->unprepare_hash_request(engine, req); - if (ret) - dev_err(engine->dev, "failed to unprepare request\n"); - } - spin_lock_irqsave(&engine->queue_lock, flags); - engine->cur_req = NULL; - engine->cur_req_prepared = false; - spin_unlock_irqrestore(&engine->queue_lock, flags); - } +/** + * crypto_finalize_skcipher_request - finalize one skcipher_request if + * the request is done + * @engine: the hardware engine + * @req: the request need to be finalized + * @err: error number + */ +void crypto_finalize_skcipher_request(struct crypto_engine *engine, + struct skcipher_request *req, int err) +{ + return crypto_finalize_request(engine, &req->base, err); +} +EXPORT_SYMBOL_GPL(crypto_finalize_skcipher_request); - req->base.complete(&req->base, err); +/** + * crypto_finalize_akcipher_request - finalize one akcipher_request if + * the request is done + * @engine: the hardware engine + * @req: the request need to be finalized + * @err: error number + */ +void crypto_finalize_akcipher_request(struct crypto_engine *engine, + struct akcipher_request *req, int err) +{ + return crypto_finalize_request(engine, &req->base, err); +} +EXPORT_SYMBOL_GPL(crypto_finalize_akcipher_request); - kthread_queue_work(engine->kworker, &engine->pump_requests); +/** + * crypto_finalize_hash_request - finalize one ahash_request if + * the request is done + * @engine: the hardware engine + * @req: the request need to be finalized + * @err: error number + */ +void crypto_finalize_hash_request(struct crypto_engine *engine, + struct ahash_request *req, int err) +{ + return crypto_finalize_request(engine, &req->base, err); } EXPORT_SYMBOL_GPL(crypto_finalize_hash_request); diff --git a/include/crypto/engine.h b/include/crypto/engine.h index dd04c1699b51..1ea7cbe92eaf 100644 --- a/include/crypto/engine.h +++ b/include/crypto/engine.h @@ -17,7 +17,9 @@ #include #include #include +#include #include +#include #define ENGINE_NAME_LEN 30 /* @@ -37,12 +39,6 @@ * @unprepare_crypt_hardware: there are currently no more requests on the * queue so the subsystem notifies the driver that it may relax the * hardware by issuing this call - * @prepare_cipher_request: do some prepare if need before handle the current request - * @unprepare_cipher_request: undo any work done by prepare_cipher_request() - * @cipher_one_request: do encryption for current request - * @prepare_hash_request: do some prepare if need before handle the current request - * @unprepare_hash_request: undo any work done by prepare_hash_request() - * @hash_one_request: do hash for current request * @kworker: kthread worker struct for request pump * @pump_requests: work struct for scheduling work to the request pump * @priv_data: the engine private data @@ -65,19 +61,6 @@ struct crypto_engine { int (*prepare_crypt_hardware)(struct crypto_engine *engine); int (*unprepare_crypt_hardware)(struct crypto_engine *engine); - int (*prepare_cipher_request)(struct crypto_engine *engine, - struct ablkcipher_request *req); - int (*unprepare_cipher_request)(struct crypto_engine *engine, - struct ablkcipher_request *req); - int (*prepare_hash_request)(struct crypto_engine *engine, - struct ahash_request *req); - int (*unprepare_hash_request)(struct crypto_engine *engine, - struct ahash_request *req); - int (*cipher_one_request)(struct crypto_engine *engine, - struct ablkcipher_request *req); - int (*hash_one_request)(struct crypto_engine *engine, - struct ahash_request *req); - struct kthread_worker *kworker; struct kthread_work pump_requests; @@ -85,19 +68,43 @@ struct crypto_engine { struct crypto_async_request *cur_req; }; -int crypto_transfer_cipher_request(struct crypto_engine *engine, - struct ablkcipher_request *req, - bool need_pump); +/* + * struct crypto_engine_op - crypto hardware engine operations + * @prepare__request: do some prepare if need before handle the current request + * @unprepare_request: undo any work done by prepare_request() + * @do_one_request: do encryption for current request + */ +struct crypto_engine_op { + int (*prepare_request)(struct crypto_engine *engine, + void *areq); + int (*unprepare_request)(struct crypto_engine *engine, + void *areq); + int (*do_one_request)(struct crypto_engine *engine, + void *areq); +}; + +struct crypto_engine_reqctx { + struct crypto_engine_op op; +}; + +int crypto_transfer_akcipher_request_to_engine(struct crypto_engine *engine, + struct akcipher_request *req); int crypto_transfer_cipher_request_to_engine(struct crypto_engine *engine, - struct ablkcipher_request *req); -int crypto_transfer_hash_request(struct crypto_engine *engine, - struct ahash_request *req, bool need_pump); + struct ablkcipher_request *req); int crypto_transfer_hash_request_to_engine(struct crypto_engine *engine, - struct ahash_request *req); + struct ahash_request *req); +int crypto_transfer_skcipher_request_to_engine(struct crypto_engine *engine, + struct skcipher_request *req); +void crypto_finalize_request(struct crypto_engine *engine, + struct crypto_async_request *req, int err); +void crypto_finalize_akcipher_request(struct crypto_engine *engine, + struct akcipher_request *req, int err); void crypto_finalize_cipher_request(struct crypto_engine *engine, struct ablkcipher_request *req, int err); void crypto_finalize_hash_request(struct crypto_engine *engine, struct ahash_request *req, int err); +void crypto_finalize_skcipher_request(struct crypto_engine *engine, + struct skcipher_request *req, int err); int crypto_engine_start(struct crypto_engine *engine); int crypto_engine_stop(struct crypto_engine *engine); struct crypto_engine *crypto_engine_alloc_init(struct device *dev, bool rt);