On Mon, Sep 01, 2025 at 03:42:19AM +0200, [email protected] wrote:
> 
> Hi,
> 
> > 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.
> 
> This is really useful! I was able to get the decryption time from 17 s to 9 s 
> for my case after cherry-picking this patch series onto 
> https://lists.gnu.org/archive/html/grub-devel/2025-08/msg00226.html.
> 
Thanks for testing the patch. Since you mentioned SHA512 below, you
are likely using PBKDF2. The Argon2 patches are not necessary in your use
case.
 
> I also had to make some small changes to fix some build errors (since your 
> patch series seems to be for emu, but I am building for efi 64/my native 
> machine) and to include SHA512 optimizations since that's what my partition 
> uses. They're at 
> https://codeberg.org/ljchiu/grub/src/branch/libgcrypt-1.11.0-argon2-hw-accel-upstream;
>  my changes are quite hacky, but I was able to get them to work--hopefully 
> this is useful to anyone else who wants to hasten their decryption times 
> considerably! I was also considering porting the Rijndael optimizations too, 
> but it seems quite nontrivial; nevertheless I'm satisfied with what I have, 
> thank you!
> 
I'm working on the HW acceleration patches to enable them on x86_64 EFI
and planning to submit them soon. I'll start with SHA256 only but you
still can easily add SHA512 asm files.

On the other hand, you could also try my PBKDF2 optimization patches:
https://lists.gnu.org/archive/html/grub-devel/2025-08/msg00080.html

Combining with the HW acceleration patches, the decryption time can be
reduced to a reasonably low number.

Gary Lin

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

Reply via email to