Re: [PATCH 04/25] crypto: ccp - switch from ablkcipher to skcipher

2019-10-21 Thread Ard Biesheuvel
On Fri, 18 Oct 2019 at 16:15, Hook, Gary wrote: > > On 10/14/19 7:18 AM, Ard Biesheuvel wrote: > > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > > dated 20 august 2015 introduced the new skcipher API which is supposed to > > rep

Re: [PATCH 04/25] crypto: ccp - switch from ablkcipher to skcipher

2019-10-18 Thread Hook, Gary
On 10/14/19 7:18 AM, Ard Biesheuvel wrote: > Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") > dated 20 august 2015 introduced the new skcipher API which is supposed to > replace both blkcipher and ablkcipher. While all consumers of the API have &g

[PATCH 11/25] crypto: nitrox - remove cra_type reference to ablkcipher

2019-10-14 Thread Ard Biesheuvel
Setting the cra_type field is not necessary for skciphers, and ablkcipher will be removed, so drop the assignment from the nitrox driver. Signed-off-by: Ard Biesheuvel --- drivers/crypto/cavium/nitrox/nitrox_skcipher.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/crypto/cavium

[PATCH 04/25] crypto: ccp - switch from ablkcipher to skcipher

2019-10-14 Thread Ard Biesheuvel
Commit 7a7ffe65c8c5 ("crypto: skcipher - Add top-level skcipher interface") dated 20 august 2015 introduced the new skcipher API which is supposed to replace both blkcipher and ablkcipher. While all consumers of the API have been converted long ago, some producers of the ablkcipher remai

crypto: ablkcipher - Unmap pages after an external error

2019-09-03 Thread Herbert Xu
ernal callers. Reported-by: Ard Biesheuvel Fixes: 318abdfbe708 ("crypto: ablkcipher - fix crash flushing...") Cc: Signed-off-by: Herbert Xu diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 072b5646a0a3..a61d13fabe3c 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c

[PATCH v1 06/15] crypto: talitos - check data blocksize in ablkcipher.

2019-05-21 Thread Christophe Leroy
ngine. Signed-off-by: Christophe Leroy Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") --- drivers/crypto/talitos.c | 16 1 file changed, 16 insertions(+) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 8b9a529f1b66..1e5410f921

Re: [PATCH v4 2/2] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-08 Thread Horia Geanta
ailed on test 1 for > ecb-aes-talitos: ret=22 > > IV cannot be on stack when CONFIG_VMAP_STACK is selected because the stack > cannot be DMA mapped anymore. > > This patch copies the IV into the extended descriptor. > > Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") > Cc: sta...@vger.kernel.org > Signed-off-by: Christophe Leroy Reviewed-by: Horia Geantă Thanks, Horia

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-08 Thread Michael Ellerman
stack >>>> cannot be DMA mapped anymore. >>>> This looks better, thanks. >>> >>>> This patch copies the IV into the extended descriptor when iv is not >>>> a valid linear address. >>>> >>> Though I am not sure the

[PATCH v4 2/2] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-07 Thread Christophe Leroy
litos - Add ablkcipher algorithms") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- v4: Split in two patches ; made the copy unconditional. v3: Using struct edesc buffer. v2: Using per-request context. drivers/crypto/talitos.c | 5 - 1 file changed, 4 insertion

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-07 Thread Herbert Xu
On Fri, Dec 21, 2018 at 08:07:52AM +, Christophe Leroy wrote: > [2.364486] WARNING: CPU: 0 PID: 60 at ./arch/powerpc/include/asm/io.h:837 > dma_nommu_map_page+0x44/0xd4 > [2.373579] CPU: 0 PID: 60 Comm: cryptomgr_test Tainted: GW > 4.20.0-rc5-00560-g6bfb52e23a00-dirty

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-07 Thread Christophe Leroy
copies the IV into the extended descriptor when iv is not a valid linear address. Though I am not sure the checks in place are enough. Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- v3: Using struct ed

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-04 Thread Horia Geanta
h copies the IV into the extended descriptor when iv is not >> a valid linear address. >> > Though I am not sure the checks in place are enough. > >> Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") >> Cc: sta...@vger.kernel.org >> Signe

Re: [PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2019-01-04 Thread Horia Geanta
linear address. > Though I am not sure the checks in place are enough. > Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") > Cc: sta...@vger.kernel.org > Signed-off-by: Christophe Leroy > --- > v3: Using struct edesc buffer. > > v2: Usi

[PATCH v3] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2018-12-21 Thread Christophe Leroy
Fixes: 4de9d0b547b9 ("crypto: talitos - Add ablkcipher algorithms") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- v3: Using struct edesc buffer. v2: Using per-request context. drivers/crypto/talitos.c | 35 +++ 1 file changed, 15 i

Re: [PATCH v2] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2018-12-18 Thread Horia Geanta
tion failed on test 1 for > ecb-aes-talitos: ret=22 > > IV cannot be on stack when CONFIG_VMAP_STACK is selected because the stack > cannot be DMA mapped anymore. > Same failure could happen for aead. > This patch copies the IV from areq->info into the request context. > T

Re: [PATCH v2] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2018-12-14 Thread Christophe Leroy
Le 14/12/2018 à 02:39, Sasha Levin a écrit : Hi, [This is an automated email] This commit has been processed because it contains a "Fixes:" tag, fixing commit: 4de9d0b547b9 crypto: talitos - Add ablkcipher algorithms. The bot has tested the following trees: v4.19.9, v4.14.88

[PATCH v2] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2018-12-12 Thread Christophe Leroy
("crypto: talitos - Add ablkcipher algorithms") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- v2: Using per-request context. drivers/crypto/talitos.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/talitos.c b/drive

Re: [PATCH] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2018-12-11 Thread Herbert Xu
On Tue, Dec 11, 2018 at 07:29:40AM +, Christophe Leroy wrote: > > diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c > index 6988012deca4..385ec970b639 100644 > --- a/drivers/crypto/talitos.c > +++ b/drivers/crypto/talitos.c > @@ -1668,8 +1668,11 @@ static struct talitos_edesc >

[PATCH] crypto: talitos - fix ablkcipher for CONFIG_VMAP_STACK

2018-12-10 Thread Christophe Leroy
7b9 ("crypto: talitos - Add ablkcipher algorithms") Cc: sta...@vger.kernel.org Signed-off-by: Christophe Leroy --- drivers/crypto/talitos.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 6988012deca4..385

Re: [PATCH 0/4] crypto: caam - ablkcipher -> skcipher conversion

2018-09-03 Thread Herbert Xu
On Mon, Aug 06, 2018 at 03:43:56PM +0300, Horia Geantă wrote: > This patch set converts caam/jr and caam/qi top level drivers > from ablkcipher API to skcipher. > > First two patches remove the unused ablkcipher algorithms with > support for IV generation. > The following two

[PATCH 1/4] crypto: caam/jr - remove ablkcipher IV generation

2018-08-06 Thread Horia Geantă
IV generation is done only at AEAD level. Support in ablkcipher is not needed, thus remove the dead code. Link: https://www.mail-archive.com/search?l=mid&q=20160901101257.ga3...@gondor.apana.org.au Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c |

[PATCH 0/4] crypto: caam - ablkcipher -> skcipher conversion

2018-08-06 Thread Horia Geantă
This patch set converts caam/jr and caam/qi top level drivers from ablkcipher API to skcipher. First two patches remove the unused ablkcipher algorithms with support for IV generation. The following two patches deal with the conversion. Note: There is a dependency for the patch set - a fix sent

[PATCH 4/4] crypto: caam/qi - ablkcipher -> skcipher conversion

2018-08-06 Thread Horia Geantă
Convert driver from deprecated ablkcipher API to skcipher. Link: https://www.mail-archive.com/search?l=mid&q=20170728085622.gc19...@gondor.apana.org.au Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 12 +- drivers/crypto/caam/caamalg_desc.c | 61 +++--- drivers/cr

[PATCH 3/4] crypto: caam/jr - ablkcipher -> skcipher conversion

2018-08-06 Thread Horia Geantă
Convert driver from deprecated ablkcipher API to skcipher. Link: https://www.mail-archive.com/search?l=mid&q=20170728085622.gc19...@gondor.apana.org.au Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 448 +++--- drivers/crypto/caam/comp

[PATCH 2/4] crypto: caam/qi - remove ablkcipher IV generation

2018-08-06 Thread Horia Geantă
IV generation is done only at AEAD level. Support in ablkcipher is not needed, thus remove the dead code. Link: https://www.mail-archive.com/search?l=mid&q=20160901101257.ga3...@gondor.apana.org.a Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg_desc.c | 81 dri

[PATCH 3/3] crypto: ablkcipher - fix crash flushing dcache in error path

2018-07-23 Thread Eric Biggers
From: Eric Biggers Like the skcipher_walk and blkcipher_walk cases: scatterwalk_done() is only meant to be called after a nonzero number of bytes have been processed, since scatterwalk_pagedone() will flush the dcache of the *previous* page. But in the error case of ablkcipher_walk_done(), e.g.

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-21 Thread Gilad Ben-Yossef
Hi Corentin, On Thu, Jan 11, 2018 at 12:01 PM, Corentin Labbe wrote: > On Thu, Jan 11, 2018 at 09:17:10AM +, Gilad Ben-Yossef wrote: >> Add CryptoCell ablkcipher support >> > > Hello > > I have some minor comments: > > ablkcipher is deprecated, so you need t

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-21 Thread Gilad Ben-Yossef
On Thu, Jan 11, 2018 at 12:03 PM, Stephan Mueller wrote: > Am Donnerstag, 11. Januar 2018, 10:17:10 CET schrieb Gilad Ben-Yossef: > > Hi Gilad, > >> + // verify weak keys >> + if (ctx_p->flow_mode == S_DIN_to_DES) { >> + if (!des_ekey(tmp, key) && >> + (crypto_t

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Stephan Mueller
Am Donnerstag, 11. Januar 2018, 10:17:10 CET schrieb Gilad Ben-Yossef: Hi Gilad, > + // verify weak keys > + if (ctx_p->flow_mode == S_DIN_to_DES) { > + if (!des_ekey(tmp, key) && > + (crypto_tfm_get_flags(tfm) & CRYPTO_TFM_REQ_WEAK_KEY)) { > +

Re: [PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Corentin Labbe
On Thu, Jan 11, 2018 at 09:17:10AM +, Gilad Ben-Yossef wrote: > Add CryptoCell ablkcipher support > Hello I have some minor comments: ablkcipher is deprecated, so you need to use skcipher instead. > Signed-off-by: Gilad Ben-Yossef > --- > drivers/crypto/ccree/Makefil

[PATCH 3/7] crypto: ccree: add ablkcipher support

2018-01-11 Thread Gilad Ben-Yossef
Add CryptoCell ablkcipher support Signed-off-by: Gilad Ben-Yossef --- drivers/crypto/ccree/Makefile|2 +- drivers/crypto/ccree/cc_buffer_mgr.c | 125 drivers/crypto/ccree/cc_buffer_mgr.h | 10 + drivers/crypto/ccree/cc_cipher.c | 1167

[PATCH v2 2/4] crypto: caam - remove needless ablkcipher key copy

2017-12-19 Thread Horia Geantă
ablkcipher shared descriptors are relatively small, thus there is enough space for the key to be inlined. Accordingly, there is no need to copy the key in ctx->key. Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c| 8 ++-- drivers/crypto/caam/caamalg_qi.c | 8 ++--

[RFC PATCH 09/10] crypto: caam/qi2 - add ablkcipher algorithms

2017-08-10 Thread Horia Geantă
Add support to submit the following ablkcipher algorithms via the DPSECI backend: cbc({aes,des,des3_ede}) ctr(aes), rfc3686(ctr(aes)) xts(aes) Signed-off-by: Horia Geantă --- drivers/crypto/caam/Kconfig | 1 + drivers/crypto/caam/caamalg_qi2.c | 816

Re: [RFC PATCH] crypto: caam - convert from ablkcipher -> skcipher

2017-07-28 Thread Herbert Xu
On Fri, Jul 28, 2017 at 06:46:03AM +, Horia Geantă wrote: > > If I am to add a new driver, would it be possible and/or advisable to > use skcipher? It should be OK. Let me know if you have any issues with the API. Thanks, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/

Re: [RFC PATCH] crypto: caam - convert from ablkcipher -> skcipher

2017-07-27 Thread Horia Geantă
off-by: Horia Geantă > > Thanks! Please hold on though because I'm not quite done with > the driver-side skcipher interface yet. > I see a mixture of ablkcipher and skcipher usage in crypto drivers. If I am to add a new driver, would it be possible and/or advisable to use skcipher? Thanks, Horia

[PATCH v3 09/13] crypto: sun4i-ss: move from ablkcipher to skcipher API

2017-06-01 Thread Antoine Tenart
Update the sun4i-ss driver to use the skcipher API instead of the old ablkcipher one. It's a bit more tricky than s/ablkcipher/skcipher/, but still nothing special and the driver's logic stays the same. Signed-off-by: Antoine Tenart Tested-by: Corentin Labbe Acked-by: Core

[PATCH v2 09/12] crypto: sun4i-ss: move from ablkcipher to skcipher API

2017-05-29 Thread Antoine Tenart
Update the sun4i-ss driver to use the skcipher API instead of the old ablkcipher one. It's a bit more tricky than s/ablkcipher/skcipher/, but still nothing special and the driver's logic stays the same. Signed-off-by: Antoine Tenart --- drivers/crypto/sunxi-ss/sun4i-ss-ciph

Re: [PATCH 09/11] crypto: sun4i-ss: move from ablkcipher to skcipher API

2017-05-29 Thread Antoine Tenart
Hi Corentin, On Mon, May 29, 2017 at 04:47:57PM +0200, Corentin Labbe wrote: > On Wed, May 24, 2017 at 09:06:50PM +0200, Antoine Tenart wrote: > > + .cra_flags = CRYPTO_ALG_TYPE_SKCIPHER | > > +CRYPTO_ALG_KERN_DRIVER_ONLY, > > You add CRYPTO_ALG_K

Re: [PATCH 09/11] crypto: sun4i-ss: move from ablkcipher to skcipher API

2017-05-29 Thread Corentin Labbe
On Wed, May 24, 2017 at 09:06:50PM +0200, Antoine Tenart wrote: > Update the sun4i-ss driver to use the skcipher API instead of the old > ablkcipher one. It's a bit more tricky than s/ablkcipher/skcipher/, but > still nothing special and the driver's logic stays the same.

[PATCH 09/11] crypto: sun4i-ss: move from ablkcipher to skcipher API

2017-05-24 Thread Antoine Tenart
Update the sun4i-ss driver to use the skcipher API instead of the old ablkcipher one. It's a bit more tricky than s/ablkcipher/skcipher/, but still nothing special and the driver's logic stays the same. Signed-off-by: Antoine Tenart --- drivers/crypto/sunxi-ss/sun4i-ss-ciph

RE: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-07 Thread Laurentiu Tudor
Garg ; linuxppc-...@lists.ozlabs.org; David S. Miller ; Alexandru Porosanu ; linux-crypto@vger.kernel.org Subject: Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms Importance: High Laurentiu Tudor writes: > On 04/05/2017 01:06 PM, Michael Ellerman wrote: >> Lauren

Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-07 Thread Michael Ellerman
Laurentiu Tudor writes: > On 04/05/2017 01:06 PM, Michael Ellerman wrote: >> Laurentiu Tudor writes: >> >>> Hi Michael, >>> >>> Just a couple of basic things to check: >>>- was the dtb updated to the newest? >> >> Possibly not, it's an automated build/boot, I'll have to check what it >> does

Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-05 Thread Laurentiu Tudor
On 04/05/2017 01:06 PM, Michael Ellerman wrote: > Laurentiu Tudor writes: > >> Hi Michael, >> >> Just a couple of basic things to check: >>- was the dtb updated to the newest? > > Possibly not, it's an automated build/boot, I'll have to check what it > does with the dtb. > >>- is the qma

Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-05 Thread Michael Ellerman
Laurentiu Tudor writes: > Hi Michael, > > Just a couple of basic things to check: > - was the dtb updated to the newest? Possibly not, it's an automated build/boot, I'll have to check what it does with the dtb. > - is the qman node present? This should be easily visible in > /proc/device-t

Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-04 Thread Laurentiu Tudor
ntă writes: > >> Add support to submit ablkcipher and authenc algorithms >> via the QI backend: >> -ablkcipher: >> cbc({aes,des,des3_ede}) >> ctr(aes), rfc3686(ctr(aes)) >> xts(aes) >> -authenc: >> authenc(hmac(md5),cbc({aes,des,des3_ede})) >> aut

Re: [7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-04-04 Thread Horia Geantă
On 4/4/2017 8:03 AM, Michael Ellerman wrote: > Horia Geantă writes: > >> Add support to submit ablkcipher and authenc algorithms >> via the QI backend: >> -ablkcipher: >> cbc({aes,des,des3_ede}) >> ctr(aes), rfc3686(ctr(aes)) >> xts(aes) >> -aut

[PATCH 7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-03-17 Thread Horia Geantă
Add support to submit ablkcipher and authenc algorithms via the QI backend: -ablkcipher: cbc({aes,des,des3_ede}) ctr(aes), rfc3686(ctr(aes)) xts(aes) -authenc: authenc(hmac(md5),cbc({aes,des,des3_ede})) authenc(hmac(sha*),cbc({aes,des,des3_ede})) caam/qi being a new driver, let's wait some

[RFC 7/7] crypto: caam/qi - add ablkcipher and authenc algorithms

2017-03-03 Thread Horia Geantă
Add support to submit ablkcipher and authenc algorithms via the QI backend: -ablkcipher: cbc({aes,des,des3_ede}) ctr(aes), rfc3686(ctr(aes)) xts(aes) -authenc: authenc(hmac(md5),cbc({aes,des,des3_ede})) authenc(hmac(sha*),cbc({aes,des,des3_ede})) caam/qi being a new driver, let's wait some

[PATCH 10/14] crypto: caam - fix DMA API mapping leak in ablkcipher code

2016-11-09 Thread Horia Geantă
alkcipher_edesc_alloc() and ablkcipher_giv_edesc_alloc() don't free / unmap resources on error path: - dmap_map_sg() could fail, thus make sure the return value is checked - unmap DMA mappings in case of error Signed-off-by: Horia Geantă --- drivers/crypto/caam/caamalg.c | 44 +++

Re: [RFC PATCH] crypto: caam - convert from ablkcipher -> skcipher

2016-09-01 Thread Herbert Xu
On Mon, Aug 29, 2016 at 05:11:24PM +0300, Horia Geantă wrote: > (a)blkcipher is being deprecated in favcur of skcipher. > The main difference is that IV generation is moved out > of crypto algorithms. > > Signed-off-by: Horia Geantă Thanks! Please hold on though because I'm not quite done with t

[RFC PATCH] crypto: caam - convert from ablkcipher -> skcipher

2016-08-29 Thread Horia Geantă
bool registered; +}; + /* Set DK bit in class 1 operation if shared */ static inline void append_dec_op1(u32 *desc, u32 type) { @@ -161,10 +166,10 @@ static inline void aead_append_src_dst(u32 *desc, u32 msg_type) } /* - * For ablkcipher encrypt and decrypt, read from req->sr

Re: Regarding mechanism to store/retrive the private data structure in any SHA/AEAD/ablkcipher algos

2016-05-03 Thread Herbert Xu
On Thu, Apr 28, 2016 at 10:38:39AM +0530, Pramod Kumar wrote: > Hi Herbert Xu/ James Morris/ David > > > > I was writing driver for one of my secure processing unit(SPU) which > offloads all SHA/AEAD/ablkciphers. > > > > While registering algos for crypto subsystem I could not find any way wh

Re: [PATCH] crypto: blkcipher and ablkcipher should it be static

2015-10-01 Thread Herbert Xu
On Sun, Sep 27, 2015 at 10:47:05PM +0800, Geliang Tang wrote: > Fixes the following sparse warnings: > > crypto/skcipher.c:94:5: > warning: symbol 'crypto_init_skcipher_ops_blkcipher' > was not declared. Should it be static? > > crypto/skcipher.c:185:5: > warning: symbol 'crypto_init_skciphe

[PATCH] crypto: blkcipher and ablkcipher should it be static

2015-09-27 Thread Geliang Tang
Fixes the following sparse warnings: crypto/skcipher.c:94:5: warning: symbol 'crypto_init_skcipher_ops_blkcipher' was not declared. Should it be static? crypto/skcipher.c:185:5: warning: symbol 'crypto_init_skcipher_ops_ablkcipher' was not declared. Should it be static? Signed-off-by: Geli

[PATCH 1/2] crypto: talitos: Clean ups and comment fixes for ablkcipher commands

2015-02-20 Thread Martin Hicks
This just cleans up some of the initializers, and improves the comments should any other ablkcipher modes be added in the future. The header words 1 and 5 have more possibilities than just passing an IV. These are pointers to the Cipher Context in/out registers. Signed-off-by: Martin Hicks

Re: [PATCH] crypto: qat - add support for cbc(aes) ablkcipher

2014-12-22 Thread Herbert Xu
On Mon, Dec 08, 2014 at 12:08:49PM -0800, Tadeusz Struk wrote: > Add support for cbc(aes) ablkcipher. > > Signed-off-by: Tadeusz Struk > Acked-by: Bruce W. Allan Both qat patches applied. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.

Re: crypto: ablkcipher - fixed style errors in ablkcipher.c

2014-12-22 Thread Herbert Xu
On Fri, Dec 05, 2014 at 02:06:16PM +0900, Joshua I. James wrote: > From: "Joshua I. James" > > Fixed style errors reported by checkpatch. > > WARNING: Missing a blank line after declarations > + u8 *end_page = (u8 *)(((unsigned long)(start + len - 1)) & PAGE_MASK); > + return max(sta

Re: [PATCH] crypto: qat - add support for cbc(aes) ablkcipher

2014-12-08 Thread Tadeusz Struk
On 12/08/2014 12:08 PM, Tadeusz Struk wrote: > Add support for cbc(aes) ablkcipher. > Hi Herbert, These two: [PATCH] crypto: qat - add support for cbc(aes) ablkcipher [PATCH] crypto: qat - Fix assumption that sg in and out will have the... are generated against cryptodev with these two

[PATCH] crypto: qat - add support for cbc(aes) ablkcipher

2014-12-08 Thread Tadeusz Struk
Add support for cbc(aes) ablkcipher. Signed-off-by: Tadeusz Struk Acked-by: Bruce W. Allan --- drivers/crypto/qat/qat_common/icp_qat_hw.h |2 drivers/crypto/qat/qat_common/qat_algs.c | 528 ++-- drivers/crypto/qat/qat_common/qat_crypto.h | 15 + 3 files

[PATCH v3 09/13] crypto: Documentation - ABLKCIPHER API documentation

2014-11-11 Thread Stephan Mueller
cipher API is used with the ciphers of type + * CRYPTO_ALG_TYPE_ABLKCIPHER (listed as type "ablkcipher" in /proc/crypto). + * + * Asynchronous cipher operations imply that the function invocation for a + * cipher request returns immediately before the completion of the operation. + *

[PATCH v2 07/11] crypto: Documentation - ABLKCIPHER API documentation

2014-11-02 Thread Stephan Mueller
ciphers of type + * CRYPTO_ALG_TYPE_ABLKCIPHER (listed as type "ablkcipher" in /proc/crypto) + * + * Asynchronous cipher operations imply that the function invocation for a + * cipher request returns immediately before the completion of the operation. + * The cipher request is scheduled as

Re: [RFC PATCH v2 4/9] crypto: qce: Add ablkcipher algorithms

2014-04-29 Thread Stanimir Varbanov
Thanks for the review! On 04/28/2014 11:18 AM, Herbert Xu wrote: > On Mon, Apr 14, 2014 at 03:48:40PM +0300, Stanimir Varbanov wrote: >> >> +} else if (IS_DES(flags)) { >> +u32 tmp[DES_EXPKEY_WORDS]; >> + >> +if (keylen != QCE_DES_KEY_SIZE) >> +goto

Re: [RFC PATCH v2 4/9] crypto: qce: Add ablkcipher algorithms

2014-04-29 Thread Stanimir Varbanov
Thanks for the review! On 04/28/2014 11:00 AM, Herbert Xu wrote: > On Mon, Apr 14, 2014 at 03:48:40PM +0300, Stanimir Varbanov wrote: >> >> +if (IS_AES(flags)) { >> +switch (keylen) { >> +case AES_KEYSIZE_128: >> +case AES_KEYSIZE_256: >> +

Re: [RFC PATCH v2 4/9] crypto: qce: Add ablkcipher algorithms

2014-04-28 Thread Herbert Xu
On Mon, Apr 14, 2014 at 03:48:40PM +0300, Stanimir Varbanov wrote: > > + } else if (IS_DES(flags)) { > + u32 tmp[DES_EXPKEY_WORDS]; > + > + if (keylen != QCE_DES_KEY_SIZE) > + goto badkey; No need to check here since you've already set min_keysize an

Re: [RFC PATCH v2 4/9] crypto: qce: Add ablkcipher algorithms

2014-04-28 Thread Herbert Xu
On Mon, Apr 14, 2014 at 03:48:40PM +0300, Stanimir Varbanov wrote: > > + if (IS_AES(flags)) { > + switch (keylen) { > + case AES_KEYSIZE_128: > + case AES_KEYSIZE_256: > + break; > + default: > + goto badkey

[RFC PATCH v2 4/9] crypto: qce: Add ablkcipher algorithms

2014-04-14 Thread Stanimir Varbanov
e->dma); + if (error) + dev_dbg(qce->dev, "ablkcipher dma termination error (%d)\n", + error); + + if (diff_dst) + qce_unmapsg(qce->dev, rctx->src_sg, rctx->src_nents, dir_src, + rctx->ds

[PATCH 4/9] crypto: qce: Add ablkcipher algorithms

2014-04-03 Thread Stanimir Varbanov
tx->dst_chained); + qce_unmapsg(qce->dev, rctx->dst_sg, rctx->dst_nents, dir_dst, + rctx->dst_chained); + + sg_free_table(&rctx->dst_tbl); + + error = qce_check_status(qce, &status); + if (error < 0) + dev_err(qce->dev, "

Re: [PATCH 01/10] crypto: authenc - Find proper IV address in ablkcipher callback

2013-11-28 Thread Herbert Xu
On Tue, Nov 12, 2013 at 11:46:04AM -0600, Tom Lendacky wrote: > When performing an asynchronous ablkcipher operation the authenc > completion callback routine is invoked, but it does not locate and use > the proper IV. > > The callback routine, crypto_authenc_encrypt_done, is updat

[PATCH 01/10] crypto: authenc - Find proper IV address in ablkcipher callback

2013-11-12 Thread Tom Lendacky
When performing an asynchronous ablkcipher operation the authenc completion callback routine is invoked, but it does not locate and use the proper IV. The callback routine, crypto_authenc_encrypt_done, is updated to use the same method of calculating the address of the IV as is done in

RE: [PATCH] crypto: tcrypt - Add mode 500 for ablkcipher test

2012-06-20 Thread Arun MURTHY
> Quoting Arun Murthy : > > > The existing mode 200 performs ecb(aes), cbc(aes), ctr(aes), > > ecb(des), cbc(des) > > ecb(des3_ede), cbc(des3_ede) for synchronous block cihper. For > > crypto hardware > > drivers ablkcipher's are used and hence add new mode 500 and its > variants to > > perform th

Re: [PATCH] crypto: tcrypt - Add mode 500 for ablkcipher test

2012-06-20 Thread Jussi Kivilinna
Quoting Arun Murthy : The existing mode 200 performs ecb(aes), cbc(aes), ctr(aes), ecb(des), cbc(des) ecb(des3_ede), cbc(des3_ede) for synchronous block cihper. For crypto hardware drivers ablkcipher's are used and hence add new mode 500 and its variants to perform the tests in asynchronous

RE: [PATCH] crypto: tcrypt - Add mode 500 for ablkcipher test

2012-06-20 Thread Geanta Neag Horia Ioan-B05471
.com; Berne Hebark > Subject: [PATCH] crypto: tcrypt - Add mode 500 for ablkcipher test > > The existing mode 200 performs ecb(aes), cbc(aes), ctr(aes), ecb(des), > cbc(des) > ecb(des3_ede), cbc(des3_ede) for synchronous block cihper. For crypto > hardware > drivers ablkcipher&#x

[PATCH] crypto: tcrypt - Add mode 500 for ablkcipher test

2012-06-20 Thread Arun Murthy
The existing mode 200 performs ecb(aes), cbc(aes), ctr(aes), ecb(des), cbc(des) ecb(des3_ede), cbc(des3_ede) for synchronous block cihper. For crypto hardware drivers ablkcipher's are used and hence add new mode 500 and its variants to perform the tests in asynchronous block cipher. Signed-off-by:

[PATCH v4 10/17] crypto: Add userspace report for ablkcipher type algorithms

2011-09-26 Thread Steffen Klassert
crypto_report_blkcipher rblkcipher; + + snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "ablkcipher"); + snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s", +alg->cra_ablkcipher.geniv ?: ""); + + rblkcipher.blocksize = alg->

Re: [PATCH v3 10/17] crypto: Add userspace report for ablkcipher type algorithms

2011-09-25 Thread Steffen Klassert
On Sat, Sep 24, 2011 at 01:21:25PM +1000, Herbert Xu wrote: > > I don't think you should distinguish between BLKCIPHER and ABLKCIPHER. > A good rule of thumb would be if the report data structure is the > same, then the type value should be the same. > Ok, will do that. I&#

Re: [PATCH v3 10/17] crypto: Add userspace report for ablkcipher type algorithms

2011-09-23 Thread Herbert Xu
o_report_blkcipher */ I don't think you should distinguish between BLKCIPHER and ABLKCIPHER. A good rule of thumb would be if the report data structure is the same, then the type value should be the same. You can still have the string type to show something different to the user. Cheers, --

[PATCH v3 10/17] crypto: Add userspace report for ablkcipher type algorithms

2011-09-21 Thread Steffen Klassert
crypto_alg *alg) +{ + struct crypto_report_blkcipher rblkcipher; + + snprintf(rblkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "ablkcipher"); + snprintf(rblkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s", +alg->cra_ablkcipher.geniv ?: "&q

[PATCH v2 08/15] crypto: Add userspace report for ablkcipher type algorithms

2011-08-17 Thread Steffen Klassert
, struct crypto_alg *alg) +{ + struct crypto_report_ablkcipher rablkcipher; + + snprintf(rablkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "ablkcipher"); + snprintf(rablkcipher.geniv, CRYPTO_MAX_ALG_NAME, "%s", +alg->cra_ablkciph

[PATCH 09/16] crypto: Add userspace report for ablkcipher type algorithms

2011-08-11 Thread Steffen Klassert
*skb, struct crypto_alg *alg) + __attribute__ ((unused)); +static int crypto_ablkcipher_report(struct sk_buff *skb, struct crypto_alg *alg) +{ + struct crypto_report_ablkcipher rablkcipher; + + snprintf(rablkcipher.type, CRYPTO_MAX_ALG_NAME, "%s", "ablkcipher"

[PATCH 8/8] crypto: caam - ablkcipher support

2011-07-08 Thread Kim Phillips
) @@ -132,6 +138,19 @@ static inline void aead_append_ld_iv(u32 *desc, int ivsize) } /* + * For ablkcipher encrypt and decrypt, read from req->src and + * write to req->dst + */ +static inline void ablkcipher_append_src_dst(u32 *desc) +{ + append_math_add(desc, VARSEQOUTLEN, SEQINLEN

[PATCH 4/8] crypto: talitos - don't bad_key in ablkcipher setkey

2011-07-08 Thread Kim Phillips
crypto/ablkcipher.c's setkey() has already checked against the min, max key sizes before it calls here, and all max_keysize assignments in the algorithm template array do not exceed TALITOS_MAX_KEY_SIZE. Signed-off-by: Kim Phillips --- drivers/crypto/talitos.c | 11 --- 1 files changed

[PATCH 3/8] crypto: talitos - remove unused giv from ablkcipher methods

2011-07-08 Thread Kim Phillips
Signed-off-by: Kim Phillips --- drivers/crypto/talitos.c |7 +++ 1 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index bd9e2ca..521244e 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1429,7 +1429,

Re: [PATCH] crypt: ablkcipher: remove redundant NULL check

2011-01-28 Thread Herbert Xu
On Tue, Jan 25, 2011 at 12:39:50PM -0800, David Miller wrote: > From: Davidlohr Bueso > Date: Tue, 25 Jan 2011 13:27:45 -0300 > > > From: Davidlohr Bueso > > > > Signed-off-by: Davidlohr Bueso > > Acked-by: David S. Miller Patch applied. Thanks a lot! -- Email: Herbert Xu Home Page: http

Re: [PATCH] crypt: ablkcipher: remove redundant NULL check

2011-01-25 Thread David Miller
From: Davidlohr Bueso Date: Tue, 25 Jan 2011 13:27:45 -0300 > From: Davidlohr Bueso > > Signed-off-by: Davidlohr Bueso Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-crypto" in the body of a message to majord...@vger.kernel.org More majordomo inf

[PATCH] crypt: ablkcipher: remove redundant NULL check

2011-01-25 Thread Davidlohr Bueso
From: Davidlohr Bueso Signed-off-by: Davidlohr Bueso --- crypto/ablkcipher.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index a854df2..fdc67d3 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -141,8 +141,7 @@

Re: [patch] crypto/ablkcipher: missing return statement

2010-07-15 Thread Herbert Xu
On Fri, Jul 16, 2010 at 10:23:11AM +0800, Herbert Xu wrote: > On Thu, Jul 15, 2010 at 07:21:41PM -0700, David Miller wrote: > > From: Dan Carpenter > > Date: Thu, 15 Jul 2010 09:57:36 +0200 > > > > > The intent was to return here. In the original an allocation failure > > > would lead to a NULL

Re: [patch] crypto/ablkcipher: missing return statement

2010-07-15 Thread Herbert Xu
On Thu, Jul 15, 2010 at 07:21:41PM -0700, David Miller wrote: > From: Dan Carpenter > Date: Thu, 15 Jul 2010 09:57:36 +0200 > > > The intent was to return here. In the original an allocation failure > > would lead to a NULL dereference. > > > > Signed-off-by: Dan Carpenter > > Acked-by: David

Re: [patch] crypto/ablkcipher: missing return statement

2010-07-15 Thread David Miller
From: Dan Carpenter Date: Thu, 15 Jul 2010 09:57:36 +0200 > The intent was to return here. In the original an allocation failure > would lead to a NULL dereference. > > Signed-off-by: Dan Carpenter Acked-by: David S. Miller -- To unsubscribe from this list: send the line "unsubscribe linux-c

[patch] crypto/ablkcipher: missing return statement

2010-07-15 Thread Dan Carpenter
The intent was to return here. In the original an allocation failure would lead to a NULL dereference. Signed-off-by: Dan Carpenter diff --git a/crypto/ablkcipher.c b/crypto/ablkcipher.c index 98a6610..a854df2 100644 --- a/crypto/ablkcipher.c +++ b/crypto/ablkcipher.c @@ -165,7 +165,7 @@ static

Re: ABLKCIPHER

2010-03-15 Thread Herbert Xu
On Mon, Mar 15, 2010 at 03:23:36PM +, Dimitrios Siganos wrote: > > Let's say I want to do the classic cbc(aes). The steps are: > 1) allocate a tfm object > 2) set the key > 3) set the iv > 4) encrypt as many times as needed > 5) cleanup > > I can do this without the giv functions. Do the giv ap

Re: ABLKCIPHER

2010-03-15 Thread Kim Phillips
On Mon, 15 Mar 2010 15:23:36 + Dimitrios Siganos wrote: > Herbert Xu wrote: > > Dimitrios Siganos wrote: > > > >> Hi, > >> > >> I am trying to write an ABLKCIPHER algorithm for my hardware crypto > >> engine and I have a few questi

Re: ABLKCIPHER

2010-03-15 Thread Dimitrios Siganos
Herbert Xu wrote: Dimitrios Siganos wrote: Hi, I am trying to write an ABLKCIPHER algorithm for my hardware crypto engine and I have a few questions: 1) In struct ablkcipher_alg, what do these fields do? I see some implementations use them and some not. Do I need to implement them

Re: ABLKCIPHER

2010-03-13 Thread Herbert Xu
Dimitrios Siganos wrote: > Hi, > > I am trying to write an ABLKCIPHER algorithm for my hardware crypto > engine and I have a few questions: > > 1) In struct ablkcipher_alg, what do these fields do? I see some > implementations use them and some not. Do I need to imp

ABLKCIPHER

2010-03-12 Thread Dimitrios Siganos
Hi, I am trying to write an ABLKCIPHER algorithm for my hardware crypto engine and I have a few questions: 1) In struct ablkcipher_alg, what do these fields do? I see some implementations use them and some not. Do I need to implement them? int (*givencrypt)(struct

Re: [PATCH 2/2] crypto: authenc - move saved IV in front of the ablkcipher request

2010-03-03 Thread Herbert Xu
On Wed, Mar 03, 2010 at 07:58:40AM +0100, Steffen Klassert wrote: > On Tue, Mar 02, 2010 at 10:10:49PM +0800, Herbert Xu wrote: > > > > Hmm, I just noticed that both before and after the patch we're > > only including the hash request size for the encrypt case, and > > not the givencrypt case. Is

Re: [PATCH 2/2] crypto: authenc - move saved IV in front of the ablkcipher request

2010-03-02 Thread Steffen Klassert
On Tue, Mar 02, 2010 at 10:10:49PM +0800, Herbert Xu wrote: > > Hmm, I just noticed that both before and after the patch we're > only including the hash request size for the encrypt case, and > not the givencrypt case. Is there a reason for this? > Hm, for the moment I don't see what's missing.

Re: [PATCH 2/2] crypto: authenc - move saved IV in front of the ablkcipher request

2010-03-02 Thread Herbert Xu
On Tue, Feb 23, 2010 at 07:22:37AM +0100, Steffen Klassert wrote: > > @@ -558,13 +556,18 @@ static int crypto_authenc_init_tfm(struct crypto_tfm > *tfm) > ctx->auth = auth; > ctx->enc = enc; > > - tfm->crt_aead.reqsize = max_t(unsigned int, > - crypto_

[PATCH 2/2] crypto: authenc - move saved IV in front of the ablkcipher request

2010-02-22 Thread Steffen Klassert
In crypto_authenc_encrypt() we save the IV behind the ablkcipher request. To save space on the request, we overwrite the ablkcipher request with a ahash request after encryption. So the IV may be overwritten by the ahash request. This patch fixes this by placing the IV in front of the ablkcipher

[PATCH 2/5 RESEND] crypto: talitos - Add ablkcipher algorithms

2009-03-27 Thread Kim Phillips
From: Lee Nipper Add these ablkcipher algorithms: cbc(aes), cbc(des3_ede). Added handling of chained scatterlists with zero length entry because eseqiv uses it. Added new map and unmap routines. Signed-off-by: Lee Nipper minor coding style cleanup, removed testablkcipher modparam. Signed

Re: [PATCH 2/3] crypto: talitos - Add ablkcipher algorithms

2009-03-24 Thread Kim Phillips
On Sun, 15 Mar 2009 20:21:49 -0500 Lee Nipper wrote: > Add these ablkcipher algorithms: > cbc(aes), > cbc(des3_ede). > > ipsec_esp_edesc is renamed to talitos_edesc > to use it in ablkcipher routines. erm...actually that shows up in the prior patch (1/3) :). > +

  1   2   >