search for: unprepare_request

Displaying 20 results from an estimated 23 matches for "unprepare_request".

Did you mean: prepare_request
2018 Jan 03
11
[PATCH 0/6] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct
2017 Nov 29
9
[PATCH RFC 0/4] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct engine and
2017 Nov 29
9
[PATCH RFC 0/4] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct engine and
2018 Jan 10
1
[PATCH 2/6] crypto: engine - Permit to enqueue all async requests
...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_irqrestor...
2018 Jan 26
10
[PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct
2018 Jan 26
10
[PATCH v2 0/6] crypto: engine - Permit to enqueue all async requests
Hello The current crypto_engine support only ahash and ablkcipher request. My first patch which try to add skcipher was Nacked, it will add too many functions and adding other algs(aead, asymetric_key) will make the situation worst. This patchset remove all algs specific stuff and now only process generic crypto_async_request. The requests handler function pointer are now moved out of struct
2017 Dec 06
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...eue_lock, flags); > > if (finalize_cur_req) { > + enginectx = crypto_tfm_ctx(req->tfm); > if (engine->cur_req_prepared && > - engine->unprepare_hash_request) { > - ret = engine->unprepare_hash_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"); > } > @@ -322,11 +216,11 @@ void crypto_finalize_hash_request(struct crypto_engine *engine, > spin_unlock_irqrestore(...
2017 Dec 06
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...eue_lock, flags); > > if (finalize_cur_req) { > + enginectx = crypto_tfm_ctx(req->tfm); > if (engine->cur_req_prepared && > - engine->unprepare_hash_request) { > - ret = engine->unprepare_hash_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"); > } > @@ -322,11 +216,11 @@ void crypto_finalize_hash_request(struct crypto_engine *engine, > spin_unlock_irqrestore(...
2018 Jan 03
0
[PATCH 2/6] crypto: engine - Permit to enqueue all async requests
...lock_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, flag...
2018 Jan 26
0
[PATCH v2 2/6] crypto: engine - Permit to enqueue all async requests
...&engine->queue_lock, flags); + 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 && + enginectx->op.unprepare_request) { + ret = enginectx->op.unprepare_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_irqr...
2017 Nov 29
0
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...n_unlock_irqrestore(&engine->queue_lock, flags); if (finalize_cur_req) { + enginectx = crypto_tfm_ctx(req->tfm); if (engine->cur_req_prepared && - engine->unprepare_hash_request) { - ret = engine->unprepare_hash_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"); } @@ -322,11 +216,11 @@ void crypto_finalize_hash_request(struct crypto_engine *engine, spin_unlock_irqrestore(&engine->queue_lock, flags)...
2018 Jan 10
1
[PATCH 6/6] crypto: stm32-cryp: convert to the new crypto engine API
..._ctx *ctx = crypto_tfm_ctx(tfm); > + > tfm->crt_ablkcipher.reqsize = sizeof(struct stm32_cryp_reqctx); > > + ctx->enginectx.op.do_one_request = stm32_cryp_cipher_one_req; > + ctx->enginectx.op.prepare_request = stm32_cryp_prepare_cipher_req; > + ctx->enginectx.op.unprepare_request = NULL; > return 0; > } > > @@ -695,14 +706,17 @@ static int stm32_cryp_prepare_req(struct crypto_engine *engine, > } > > static int stm32_cryp_prepare_cipher_req(struct crypto_engine *engine, > - struct ablkcipher_request *req) > + void *areq) &g...
2018 Jan 10
1
[PATCH 5/6] crypto: stm32-hash: convert to the new crypto engine API
...int stm32_hash_cra_init_algs(struct crypto_tfm *tfm, > if (algs_hmac_name) > ctx->flags |= HASH_FLAGS_HMAC; > > + ctx->enginectx.op.do_one_request = stm32_hash_one_request; > + ctx->enginectx.op.prepare_request = stm32_hash_prepare_req; > + ctx->enginectx.op.unprepare_request = NULL; > return 0; > } > > @@ -1493,9 +1504,6 @@ static int stm32_hash_probe(struct platform_device *pdev) > goto err_engine; > } > > - hdev->engine->prepare_hash_request = stm32_hash_prepare_req; > - hdev->engine->hash_one_request = stm32_h...
2018 Jan 10
1
[PATCH 1/6] Documentation: crypto: document crypto engine API
...a struct crypto_engine via crypto_engine_alloc_init(). > +And start it via crypto_engine_start(). > + > +Before transferring any request, you have to fill the enginectx. > +- prepare_request: (taking a function pointer) If you need to do some processing before doing the request > +- unprepare_request: (taking a function pointer) Undoing what's done in prepare_request > +- do_one_request: (taking a function pointer) Do encryption for current request > + > +Note: that those three functions get the crypto_async_request associated with the received request. > +So your need to get th...
2017 Dec 07
0
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
...> if (finalize_cur_req) { > > + enginectx = crypto_tfm_ctx(req->tfm); > > if (engine->cur_req_prepared && > > - engine->unprepare_hash_request) { > > - ret = engine->unprepare_hash_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"); > > } > > @@ -322,11 +216,11 @@ void crypto_finalize_hash_request(struct crypto_engine *engine, > &g...
2017 Nov 29
0
[PATCH RFC 4/4] crypto: stm32: convert to the new crypto engine API
...ctx; @@ -1033,6 +1041,9 @@ static int stm32_hash_cra_init_algs(struct crypto_tfm *tfm, if (algs_hmac_name) ctx->flags |= HASH_FLAGS_HMAC; + ctx->enginectx.op.do_one_request = stm32_hash_one_request; + ctx->enginectx.op.prepare_request = stm32_hash_prepare_req; + ctx->enginectx.op.unprepare_request = NULL; return 0; } @@ -1493,9 +1504,6 @@ static int stm32_hash_probe(struct platform_device *pdev) goto err_engine; } - hdev->engine->prepare_hash_request = stm32_hash_prepare_req; - hdev->engine->hash_one_request = stm32_hash_one_request; - ret = crypto_engine_start(hdev...
2017 Dec 22
1
[PATCH RFC 1/4] crypto: engine - Permit to enqueue all async requests
On Fri, Dec 22, 2017 at 09:41:48AM +0100, Corentin Labbe wrote: > > It's you that was suggesting using crypto_async_request: > https://www.mail-archive.com/linux-kernel at vger.kernel.org/msg1474434.html > "The only wart with this scheme is that the drivers end up seeing > struct crypto_async_request and will need to convert that to the > respective request types but I
2018 Jan 03
0
[PATCH 1/6] Documentation: crypto: document crypto engine API
...----- +You have to obtain a struct crypto_engine via crypto_engine_alloc_init(). +And start it via crypto_engine_start(). + +Before transferring any request, you have to fill the enginectx. +- prepare_request: (taking a function pointer) If you need to do some processing before doing the request +- unprepare_request: (taking a function pointer) Undoing what's done in prepare_request +- do_one_request: (taking a function pointer) Do encryption for current request + +Note: that those three functions get the crypto_async_request associated with the received request. +So your need to get the original request v...
2018 Jan 03
0
[PATCH 5/6] crypto: stm32-hash: convert to the new crypto engine API
...ctx; @@ -1033,6 +1041,9 @@ static int stm32_hash_cra_init_algs(struct crypto_tfm *tfm, if (algs_hmac_name) ctx->flags |= HASH_FLAGS_HMAC; + ctx->enginectx.op.do_one_request = stm32_hash_one_request; + ctx->enginectx.op.prepare_request = stm32_hash_prepare_req; + ctx->enginectx.op.unprepare_request = NULL; return 0; } @@ -1493,9 +1504,6 @@ static int stm32_hash_probe(struct platform_device *pdev) goto err_engine; } - hdev->engine->prepare_hash_request = stm32_hash_prepare_req; - hdev->engine->hash_one_request = stm32_hash_one_request; - ret = crypto_engine_start(hdev...
2018 Jan 03
0
[PATCH 6/6] crypto: stm32-cryp: convert to the new crypto engine API
...tfm *tfm) { + struct stm32_cryp_ctx *ctx = crypto_tfm_ctx(tfm); + tfm->crt_ablkcipher.reqsize = sizeof(struct stm32_cryp_reqctx); + ctx->enginectx.op.do_one_request = stm32_cryp_cipher_one_req; + ctx->enginectx.op.prepare_request = stm32_cryp_prepare_cipher_req; + ctx->enginectx.op.unprepare_request = NULL; return 0; } @@ -695,14 +706,17 @@ static int stm32_cryp_prepare_req(struct crypto_engine *engine, } static int stm32_cryp_prepare_cipher_req(struct crypto_engine *engine, - struct ablkcipher_request *req) + void *areq) { + struct ablkcipher_request *req = container_of(ar...