crypto: lib/chacha - strongly type the ChaCha stateThe ChaCha state matrix is 16 32-bit words. Currently it is representedin the code as a raw u32 array, or even just a pointer to u32. Thisweak
crypto: lib/chacha - strongly type the ChaCha stateThe ChaCha state matrix is 16 32-bit words. Currently it is representedin the code as a raw u32 array, or even just a pointer to u32. Thisweak typing is error-prone. Instead, introduce struct chacha_state: struct chacha_state { u32 x[16]; };Convert all ChaCha and HChaCha functions to use struct chacha_state.No functional changes.Signed-off-by: Eric Biggers <ebiggers@google.com>Acked-by: Kent Overstreet <kent.overstreet@linux.dev>Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
show more ...
crypto: lib/chacha - remove unused arch-specific init supportAll implementations of chacha_init_arch() just callchacha_init_generic(), so it is pointless. Just delete it, and replacechacha_init(
crypto: lib/chacha - remove unused arch-specific init supportAll implementations of chacha_init_arch() just callchacha_init_generic(), so it is pointless. Just delete it, and replacechacha_init() with what was previously chacha_init_generic().Signed-off-by: Eric Biggers <ebiggers@google.com>Acked-by: Ard Biesheuvel <ardb@kernel.org>Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
tools/testing/crypto: Use vzalloc instead of vmalloc+memsetThis fixes the corresponding coccinelle warning.Signed-off-by: Siddh Raman Pant <code@siddh.me>Signed-off-by: Harald Freudenberger <fre
tools/testing/crypto: Use vzalloc instead of vmalloc+memsetThis fixes the corresponding coccinelle warning.Signed-off-by: Siddh Raman Pant <code@siddh.me>Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>Link: https://lore.kernel.org/r/20220627075148.140705-1-code@siddh.me[agordeev@linux.ibm.com added Link]Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
crypto: s390 - add crypto library interface for ChaCha20Implement a crypto library interface for the s390-native ChaCha20 cipheralgorithm. This allows us to stop to select CRYPTO_CHACHA20 and inst
crypto: s390 - add crypto library interface for ChaCha20Implement a crypto library interface for the s390-native ChaCha20 cipheralgorithm. This allows us to stop to select CRYPTO_CHACHA20 and insteadselect CRYPTO_ARCH_HAVE_LIB_CHACHA. This allows BIG_KEYS=y not to builda whole ChaCha20 crypto infrastructure as a built-in, but build a smallerCRYPTO_LIB_CHACHA instead.Make CRYPTO_CHACHA_S390 config entry to look like similar ones on otherarchitectures. Remove CRYPTO_ALGAPI select as anyway it is selected byCRYPTO_SKCIPHER.Add a new test module and a test script for ChaCha20 cipher and itsinterfaces. Here are test results on an idle z15 machine:Data | Generic crypto TFM | s390 crypto TFM | s390 libsize | enc dec | enc dec | enc dec-----+--------------------+------------------+----------------512b | 1545ns 1295ns | 604ns 446ns | 430ns 407ns4k | 9536ns 9463ns | 2329ns 2174ns | 2170ns 2154ns64k | 149.6us 149.3us | 34.4us 34.5us | 33.9us 33.1us6M | 23.61ms 23.11ms | 4223us 4160us | 3951us 4008us60M | 143.9ms 143.9ms | 33.5ms 33.2ms | 32.2ms 32.1msSigned-off-by: Vladis Dronov <vdronov@redhat.com>Reviewed-by: Harald Freudenberger <freude@linux.ibm.com>Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>