Skip to content

RFC Enable libgcrypt HW Acceleration

Gary Lin via Grub-devel grub-devel 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest6 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6tweak autoconf/automake files to detect x86_64 featuresconf/Makefile.common configure.ac include/grub/crypto.h+260 -00 replies
2/6Copy the x86_64 optimization filesautogen.sh+7 -00 replies
3/6libgcrypt-grub: implement _gcry_get_hw_features()grub-core/lib/libgcrypt-patches/08_add_hwfeatures.patch+51 -00 replies
4/6Build blake2 and sha256 with x86_64 optimization assembly codegrub-core/lib/libgcrypt-patches/09_build_x86_64_opt_code.patch+80 -00 replies
5/6libgcrypt-grub: fix a typo in blake2.cgrub-core/lib/libgcrypt-patches/10_fix_blake2_typo.patch+28 -00 replies
6/6libgcrypt-grub: fix missing-prototypes error in sha256-intel-shaext.cgrub-core/lib/libgcrypt-patches/11_fix_build_shaext.patch+30 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFC PATCH 0/6] Enable libgcrypt HW Acceleration

Git repo:
https://github.com/lcp/grub2/tree/libgcrypt-1.11.0-argon2-hw-accel-upstream

This patchset is based on Vladimir's libgcrypt 1.11.0 patches.

With the newer libgcrypt code, it's possible to drop the hardware acceleration code into libgcrypt-grub. I managed to build the sha256 and blake2 modules with the available optimization code for grub-emu, and the result looks promising. For a 20MB LUKS2 block with pbkdf2 (sha256), the original decryption time is 10~11 seconds. With intel shaext, it becomes 3~4 seconds.

I also have a tentative implementation for Argon2. With AVX2 support, the decryption time is down from 26 seconds to 20 seconds.

Of course, this patchset is not for any production use yet, but I'd like to demostrate the benefit to upgrade libgcryt!

Gary Lin (6):
tweak autoconf/automake files to detect x86_64 features Copy the x86_64 optimization files
libgcrypt-grub: implement _gcry_get_hw_features()
Build blake2 and sha256 with x86_64 optimization assembly code
libgcrypt-grub: fix a typo in blake2.c
libgcrypt-grub: fix missing-prototypes error in sha256-intel-shaext.c

 autogen.sh                                    |   7 +
 conf/Makefile.common                          |   2 +
 configure.ac                                  | 254 ++++++++++++++++++
 .../libgcrypt-patches/08_add_hwfeatures.patch |  51 ++++
 .../09_build_x86_64_opt_code.patch            |  80 ++++++
 .../10_fix_blake2_typo.patch                  |  28 ++
 .../11_fix_build_shaext.patch                 |  30 +++
 include/grub/crypto.h                         |   4 +
 8 files changed, 456 insertions(+)
 create mode 100644 grub-core/lib/libgcrypt-patches/08_add_hwfeatures.patch
 create mode 100644 grub-core/lib/libgcrypt-patches/09_build_x86_64_opt_code.patch
 create mode 100644 grub-core/lib/libgcrypt-patches/10_fix_blake2_typo.patch
 create mode 100644 grub-core/lib/libgcrypt-patches/11_fix_build_shaext.patch
Signature · 7 lines
2.43.0


_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel