Message ID | 20241015141514.3000757-4-ardb+git@google.com (mailing list archive) |
---|---|
Headers | show |
Series | crypto: Enable fuzz testing for generic crc32/crc32c | expand |
On Tue, Oct 15, 2024 at 04:15:15PM +0200, Ard Biesheuvel wrote: > From: Ard Biesheuvel <ardb@kernel.org> > > crc32-generic and crc32c-generic are built around the architecture > library code for CRC-32, and the lack of distinct drivers for this arch > code means they are lacking test coverage. > > Fix this by providing another, truly generic driver built on top of the > generic C code when fuzz testing is enabled. Wouldn't it make more sense to make crc32-generic actually be the generic implementation, and add crc32-arm64 and crc32-riscv? Likewise for crc32c. That is the usual way that the algorithms get wired up. Even if we take a shortcut and don't do that, the naming could at least be more consistent, e.g. rename the existing crc32-generic to crc32-lib and add crc32-generic alongside that. - Eric
On Tue, Oct 15, 2024 at 07:20:51PM -0700, Eric Biggers wrote: > > Wouldn't it make more sense to make crc32-generic actually be the generic > implementation, and add crc32-arm64 and crc32-riscv? Likewise for crc32c. That > is the usual way that the algorithms get wired up. Agreed. The library interface can expose the optimal algorithm, but the Crypto API should not expose the library interface and should instead hook directly to the C implementation. Thanks,
From: Ard Biesheuvel <ardb@kernel.org> crc32-generic and crc32c-generic are built around the architecture library code for CRC-32, and the lack of distinct drivers for this arch code means they are lacking test coverage. Fix this by providing another, truly generic driver built on top of the generic C code when fuzz testing is enabled. Ard Biesheuvel (2): crypto/crc32: Provide crc32-base alias to enable fuzz testing crypto/crc32c: Provide crc32c-base alias to enable fuzz testing crypto/crc32_generic.c | 73 ++++++++++++++------ crypto/crc32c_generic.c | 72 +++++++++++++------ crypto/testmgr.c | 2 + 3 files changed, 103 insertions(+), 44 deletions(-)