Re: Does the SPARC optimized crypto and CRC code actually work?

Nathaniel Roach <[email protected]>
Newsgroups gmane.linux.ports.sparc,gmane.linux.kernel.cryptoapi
Message-ID <[email protected]>
On 17/3/26 15:16, John Paul Adrian Glaubitz wrote:
> Hi Eric,
>
> On Tue, 2026-03-17 at 03:45 +0000, Eric Biggers wrote:
>> On Tue, Mar 17, 2026 at 10:48:52AM +0800, Nathaniel Roach wrote:
>>> I've been testing some of the PCI changes that have come through on my T5-2.
>>> I'll happily add some tests for the crypto functions, I've just got no idea
>>> how to do so.
>> Well, try enabling all KUnit tests in lib/crc/ and lib/crypto/, as well
>> as CONFIG_CRYPTO_SELFTESTS=y and CONFIG_CRYPTO_SELFTESTS_FULL=y.
>>
>> However, will this be a regular testing run, or only a one-off run?  If
>> it will only be one-off, we'll quickly be back to where we started.
>>
>> We need regular testing on either hardware or QEMU.
> If Nathaniel can test the code from time to time for the time being, we should
> already get some coverage. In the near future, we could certainly set up a CI
> job if you let me know what infrastructure to use for it.
>
> Please keep in mind that a lot of us are doing this as volunteers and we don't
> always have the possibilities to respond to such requests within a short time.
>
> Feel free to use the sparclinux issue tracker if you want to file any requests:
>
> https://github.com/sparclinux/issues/issues
>
> Adrian
I enabled the below options, based on what I could find, in my test config:

CONFIG_CRYPTO_SELFTESTS=y
CONFIG_CRYPTO_SELFTESTS_FULL=y
CONFIG_CRYPTO_ARIA,BLOWFISH,CAMELLIA,CAST5,CAST6,DES,FCRYPT,SERPENT,
   SM4_GENERIC,TWOFISH,CTR=m
CONFIG_CRC_KUNIT_TEST=m
CONFIG_CRC_BENCHMARK=y
CONFIG_CRYPTO_LIB_BENCHMARK=y
CONFIG_DEBUG_MEMORY_INIT=y
CONFIG_KUNIT=m

This is what looks to be the relevant parts of dmesg:

# dmesg | grep -i 'crypt\|rng\|aes\|alg:\|opcode'
[    2.191836] CPU CAPS: [hpc,ima,pause,cbcond,aes,des,kasumi,camellia]
[    7.090965] Using sparc64 crc32c opcode optimized CRC32C implementation
[    7.090974] Using sparc64 sha256 opcode optimized SHA-256/SHA-224 
implementation
[    7.090979] Using sparc64 sha512 opcode optimized SHA-512/SHA-384 
implementation
[    7.235616] alg: full crypto tests enabled.  This is intended for 
developer use only.
[   20.488863] random: crng init done
[   20.525724] n2rng v0.3 (Jan 7, 2017)
[   20.525746] n2rng f029b448: Registered RNG HVAPI major 2 minor 0
[   20.525758] n2rng f029b448: Found multi-unit-capable RNG, units: 2
[   20.526479] aes_sparc64: Using sparc64 aes opcodes optimized AES 
implementation
[   20.527437] des_sparc64: Using sparc64 des opcodes optimized DES 
implementation
[   20.528391] camellia_sparc64: Using sparc64 camellia opcodes 
optimized CAMELLIA implementation
[   20.529874] n2rng f029b448: Selftest passed on unit 0
[   20.532270] n2rng f029b448: Selftest passed on unit 1
[   20.532315] n2rng f029b448: RNG ready

Is this sufficient to know if it's correct, or are more tests needed?

Cheers,
Nathaniel.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.