diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2023-05-26 08:37:46 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-05-26 08:50:45 +0200 |
commit | cee3bf7e3e946134228b8397c8e4d50205f7546f (patch) | |
tree | f04bd0e68e815fc7bef9cb4723e585f2f105dff3 /crypto | |
parent | ff6398f0a0199367e054e6a29f7d3a9fbdf28ce6 (diff) | |
download | barebox-cee3bf7e3e946134228b8397c8e4d50205f7546f.tar.gz barebox-cee3bf7e3e946134228b8397c8e4d50205f7546f.tar.xz |
ARM64: crypto: add Crypto Extensions accelerated SHA implementation
This imports the Linux v6.3 state of the ARMv8 Crypto Extensions (CE)
accelerated SHA1/SHA2 routines. This increases hashing rate a tenfold:
sha1-generic: digest(7 bytes) = 11750ns digest(4097 bytes) = 59125ns
sha224-generic: digest(7 bytes) = 12750ns digest(4097 bytes) = 95000ns
sha256-generic: digest(7 bytes) = 2250ns digest(4097 bytes) = 94875ns
sha1-ce: digest(7 bytes) = 2875ns digest(4097 bytes) = 8125ns
sha224-ce: digest(7 bytes) = 3125ns digest(4097 bytes) = 7750ns
sha256-ce: digest(7 bytes) = 750ns digest(4097 bytes) = 7625ns
This shaves 400ms of a FIT image boot that uses sha256 as digest for
the images referenced by the selected configuration:
barebox@imx8mn-old:/ time bootm -d kernel-a
Dryrun. Aborted.
time: 998ms
barebox@imx8mn-new:/ time bootm -d kernel-a
Dryrun. Aborted.
time: 601ms
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230526063746.1155297-8-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/Kconfig | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index f32accb3d0..629f615de1 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -86,6 +86,27 @@ config DIGEST_SHA256_ARM SHA-256 secure hash standard (DFIPS 180-2) implemented using optimized ARM assembler and NEON, when available. +config DIGEST_SHA1_ARM64_CE + tristate "SHA-1 digest algorithm (ARMv8 Crypto Extensions)" + depends on CPU_V8 + select HAVE_DIGEST_SHA1 + help + SHA-1 secure hash algorithm (FIPS 180) + + Architecture: arm64 using: + - ARMv8 Crypto Extensions + +config DIGEST_SHA256_ARM64_CE + tristate "SHA-224/256 digest algorithm (ARMv8 Crypto Extensions)" + depends on CPU_V8 + select HAVE_DIGEST_SHA256 + select HAVE_DIGEST_SHA224 + help + SHA-224 and SHA-256 secure hash algorithms (FIPS 180) + + Architecture: arm64 using: + - ARMv8 Crypto Extensions + endif config CRYPTO_PBKDF2 |