Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1351302

Re: [PATCH 2/2] crypto: s5p-sss - Handle unaligned buffers

From Krzysztof Kozlowski <k.kozlowski@samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] crypto: s5p-sss - Handle unaligned buffers
Date 2016-03-07 05:10 +0100
Message-ID <r9UEy-6fS-3@gated-at.bofh.it> (permalink)
References <r9DX3-3Ev-3@gated-at.bofh.it> <r9DX3-3Ev-1@gated-at.bofh.it> <r9S9I-4sw-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 07.03.2016 10:28, Vladimir Zapolskiy wrote:
> Hi Krzysztof,
> 
> On 06.03.2016 12:17, Krzysztof Kozlowski wrote:
>> During crypto selftests on Odroid XU3 (Exynos5422) some of the
>> algorithms failed because of passing AES-block unaligned source and
>> destination buffers:
> 
> excuse my ignorance what are the crypto selftests you reference? Are they
> run-time self tests run by crypto manager on algorithm registration?

Yes, these tests. Disabled by CRYPTO_MANAGER_DISABLE_TESTS.

> 
>> alg: skcipher: encryption failed on chunk test 1 for ecb-aes-s5p: ret=22
>>
>> Handle such case by copying the buffers to a new aligned and contiguous
>> space.
> 
> I'm not quite convinced that a particular crypto accelerator driver
> is the right place for this change, at least I don't see in the change
> anything S5P-SSS specific, but it might be good to add the change.

The driver sets a .cra_alignmask but docs are saying that re-alignment
by crypto API might not happen. And in fact for selftets the data was
coming sometimes not-aligned.

On the other hand the CRYPTO_TEST was providing aligned data.

> 
> Briefly looking at other drivers similarly atmel-* and omap-* have
> slow path fallbacks, ./rockchip/rk3288_crypto_ablkcipher.c fails like
> s5p-sss etc.

Yes, I was kind of inspired by the omap solution.

> Anyway since it is a valid improvement, please feel free to add my
> 
> Acked-by: Vladimir Zapolskiy <vz@mleia.com>

Thanks!

Krzysztof
> 
>> Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
>> ---
>>  drivers/crypto/s5p-sss.c | 149 +++++++++++++++++++++++++++++++++++++++++++----
>>  1 file changed, 137 insertions(+), 12 deletions(-)
>>

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] crypto: s5p-sss - Handle unaligned buffers Krzysztof Kozlowski <krzk@kernel.org> - 2016-03-06 11:20 +0100
  Re: [PATCH 2/2] crypto: s5p-sss - Handle unaligned buffers Vladimir Zapolskiy <vz@mleia.com> - 2016-03-07 02:30 +0100
    Re: [PATCH 2/2] crypto: s5p-sss - Handle unaligned buffers Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-03-07 05:10 +0100

csiph-web