Re: [PATCH 2/2] crypto: stm32 - Support for STM32 HASH module

2017-07-31 Thread Kamil Konieczny
ash_request *req, int err) +{ + struct stm32_hash_request_ctx *rctx = ahash_request_ctx(req); + struct stm32_hash_dev *hdev = rctx->hdev; + + if (!err && (HASH_FLAGS_FINAL & hdev->flags)) { -- Best regards, Kamil Konieczny Samsung R Institute Poland

[PATCH] crypto: doc - clarify return values for async hash methods

2017-08-17 Thread Kamil Konieczny
>From af1b10e1e6aaf67f8dc45ed78de89b0469794a98 Mon Sep 17 00:00:00 2001 From: Kamil Konieczny <k.koniec...@partner.samsung.com> Date: Thu, 17 Aug 2017 12:11:36 +0200 Subject: [PATCH] crypto: doc - clarify return values for async hash methods * fix documentation of retu

Re: HELP writing crypto driver for HW with blocksize hash

2017-07-11 Thread Kamil Konieczny
On 11.07.2017 12:30, Gilad Ben-Yossef wrote: > On Tue, Jul 11, 2017 at 10:52 AM, Kamil Konieczny > <k.koniec...@partner.samsung.com> wrote: >> >> >> I am writing crypto driver for hash MD5/SHA1/SHA256 on Exynos 4412, >> and I am facing some

HELP writing crypto driver for HW with blocksize hash

2017-07-11 Thread Kamil Konieczny
unfeeded from ahash_request and return -EINPROGRESS ? Should i set timer and copy rest bytes after some timeout, where no more requests are incoming ? Or not ? cause it is async mode ? can i wait for more requests for processing waiting one ? -- Best regards, Kamil Konieczny Samsung R Institute Poland

Re: [RFC Part2 PATCH v3 02/26] crypto: ccp: Add Platform Security Processor (PSP) device support

2017-07-25 Thread Kamil Konieczny
de, along with > software-based Tursted Executation Environment (TEE) to enable the - ^ Trusted > third-party tursted applications. -- ^ trusted [...] -- Best regards, Kamil Konieczny Samsung R Institute Poland

[PATCH] Documentation: crypto: Fixed bugs, added example usage of calc_hash().

2017-05-12 Thread Kamil Konieczny
. Fixed. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- Documentation/crypto/api-samples.rst | 38 ++-- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/Documentation/crypto/api-samples.rst b/Documentation/crypto/api-samp

[PATCH v2] crypto: s5p-sss: Add HASH support for Exynos

2017-09-15 Thread Kamil Konieczny
tcrypt sec=1 mode=N where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Add new CRYPTO_DEV_EXYNOS_HASH, depend on !EXYNOS_RNG and CRYPTO_DEV_S5P - Select sw algorithms MD5, SHA1 and SHA256 in EXYNOS_HASH as they are nedded for fallback. Signed-off-by: Kamil

Re: [PATCH v2] crypto: s5p-sss: Add HASH support for Exynos

2017-09-22 Thread Kamil Konieczny
On 19.09.2017 21:03, Krzysztof Kozlowski wrote: > On Fri, Sep 15, 2017 at 07:50:06PM +0200, Kamil Konieczny wrote: >> Add support for MD5, SHA1, SHA256 hash algorithms for Exynos HW. >> It uses the crypto framework asynchronous hash api. >> It is based on omap-sham.c drive

Re: [PATCH v3] crypto: s5p-sss: Add HASH support for Exynos

2017-10-04 Thread Kamil Konieczny
On 03.10.2017 21:30, Krzysztof Kozlowski wrote: > On Tue, Oct 03, 2017 at 04:57:43PM +0200, Kamil Konieczny wrote: > >>>> [...] >>>> +static struct ahash_alg algs_sha256[] = { >>>> +{ >>>> + .init = s5p_hash_init, >

[PATCH v4] crypto: s5p-sss: Add HASH support for Exynos

2017-10-04 Thread Kamil Konieczny
tcrypt sec=1 mode=N where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Add new CRYPTO_DEV_EXYNOS_HASH, depend on !EXYNOS_RNG and CRYPTO_DEV_S5P - Select sw algorithms MD5, SHA1 and SHA256 in EXYNOS_HASH as they are nedded for fallback. Signed-off-by: Kamil

Re: [PATCH 0/2] crypto: s5p-sss: Add HASH support for Exynos

2017-10-16 Thread Kamil Konieczny
Hi all, sorry for error in subject line, it should be [PATCH v6 0/2] and so on, I can resend this if needed ? On 16.10.2017 19:43, Kamil Konieczny wrote: > First patch cleans up spaces in defines, second adds HASH support for Exynos. > Changes: -- Best regards, Kamil Konieczny Sam

[PATCH 2/2] Add HASH support for Exynos

2017-10-16 Thread Kamil Konieczny
tcrypt sec=1 mode=N where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Add new CRYPTO_DEV_EXYNOS_HASH, depend on !EXYNOS_RNG and CRYPTO_DEV_S5P - Select sw algorithms MD5, SHA1 and SHA256 in EXYNOS_HASH as they are nedded for fallback. Signed-off-by: Kamil

[PATCH 1/2] change spaces into tabs in defines

2017-10-16 Thread Kamil Konieczny
Change spaces into tabs in defines. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/s5p-sss.c | 190 +++ 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/cryp

[PATCH v7 2/2] crypto: s5p-sss: Add HASH support for Exynos

2017-10-17 Thread Kamil Konieczny
tcrypt sec=1 mode=N where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Add new CRYPTO_DEV_EXYNOS_HASH, depend on !EXYNOS_RNG and CRYPTO_DEV_S5P - Select sw algorithms MD5, SHA1 and SHA256 in EXYNOS_HASH as they are nedded for fallback. Signed-off-by: Kamil

[PATCH v7 1/2] crypto: s5p-sss: change spaces into tabs in defines

2017-10-17 Thread Kamil Konieczny
change spaces into tabs in defines Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/s5p-sss.c | 190 +++ 1 file changed, 95 insertions(+), 95 deletions(-) diff --git a/drivers/crypto/s5p-sss.c b/drivers/cryp

[PATCH v7 0/2] crypto: s5p-sss: Add HASH support for Exynos

2017-10-17 Thread Kamil Konieczny
ups in aes, as they should go in separate patch - remove FLOW_LOG, FLOW_DUMP macros and its uses - remove #if 0 ... endif - remove unused function hash_wait and its defines - fix compiler warning in dev_dbg - remove some comments - other minor fixes in comments Kamil Konieczny (2): change spa

[PATCH] crypto: s5p-sss: Add HASH support for Exynos

2017-09-13 Thread Kamil Konieczny
where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Select sw algorithms MD5, SHA1 and SHA256 in S5P as they are nedded for fallback. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/Kconfig |6 + drivers/cryp

Re: [PATCH] crypto: s5p-sss: Add HASH support for Exynos

2017-09-13 Thread Kamil Konieczny
Hi Krzysztof, On 13.09.2017 15:18, Krzysztof Kozlowski wrote: > On Wed, Sep 13, 2017 at 2:44 PM, Kamil Konieczny > <k.koniec...@partner.samsung.com> wrote: >> Add support for MD5, SHA1, SHA256 hash algorithms for Exynos HW. >> It uses the crypto framework asynchronous

Re: [PATCH v2] crypto: s5p-sss: Add HASH support for Exynos

2017-09-26 Thread Kamil Konieczny
On 25.09.2017 20:27, Krzysztof Kozlowski wrote: > On Fri, Sep 22, 2017 at 08:00:17PM +0200, Kamil Konieczny wrote: >> On 19.09.2017 21:03, Krzysztof Kozlowski wrote: >>> On Fri, Sep 15, 2017 at 07:50:06PM +0200, Kamil Konieczny wrote: > > (...) > >>>> + >

Re: [PATCH v3] crypto: s5p-sss: Add HASH support for Exynos

2017-10-03 Thread Kamil Konieczny
On 30.09.2017 21:50, Krzysztof Kozlowski wrote: > On Wed, Sep 27, 2017 at 02:25:50PM +0200, Kamil Konieczny wrote: >> Add support for MD5, SHA1, SHA256 hash algorithms for Exynos HW. >> It uses the crypto framework asynchronous hash api. >> It is based on omap-sham.c drive

Re: Question about ahash export and import

2017-09-26 Thread Kamil Konieczny
allback), followed by > a call to update. Both import()/export() are synchronous op, this means they are not allowed to return -EINPROGRESS nor call complete(). Can import() be called without _any_ init(), for example after reboot of machine ? Is following scenario valid: init(), update() 0 or more times, export(), save exported data to pernament storage reboot machine load crypto driver, import() saved state ? -- Best regards, Kamil Konieczny Samsung R Institute Poland

Re: [PATCH v2] crypto: s5p-sss: Add HASH support for Exynos

2017-09-25 Thread Kamil Konieczny
On 19.09.2017 21:03, Krzysztof Kozlowski wrote: > On Fri, Sep 15, 2017 at 07:50:06PM +0200, Kamil Konieczny wrote: >> Add support for MD5, SHA1, SHA256 hash algorithms for Exynos HW. >> It uses the crypto framework asynchronous hash api. >> It is based on omap-sham.c drive

Re: [PATCH v2] crypto: s5p-sss: Add HASH support for Exynos

2017-09-27 Thread Kamil Konieczny
On 26.09.2017 21:28, Krzysztof Kozlowski wrote: > On Tue, Sep 26, 2017 at 05:54:42PM +0200, Kamil Konieczny wrote: >> On 25.09.2017 20:27, Krzysztof Kozlowski wrote: >> [...] >>>>>> +struct tasklet_struct hash_tasklet; >>>>>>

[PATCH v3] crypto: s5p-sss: Add HASH support for Exynos

2017-09-27 Thread Kamil Konieczny
tcrypt sec=1 mode=N where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Add new CRYPTO_DEV_EXYNOS_HASH, depend on !EXYNOS_RNG and CRYPTO_DEV_S5P - Select sw algorithms MD5, SHA1 and SHA256 in EXYNOS_HASH as they are nedded for fallback. Signed-off-by: Kamil

[PATCH v5] crypto: s5p-sss: Add HASH support for Exynos

2017-10-09 Thread Kamil Konieczny
tcrypt sec=1 mode=N where N=402, 403, 404 (MD5, SHA1, SHA256). Modifications in drivers/crypto/Kconfig: - Add new CRYPTO_DEV_EXYNOS_HASH, depend on !EXYNOS_RNG and CRYPTO_DEV_S5P - Select sw algorithms MD5, SHA1 and SHA256 in EXYNOS_HASH as they are nedded for fallback. Signed-off-by: Kamil

Re: [PATCH v7 1/2] crypto: s5p-sss: change spaces into tabs in defines

2017-10-24 Thread Kamil Konieczny
Hi Vladimir, Thank you for review. On 22.10.2017 12:18, Vladimir Zapolskiy wrote: > Hi Kamil, > > On 10/17/2017 02:28 PM, Kamil Konieczny wrote: >> change spaces into tabs in defines > > Here a grammatically correct sentence in English is welcome. What about: &

Re: [PATCH v7 2/2] crypto: s5p-sss: Add HASH support for Exynos

2017-10-24 Thread Kamil Konieczny
Hi Vladimir, Thank you for review, I will apply almost all of your remarks, see answers below. On 22.10.2017 12:18, Vladimir Zapolskiy wrote: > Hi Kamil, > > thank you for updates, I have just a few more comments. > > On 10/17/2017 02:28 PM, Kamil Konieczny wrote: >>

[PATCH] crypto: Add myself as co-maintainer for s5p-sss.c

2017-11-28 Thread Kamil Konieczny
Add myself as co-maintainer for Samsung Security SubSystem driver. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index aa71ab52fd76..3f6cadf2e087 100644 --- a/MAINTAINERS

Re: Question about ahash export and import

2017-11-24 Thread Kamil Konieczny
On 27.09.2017 11:08, Herbert Xu wrote: > On Tue, Sep 26, 2017 at 01:09:05PM +0200, Kamil Konieczny wrote: >> >> Can import() be called without _any_ init(), for example >> after reboot of machine ? Is following scenario valid: > > Of course it can. import must resto

Re: [PATCH v2 3/4] crypto: inside-secure - only update the result buffer when provided

2017-11-30 Thread Kamil Konieczny
->src, >sg_nents_for_len(areq->src, areq->nbytes), DMA_TO_DEVICE); > can the driver get request for final/finup/digest with null req->result ? If yes (?), such checks can be done before any hardware processing, saving time, for example: int hash_final(struct a

Re: [PATCH v2 3/4] crypto: inside-secure - only update the result buffer when provided

2017-11-30 Thread Kamil Konieczny
Hi Antoine, On 30.11.2017 10:29, Antoine Tenart wrote: > Hi Kamil, > > On Thu, Nov 30, 2017 at 10:19:26AM +0100, Kamil Konieczny wrote: >> On 28.11.2017 16:42, Antoine Tenart wrote: >>> The patch fixes the ahash support by only updating the result buffer >>> wh

Re: [PATCH v2 3/4] crypto: inside-secure - only update the result buffer when provided

2017-12-01 Thread Kamil Konieczny
Hi All, On 01.12.2017 09:11, Antoine Tenart wrote: > Hi Herbert, > > On Fri, Dec 01, 2017 at 11:31:09AM +1100, Herbert Xu wrote: >> On Thu, Nov 30, 2017 at 10:19:26AM +0100, Kamil Konieczny wrote: >>> >>> can the driver get request for final/finup/digest w

Re: [PATCH v2 3/4] crypto: inside-secure - only update the result buffer when provided

2017-12-01 Thread Kamil Konieczny
Hi Antoine, On 01.12.2017 11:24, Antoine Tenart wrote: > Hi Kamil, > > On Fri, Dec 01, 2017 at 11:18:30AM +0100, Kamil Konieczny wrote: >> On 01.12.2017 09:11, Antoine Tenart wrote: >>> - Other drivers are doing this check (grep "if (!req->result)" or >>

Re: [PATCH v2 3/4] crypto: inside-secure - only update the result buffer when provided

2017-12-01 Thread Kamil Konieczny
Hi Herbert, On 01.12.2017 11:36, Herbert Xu wrote: > On Fri, Dec 01, 2017 at 11:18:30AM +0100, Kamil Konieczny wrote: >> >> Herbert, is it possible for every init/update that areq->result can be NULL, >> and only for final/update/digit user set it to actual memory ? >&g

[PATCH v2] crypto: Add myself as co-maintainer for s5p-sss.c

2017-12-01 Thread Kamil Konieczny
-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- Changes: v2: clarify reasons for co-maintenance. MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index aa71ab52fd76..3f6cadf2e087 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11982,6 +1

[PATCH v8 1/2] crypto: s5p-sss: Change spaces to tabs

2017-10-25 Thread Kamil Konieczny
Change #define lines to use tabs consistently. Acked-by: Vladimir Zapolskiy <v...@mleia.com> Reviewed-by: Krzysztof Kozlowski <k...@kernel.org> Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/s5p-sss.c | 190 +++-

[PATCH v8 2/2] crypto: s5p-sss: Add HASH support for Exynos

2017-10-25 Thread Kamil Konieczny
Zapolskiy <v...@mleia.com> Reviewed-by: Krzysztof Kozlowski <k...@kernel.org> Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/Kconfig | 14 + drivers/crypto/s5p-sss.c | 1406 +- 2 files changed, 1410

[PATCH v8 0/2] crypto: s5p-sss: Add HASH support for Exynos

2017-10-25 Thread Kamil Konieczny
LOG, FLOW_DUMP macros and its uses - remove #if 0 ... endif - remove unused function hash_wait and its defines - fix compiler warning in dev_dbg - remove some comments - other minor fixes in comments Kamil Konieczny (2): crypto: s5p-sss: Change spaces to tabs crypto: s5p-sss: Add HASH support for Exy

Re: [PATCH] crypto: clear htmldocs build warnings for crypto/hash

2018-01-08 Thread Kamil Konieczny
On 08.01.2018 16:56, Herbert Xu wrote: > On Mon, Jan 08, 2018 at 02:11:21PM +0100, Kamil Konieczny wrote: >> >> >> On 07.01.2018 00:01, Tobin C. Harding wrote: >>> SPHINX build emits multiple warnings of kind: >>> >>> warning: duplicate secti

Re: [PATCH] crypto: ux500/hash: Add empty export and import

2018-01-18 Thread Kamil Konieczny
On 18.01.2018 11:06, Linus Walleij wrote: > On Tue, Jan 16, 2018 at 5:32 PM, Kamil Konieczny > <k.koniec...@partner.samsung.com> wrote: > >> Crypto framework will require async hash export/import, so add empty >> functions to prevent OOPS. >> >> S

Re: [PATCH] crypto: mxs-dcp: Add empty hash export and import

2018-01-18 Thread Kamil Konieczny
Please drop this as I will resend it as part of patchset. On 16.01.2018 17:16, Kamil Konieczny wrote: > Crypto framework will require async hash export/import, so add empty > functions to prevent OOPS. > > Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> >

[PATCH 2/5] crypto: n2_core: Add empty hash export and import

2018-01-18 Thread Kamil Konieczny
' will be enabled. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/n2_core.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/crypto/n2_core.c b/drivers/crypto/n2_core.c index 662e709812cc..80e9c842aad4 100644 --- a/drivers/crypto/n2_core.c

[PATCH 5/5] crypto: ahash.c: Require export/import in ahash

2018-01-18 Thread Kamil Konieczny
Export and import are mandatory in async hash. As drivers were rewritten, drop empty wrappers and correct init of ahash transformation. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- crypto/ahash.c | 18 ++ 1 file changed, 2 insertions(+), 16 del

[PATCH 4/5] crypto: bfin_crc: Add empty hash export and import

2018-01-18 Thread Kamil Konieczny
' will be enabled. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/bfin_crc.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/crypto/bfin_crc.c b/drivers/crypto/bfin_crc.c index a118b9bed669..65a8e07835e8 100644 --- a/drivers/crypto/bfin

[PATCH v3 1/5] crypto: mxs-dcp: Add empty hash export and import

2018-01-18 Thread Kamil Konieczny
' will be enabled. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/mxs-dcp.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/crypto/mxs-dcp.c b/drivers/crypto/mxs-dcp.c index 764be3e6933c..a10c418d4e5c 100644 --- a/drivers/crypto/mxs-dcp.c

Re: [PATCH] crypto: n2_core: Add empty hash export and import

2018-01-18 Thread Kamil Konieczny
Please drop this as I will resend it as part of patchset. On 16.01.2018 17:18, Kamil Konieczny wrote: > Crypto framework will require async hash export/import, so add empty > functions to prevent OOPS. > > Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> >

Re: [PATCH] crypto: ux500/hash: Add empty export and import

2018-01-18 Thread Kamil Konieczny
Please drop this as I will resend it as part of patchset. On 16.01.2018 17:32, Kamil Konieczny wrote: > Crypto framework will require async hash export/import, so add empty > functions to prevent OOPS. > > Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> >

[PATCH v3 0/5] crypto: ahash.c: Require export/import in ahash

2018-01-18 Thread Kamil Konieczny
of unreleated patches make commit message more descriptive Kamil Konieczny (5): crypto: mxs-dcp: Add empty hash export and import crypto: n2_core: Add empty hash export and import crypto: ux500/hash: Add empty export and import crypto: bfin_crc: Add empty hash export and import crypto: ahash.c

[PATCH 3/5] crypto: ux500/hash: Add empty export and import

2018-01-18 Thread Kamil Konieczny
' will be enabled. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> Acked-by: Linus Walleij <linus.wall...@linaro.org> --- drivers/crypto/ux500/hash/hash_core.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/crypto/ux500/hash/hash_core.c b/drivers/

[RFT PATCH] crypto: ahash.c: Require export/import in ahash

2018-01-16 Thread Kamil Konieczny
Export and import were optional in async hash. As drivers were rewritten, they become mandatory now, so correct init of ahash transformation. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- Tested with crypto run-time self test on Odroid-U3 with Exynos 4412 CPU, with

[PATCH] crypto: testmgr.c: test misuse of result in ahash

2018-01-16 Thread Kamil Konieczny
Async hash operations can use result pointer in final/finup/digest, but not in init/update/export/import, so test it for misuse. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- Tested with crypto run-time self test on Odroid-U3 with Exynos 4412 CPU with insmod s5p-

Re: [PATCH] crypto: mxs-dcp: Add empty hash export and import

2018-01-16 Thread Kamil Konieczny
On 16.01.2018 17:56, Marek Vasut wrote: > On 01/16/2018 05:16 PM, Kamil Konieczny wrote: >> Crypto framework will require async hash export/import, so add empty >> functions to prevent OOPS. > > Shouldn't this be handled on the subsystem level with some > >

Re: [PATCH] crypto: mxs-dcp: Add empty hash export and import

2018-01-16 Thread Kamil Konieczny
On 16.01.2018 18:28, Fabio Estevam wrote: > Hi Kamil, > > On Tue, Jan 16, 2018 at 2:16 PM, Kamil Konieczny > <k.koniec...@partner.samsung.com> wrote: >> Crypto framework will require async hash export/import, so add empty >> functions to prevent OOPS. > >

[PATCH] crypto: ux500/hash: Add empty export and import

2018-01-16 Thread Kamil Konieczny
Crypto framework will require async hash export/import, so add empty functions to prevent OOPS. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/ux500/hash/hash_core.c | 18 ++ 1 file changed, 18 insertions(+) diff --git a/drivers/crypto

[PATCH] crypto: n2_core: Add empty hash export and import

2018-01-16 Thread Kamil Konieczny
Crypto framework will require async hash export/import, so add empty functions to prevent OOPS. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/n2_core.c | 12 1 file changed, 12 insertions(+) diff --git a/drivers/crypto/n2_core.c b/d

[PATCH] crypto: mxs-dcp: Add empty hash export and import

2018-01-16 Thread Kamil Konieczny
Crypto framework will require async hash export/import, so add empty functions to prevent OOPS. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- drivers/crypto/mxs-dcp.c | 14 ++ 1 file changed, 14 insertions(+) diff --git a/drivers/crypto/mxs-dcp.c b/d

Re: [PATCH 5/5] crypto: ahash.c: Require export/import in ahash

2018-01-19 Thread Kamil Konieczny
On 19.01.2018 11:08, Marek Vasut wrote: > On 01/19/2018 10:53 AM, Kamil Konieczny wrote: >> On 18.01.2018 22:31, Marek Vasut wrote: >>> On 01/18/2018 07:34 PM, Kamil Konieczny wrote: >>>> Export and import are mandatory in async hash. As drivers were >&

Re: [PATCH 5/5] crypto: ahash.c: Require export/import in ahash

2018-01-19 Thread Kamil Konieczny
On 18.01.2018 22:31, Marek Vasut wrote: > On 01/18/2018 07:34 PM, Kamil Konieczny wrote: >> Export and import are mandatory in async hash. As drivers were >> rewritten, drop empty wrappers and correct init of ahash transformation. > > Are you moving checks from the core

Re: Odroid HC1 cryptsetup:encrypt sata driver

2018-01-30 Thread Kamil Konieczny
Hi Anand, On 24.01.2018 14:04, Anand Moon wrote: > Hi Kamil Konieczny, > > I am looking in setup of encrypted sata hard-disk on Odroid XU4/HC1 device. > using following encryption method. > > aes-cbc-essiv:sha256 128 > aes-cbc-essiv:sha256 256 > > Here is my

Re: Odroid HC1 cryptsetup:encrypt sata driver

2018-02-02 Thread Kamil Konieczny
On 24.01.2018 15:01, Krzysztof Kozlowski wrote: > On Wed, Jan 24, 2018 at 2:04 PM, Anand Moon <linux.am...@gmail.com> wrote: >> Hi Kamil Konieczny, >> >> I am looking in setup of encrypted sata hard-disk on Odroid XU4/HC1 device. >> using following encryption m

Re: Odroid HC1 cryptsetup:encrypt sata driver

2018-02-02 Thread Kamil Konieczny
On 31.01.2018 06:51, Anand Moon wrote: > Hi Kamil, > > On 30 January 2018 at 21:02, Kamil Konieczny > <k.koniec...@partner.samsung.com> wrote: >> Hi Anand, >> >> On 24.01.2018 14:04, Anand Moon wrote: >>> Hi Kamil Konieczny, >>> >>>

[PATCH] crypto: s5p-sss.c: Fix kernel Oops in AES-ECB mode

2018-02-05 Thread Kamil Konieczny
In AES-ECB mode crypt is done with key only, so any use of IV can cause kernel Oops, as reported by Anand Moon. Fixed it by using IV only in AES-CBC and AES-CTR. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> Reported-by: Anand Moon <linux.am...@gmail.com> --- Test

Re: [PATCH] crypto: s5p-sss.c: Fix kernel Oops in AES-ECB mode

2018-02-06 Thread Kamil Konieczny
On 06.02.2018 17:48, Anand Moon wrote: > Hi Kamil, > > Thanks for providing the fix to this issue. > > On 5 February 2018 at 23:10, Kamil Konieczny > <k.koniec...@partner.samsung.com> wrote: >> >> In AES-ECB mode crypt is done with key only, so an

[PATCH v2] crypto: s5p-sss.c: Fix kernel Oops in AES-ECB mode

2018-02-07 Thread Kamil Konieczny
In AES-ECB mode crypt is done with key only, so any use of IV can cause kernel Oops. Use IV only in AES-CBC and AES-CTR. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> Reported-by: Anand Moon <linux.am...@gmail.com> Reviewed-by: Krzysztof Kozlowski <k...@ker

[PATCH v3] crypto: s5p-sss.c: Fix kernel Oops in AES-ECB mode

2018-02-07 Thread Kamil Konieczny
In AES-ECB mode crypt is done with key only, so any use of IV can cause kernel Oops. Use IV only in AES-CBC and AES-CTR. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> Reported-by: Anand Moon <linux.am...@gmail.com> Reviewed-by: Krzysztof Kozlowski <k...@ker

Re: [PATCH v3 0/5] crypto: ahash.c: Require export/import in ahash

2018-02-16 Thread Kamil Konieczny
On 15.02.2018 19:32, Marek Vasut wrote: > On 02/15/2018 07:06 PM, Kamil Konieczny wrote: >> >> >> On 15.02.2018 18:06, Marek Vasut wrote: >>> On 02/15/2018 06:00 PM, Kamil Konieczny wrote: >>>> >>>> >>>> On 15.02.2018 17:27,

Re: [PATCH v3 0/5] crypto: ahash.c: Require export/import in ahash

2018-02-15 Thread Kamil Konieczny
On 15.02.2018 17:27, Marek Vasut wrote: > On 02/15/2018 04:41 PM, Herbert Xu wrote: >> On Thu, Jan 18, 2018 at 07:33:59PM +0100, Kamil Konieczny wrote: >>> First four patches add empty hash export and import functions to each >>> driver, >>> with the s

Re: [PATCH] Update Boris Brezillon email address

2018-02-16 Thread Kamil Konieczny
On 16.02.2018 15:54, Boris Brezillon wrote: > Adding back all the people that were Cc-ed on the initial email. > > On Fri, 16 Feb 2018 15:18:21 +0100 > Kamil Konieczny <k.koniec...@partner.samsung.com> wrote: > >> On 16.02.2018 15:00, Boris Brezillon wrote: >>>

Re: [PATCH v3 0/5] crypto: ahash.c: Require export/import in ahash

2018-02-15 Thread Kamil Konieczny
On 15.02.2018 18:06, Marek Vasut wrote: > On 02/15/2018 06:00 PM, Kamil Konieczny wrote: >> >> >> On 15.02.2018 17:27, Marek Vasut wrote: >>> On 02/15/2018 04:41 PM, Herbert Xu wrote: >>>> On Thu, Jan 18, 2018 at 07:33:59PM +0100, Kamil Konieczny wrot

[PATCH v2] crypto/ahash: Require export/import in ahash

2018-01-16 Thread Kamil Konieczny
Export and import were optional in async hash. As most drivers were rewritten, they become mandatory now, so correct init of ahash transformation. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- This is resend of previous patch. As Bartlomiej Zolnierkiewicz point

Re: [PATCH v2] crypto/ahash: Require export/import in ahash

2018-01-18 Thread Kamil Konieczny
On 16.01.2018 19:38, Kamil Konieczny wrote: > Export and import were optional in async hash. As most drivers were > rewritten, they become mandatory now, so correct init of ahash > transformation. > > Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> P

Re: [PATCH 3/4] crypto: bcm: Constify *hash_alg_name[]

2018-03-09 Thread Kamil Konieczny
" }; > > /* Assumes SPU-M messages are in big endian */ > void spum_dump_msg_hdr(u8 *buf, unsigned int buf_len) > diff --git a/drivers/crypto/bcm/spu.h b/drivers/crypto/bcm/spu.h > index f252367..71cf6b5 100644 > --- a/drivers/crypto/bcm/spu.h > +++ b/drivers/crypto/bcm/spu.h > @@ -111,7 +111,7 @@ enum aead_type { > AEAD_TYPE_LAST > }; > > -extern char *hash_alg_name[HASH_ALG_LAST]; > +extern const char * const hash_alg_name[HASH_ALG_LAST]; > > struct spu_request_opts { > bool is_inbound; > -- Best regards, Kamil Konieczny Samsung R Institute Poland

[PATCH v2] crypto: hash.h: Prevent use of req->result in ahash update

2018-03-07 Thread Kamil Konieczny
Prevent improper use of req->result field in ahash update, init, export and import functions in drivers code. A driver should use ahash request context if it needs to save internal state. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- version 2: Change req->d

Re: [PATCH] crypto: hash.h: Prevent use of req->digest in ahash update

2018-03-07 Thread Kamil Konieczny
On 06.03.2018 19:04, Tom Lendacky wrote: > On 3/6/2018 5:45 AM, Kamil Konieczny wrote: >> Prevent improper use of req->digest field in ahash update, init, export and > > Shouldn't that be req->result (here and below)? Yes, it should, I will send version 2 soon, thank you.

[PATCH] crypto: hash.h: Prevent use of req->digest in ahash update

2018-03-06 Thread Kamil Konieczny
Prevent improper use of req->digest field in ahash update, init, export and import functions in drivers code. A driver should use ahash request context if it needs to save internal state. Signed-off-by: Kamil Konieczny <k.koniec...@partner.samsung.com> --- include/crypto/ha

Re: [PATCH v2] X.509: unpack RSA signatureValue field from BIT STRING

2018-04-17 Thread Kamil Konieczny
prefixes has no bearing on its value. > > The signature length, however was incorrect, which is a problem for RSA > implementations that need it to be exactly correct (like AMD CCP). > > Signed-off-by: Maciej S. Szmigiero <m...@maciej.szmigiero.name> your e-mail address looks

Re: [PATCH v2] crypto: doc - clarify hash callbacks state machine

2018-03-20 Thread Kamil Konieczny
r of request context is responsible for alloc and destroy, so why there are no chance of free ? -- Best regards, Kamil Konieczny Samsung R Institute Poland

Re: Why are we testing an intermediate result in ahash?

2018-03-05 Thread Kamil Konieczny
s try to use req->result as theirs temporary storage. The bug comes up in some scenarios when caller reused ahash request and leaves in req->result undefined value, it can be NULL or container_of(NULL) or whatever was on stack -- Best regards, Kamil Konieczny Samsung R Institute Poland

Re: Why are we testing an intermediate result in ahash?

2018-03-05 Thread Kamil Konieczny
On 05.03.2018 18:47, Gary R Hook wrote: > On 03/05/2018 03:57 AM, Kamil Konieczny wrote: >> >> >> On 02.03.2018 22:11, Gary R Hook wrote: >>> Commit 466d7b9f6 (cryptodev-2.6) added code to testmgr to populate, for >>> async hash operations, >>>