Re: [PATCH v3 05/10] crypto: riscv - add vector crypto accelerated ChaCha20

From: Yangyu Chen
Date: Fri Apr 12 2024 - 04:38:21 EST


On 2024/1/22 08:19, Eric Biggers wrote:> From: Jerry Shih <jerry.shih@xxxxxxxxxx>
>
> Add an implementation of ChaCha20 using the Zvkb extension. The
> assembly code is derived from OpenSSL code (openssl/openssl#21923) that
> was dual-licensed so that it could be reused in the kernel.
> Nevertheless, the assembly has been significantly reworked for
> integration with the kernel, for example by using a regular .S file
> instead of the so-called perlasm, using the assembler instead of bare
> '.inst', and reducing code duplication.
>
> Signed-off-by: Jerry Shih <jerry.shih@xxxxxxxxxx>
> Co-developed-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> Signed-off-by: Eric Biggers <ebiggers@xxxxxxxxxx>
> ---

Hi, Jerry Shih and Eric Biggers,

Since this implementation is derived from OpenSSL, I have an issue on
OpenSSL about this chacha20 implementation using Zvkb [1] and see a fixes
PR by Jerry Shih [2].

I wonder will kernel need to port those fixes to handle the non-multiple
block length of the chacha20 cipher? If yes, we should port it immediately
to catch up with the v6.9 release if we can.

[1] https://github.com/openssl/openssl/issues/24070
[2] https://github.com/openssl/openssl/pull/24097

Thanks,
Yangyu Chen