Re: [PATCH v5] crypto : stm32 - Add STM32F4 CRC32 support

2017-08-16 Thread Lionel DEBIEVE
Hi Cosar, Sorry for the delay to feedback. This implementation is in the good way. But it should be better to use platform data and use array with type of algs instead of duplicating the algo description for each platform. If we add a new platform, with another type of crc, we will again duplicat

[PATCH 1/1] crypto: stm32/hash - Remove uninitialized symbol

2017-08-18 Thread Lionel Debieve
Remove err symbol as this is not used in the thread context and the variable is not initialized. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32

Re: [PATCH 1/2] crypto: stm32 - Fix uninitialized data usage

2017-09-18 Thread Lionel DEBIEVE
Hi Arnd, I've already push this fix for review last month, waiting the ack. " From: Lionel Debieve To: Herbert Xu , "David S . Miller" , Maxime Coquelin , Alexandre Torgue , , , CC: Benjamin Gaignard , Fabien Dessenne , Ludovic Barre Subject

[PATCH 1/1] crypto: stm32/hash - Fix return issue in update

2017-11-06 Thread Lionel Debieve
When update data reached the threshold for data processing, we must inform that processing is on going. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers

[PATCH 0/3] STM32 CRC update

2017-07-13 Thread Lionel Debieve
crypto algos, HASH and CRYP are pushed accordingly. Lionel Debieve (3): crypto: stm32 - CRC use relaxed function crypto: stm32 - solve crc issue during unbind crypto: stm32 - Rename module to use generic crypto drivers/crypto/Makefile| 2 +- drivers/crypto/stm32/Kconfig

[PATCH 3/3] crypto: stm32 - Rename module to use generic crypto

2017-07-13 Thread Lionel Debieve
The complete stm32 module is rename as crypto in order to use generic naming Signed-off-by: Lionel Debieve Reviewed-by: Fabien Dessenne --- drivers/crypto/Makefile | 2 +- drivers/crypto/stm32/Kconfig | 6 +++--- drivers/crypto/stm32/Makefile | 3 +-- 3 files changed, 5 insertions(+), 6

[PATCH 1/3] crypto: stm32 - CRC use relaxed function

2017-07-13 Thread Lionel Debieve
In case of arm soc support, readl and writel will be optimized using relaxed functions Signed-off-by: Lionel Debieve Reviewed-by: Fabien Dessenne --- drivers/crypto/stm32/stm32_crc32.c | 15 --- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/crypto/stm32

[PATCH 2/3] crypto: stm32 - solve crc issue during unbind

2017-07-13 Thread Lionel Debieve
Use the correct unregister_shashes function to to remove the registered algo Signed-off-by: Lionel Debieve Reviewed-by: Fabien Dessenne --- drivers/crypto/stm32/stm32_crc32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/stm32/stm32_crc32.c b/drivers

[PATCH 1/2] dt-bindings: Document STM32 HASH bindings

2017-07-13 Thread Lionel Debieve
This adds documentation of device tree bindings for the STM32 HASH controller. Signed-off-by: Lionel Debieve --- .../devicetree/bindings/crypto/st,stm32-hash.txt | 30 ++ 1 file changed, 30 insertions(+) create mode 100644 Documentation/devicetree/bindings/crypto/st,stm32

[PATCH 0/2] STM32 HASH crypto driver

2017-07-13 Thread Lionel Debieve
/ testmgr. Note: Since two other set of patches (update of STM32 CRC32 and addition of STM32 CRYP) are being proposed, it may happen that there are some minor conflicts in 'Kconfig' and 'Makefile'. In that case, I will fix the issue in due course. Lionel Debieve (2): dt-bind

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

2017-07-13 Thread Lionel Debieve
This module register a HASH module that support multiples algorithms: MD5, SHA1, SHA224, SHA256. It includes the support of HMAC hardware processing corresponding to the supported algorithms. DMA or IRQ mode are used depending on data length. Signed-off-by: Lionel Debieve --- drivers/crypto

Re: [RESEND,PATCH v4 3/3] crypto : stm32 - Add STM32F4 CRC32 support

2017-07-17 Thread Lionel DEBIEVE
Hi Cosar, - ret = crypto_register_shashes(algs, ARRAY_SIZE(algs)); + /* For F4 series only CRC32 algorithm will be used */ + if (of_device_is_compatible(crc->dev->of_node, "st,stm32f4-crc")) + algs_size = 1; + else + algs_size = ARRAY_SIZE(algs);

[PATCH 3/3] crypto: stm32/hash: rework padding length

2018-01-29 Thread Lionel Debieve
From: Lionel Debieve Due to another patch, the dma fails when padding is needed as the given length is not correct. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b

[PATCH 0/3] crypto: stm32/hash: Correction to improve robustness

2018-01-29 Thread Lionel Debieve
From: Lionel Debieve Hi, This patch serie will improve global robustness for stm32-hash driver. Patch #1 is fixing dma-burst issue when configuration is not set. Patch #2 solves issue that occurs when irq append during final req processing. Patch #3 is fixing an issue that have been

[PATCH 1/3] crypto: stm32/hash: avoid error if maxburst not defined

2018-01-29 Thread Lionel Debieve
From: Lionel Debieve dma-maxburst is an optional value and must not return error in case of dma not used (or max-burst not defined). Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers

[PATCH 2/3] crypto: stm32/hash: fix performance issues

2018-01-29 Thread Lionel Debieve
From: Lionel Debieve Fixing bugs link to stress tests. Bad results are detected during testmgr selftests executing in a faster environment. bufcnt value may be resetted and false IT are sometimes detected. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 8 ++-- 1

[PATCH 3/5] hwrng: stm32 - allow disable clock error detection

2018-01-29 Thread Lionel Debieve
Add a new property that allow to disable the clock error detection which is required when the clock source selected is out of specification (which is not mandatory). Signed-off-by: Lionel Debieve --- drivers/char/hw_random/stm32-rng.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion

[PATCH 2/5] dt-bindings: rng: add reset node for stm32

2018-01-29 Thread Lionel Debieve
Adding optional resets property for rng. Signed-off-by: Lionel Debieve --- Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt b/Documentation/devicetree/bindings/rng/st,stm32

[PATCH 0/5] hwrng: stm32 - Improvement for stm32-rng

2018-01-29 Thread Lionel Debieve
on specific target. Patch #5 rework the timeout calculation for read value that was previously defined based on loop operation and is now based on timer. Lionel Debieve (5): hwrng: stm32 - add reset during probe dt-bindings: rng: add reset node for stm32 hwrng: stm32 - allow disable clock

[PATCH 4/5] dt-bindings: rng: add clock detection error for stm32

2018-01-29 Thread Lionel Debieve
Add optional property to enable the clock detection error on rng block. It is used to allow slow clock source which give correct entropy for rng. Signed-off-by: Lionel Debieve --- Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH 1/5] hwrng: stm32 - add reset during probe

2018-01-29 Thread Lionel Debieve
Avoid issue when probing the RNG without reset if bad status has been detected previously Signed-off-by: Lionel Debieve --- drivers/char/hw_random/stm32-rng.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c

[PATCH Resend 1/5] hwrng: stm32 - add reset during probe

2018-02-15 Thread Lionel Debieve
Avoid issue when probing the RNG without reset if bad status has been detected previously Signed-off-by: Lionel Debieve --- drivers/char/hw_random/stm32-rng.c | 9 + 1 file changed, 9 insertions(+) diff --git a/drivers/char/hw_random/stm32-rng.c b/drivers/char/hw_random/stm32-rng.c

[PATCH Resend 0/5] hwrng: stm32 - Improvement for stm32-rng

2018-02-15 Thread Lionel Debieve
on specific target. Patch #5 rework the timeout calculation for read value that was previously defined based on loop operation and is now based on timer. Lionel Debieve (5): hwrng: stm32 - add reset during probe dt-bindings: rng: add reset node for stm32 hwrng: stm32 - allow disable clock

[PATCH Resend 4/5] dt-bindings: rng: add clock detection error for stm32

2018-02-15 Thread Lionel Debieve
Add optional property to enable the clock detection error on rng block. It is used to allow slow clock source which give correct entropy for rng. Signed-off-by: Lionel Debieve --- Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 1 + 1 file changed, 1 insertion(+) diff --git a

[PATCH Resend 3/5] hwrng: stm32 - allow disable clock error detection

2018-02-15 Thread Lionel Debieve
Add a new property that allow to disable the clock error detection which is required when the clock source selected is out of specification (which is not mandatory). Signed-off-by: Lionel Debieve --- drivers/char/hw_random/stm32-rng.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion

[PATCH Resend 2/5] dt-bindings: rng: add reset node for stm32

2018-02-15 Thread Lionel Debieve
Adding optional resets property for rng. Signed-off-by: Lionel Debieve --- Documentation/devicetree/bindings/rng/st,stm32-rng.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/rng/st,stm32-rng.txt b/Documentation/devicetree/bindings/rng/st,stm32

[PATCH Resend 5/5] hwrng: stm32 - rework read timeout calculation

2018-02-15 Thread Lionel Debieve
Increase timeout delay to support longer timing linked to rng initialization. Measurement is based on timer instead of instructions per iteration which is not powerful on all targets. Signed-off-by: Lionel Debieve --- drivers/char/hw_random/stm32-rng.c | 25 ++--- 1 file

[PATCH 2/2] hwrng: stm32-rng - fix pm_suspend issue

2018-04-23 Thread Lionel Debieve
When suspend is called after pm_runtime_suspend, same callback is used and access to rng register is freezing system. By calling the pm_runtime_force_suspend, it first checks that runtime has been already done. Signed-off-by: Lionel Debieve --- drivers/char/hw_random/stm32-rng.c | 9

[PATCH 0/2] Fix stm32-rng for default state and suspend

2018-04-23 Thread Lionel Debieve
This series are fixing the default build state for stm32-rng that activate the driver with arm multi_v7_defconfig. Second patch is fixing the power suspend/resume behavior which was not working. Lionel Debieve (2): hwrng: stm32 - define default state for rng driver hwrng: stm32-rng: Fix

[PATCH 1/2] hwrng: stm32 - define default state for rng driver

2018-04-23 Thread Lionel Debieve
Define default state for stm32_rng driver. It will be default selected with multi_v7_defconfig Signed-off-by: Lionel Debieve --- drivers/char/hw_random/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/char/hw_random/Kconfig b/drivers/char/hw_random/Kconfig index d53541e96bee

[Bug] STM32 crc driver failed on selftest 1

2019-03-21 Thread Lionel DEBIEVE
Hi All, I'm looking further to debug an issue regarding CRC32 selftests. I'm currently blocked on an issue about the second test vector implemented on CRC32: static const struct hash_testvec crc32_tv_template[] = {     {         .plaintext = "abcdefg",         .psize = 7,         .digest =

Re: [PATCH 21/24] crypto: stm32 - Forbid 2-key 3DES in FIPS mode

2019-04-12 Thread Lionel DEBIEVE
rification. Is there any plan to do the same factorization on des key check? Regarding this patch, ok for me. - Lionel Acked-by: Lionel Debieve Tested-by: Lionel Debieve

Re: [PATCH 21/24] crypto: stm32 - Forbid 2-key 3DES in FIPS mode

2019-04-15 Thread Lionel DEBIEVE
On 4/13/19 3:50 PM, Herbert Xu wrote: > On Fri, Apr 12, 2019 at 01:36:44PM +0000, Lionel DEBIEVE wrote: >> I was currently going to send patches around des and tdes key verification. >> Is there any plan >> to do the same factorization on des key check? > If you have the

[PATCH 1/1] crypto: stm32/crc32 - rename driver file

2019-06-28 Thread Lionel Debieve
Use the same naming convention for all stm32 crypto drivers. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/Makefile | 2 +- drivers/crypto/stm32/{stm32_crc32.c => stm32-crc32.c} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename drivers/crypto/st

[PATCH 0/2] crypto: stm32/hash: Fix bug in hmac mode

2019-06-28 Thread Lionel Debieve
This series fixes issues discovered while using libkcapi library. Some more tests show wrong key management in hmac mode. It is fixes by these patches and prevent a potential issue in case of interrupt while processing in dma mode. Lionel Debieve (2): crypto: stm32/hash: Fix hmac issue more

[PATCH 1/2] crypto: stm32/hash: Fix hmac issue more than 256 bytes

2019-06-28 Thread Lionel Debieve
Correct condition for the second hmac loop. Key must be only set in the first loop. Initial condition was wrong, HMAC_KEY flag was not properly checked. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 2/2] crypto: stm32/hash: remove interruptible condition for dma

2019-06-28 Thread Lionel Debieve
When DMA is used, waiting for completion must not be interruptible as it can generate an error that is not handle by the driver. There is no need to put the completion interruptible in this driver. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 4 ++-- 1 file changed, 2

[PATCH 2/3] crypto: stm32/hash - Add power management support

2018-06-26 Thread Lionel Debieve
Adding pm and pm_runtime support to STM32 HASH. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-hash.c | 71 +++ 1 file changed, 71 insertions(+) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index cdc96f1

[PATCH 1/3] crypto: stm32/cryp - Add power management support

2018-06-26 Thread Lionel Debieve
Adding pm and pm_runtime support to STM32 CRYP. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32-cryp.c | 62 +++ 1 file changed, 62 insertions(+) diff --git a/drivers/crypto/stm32/stm32-cryp.c b/drivers/crypto/stm32/stm32-cryp.c index c5d3efc

[PATCH 0/3] crypto: stm32 - Add power mamagement support

2018-06-26 Thread Lionel Debieve
This set of patches add pm and pm_runtime feature to stm32 crypto drivers. Lionel Debieve (3): crypto: stm32/cryp - Add power management support crypto: stm32/hash - Add power management support crypto: stm32/crc - Add power management support drivers/crypto/stm32/stm32-cryp.c | 62

[PATCH 3/3] crypto: stm32/crc - Add power management support

2018-06-26 Thread Lionel Debieve
Adding pm and pm_runtime support to STM32 CRC. Signed-off-by: Lionel Debieve --- drivers/crypto/stm32/stm32_crc32.c | 62 ++ 1 file changed, 62 insertions(+) diff --git a/drivers/crypto/stm32/stm32_crc32.c b/drivers/crypto/stm32/stm32_crc32.c index 8f09b84