All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Support Argon2 KDF in LUKS2
@ 2020-02-06 14:27 Patrick Steinhardt
  2020-02-06 14:27 ` [PATCH 1/5] efi: Allocate half of available memory by default Patrick Steinhardt
                   ` (6 more replies)
  0 siblings, 7 replies; 32+ messages in thread
From: Patrick Steinhardt @ 2020-02-06 14:27 UTC (permalink / raw)
  To: grub-devel; +Cc: Patrick Steinhardt, Daniel Kiper

Hi,

as promised back when LUKS2 support was merged, here's the code that
enables decrypting LUKS2 partitions that use Argon2 as their key derival
function. Most of this is simple legwork, but I expect two things to be
potentially controversial:

    - I've changed how EFI allocates memory. On my test systems, I was
      only able to allocate roughly 800MB, which isn't enough for the
      default of 1GB memory parameter that cryptsetup uses with Argon2.
      Instead of taking a quarter of available memory, we now take half
      of it, which amounts to ~1.6GB on 32 bit systems.

    - The import of Argon2 itself. I've imported code from the
      cryptsetup project, but I've modified it quite a bit to fit into
      GRUB's codebase. This included both stripping off unneeded
      functionality as well as converting the code to use our own coding
      style. While it makes importing upstream fixes harder, I'd argue
      the code is still very similar in its structure and thus
      backporting should be easy enough.

Anyway. With these changes I'm able to successfully decrypt LUKS2
partitions making use of either PBKDF2, Argon2i or Argon2id.

Regards
Patrick

Patrick Steinhardt (5):
  efi: Allocate half of available memory by default
  argon2: Import Argon2 from cryptsetup
  disk: luks2: Add missing newline to debug message
  disk: luks2: Discern Argon2i and Argon2id
  disk: luks2: Support key derival via Argon2

 Makefile.util.def                             |   4 +-
 grub-core/Makefile.core.def                   |   8 +-
 grub-core/disk/luks2.c                        |  29 +-
 grub-core/kern/efi/mm.c                       |   4 +-
 grub-core/lib/argon2/argon2.c                 | 614 ++++++++++++++++++
 grub-core/lib/argon2/argon2.h                 |  65 ++
 grub-core/lib/argon2/blake2/blake2-impl.h     | 143 ++++
 grub-core/lib/argon2/blake2/blake2.h          |  81 +++
 grub-core/lib/argon2/blake2/blake2b.c         | 384 +++++++++++
 .../lib/argon2/blake2/blamka-round-ref.h      |  56 ++
 10 files changed, 1376 insertions(+), 12 deletions(-)
 create mode 100644 grub-core/lib/argon2/argon2.c
 create mode 100644 grub-core/lib/argon2/argon2.h
 create mode 100644 grub-core/lib/argon2/blake2/blake2-impl.h
 create mode 100644 grub-core/lib/argon2/blake2/blake2.h
 create mode 100644 grub-core/lib/argon2/blake2/blake2b.c
 create mode 100644 grub-core/lib/argon2/blake2/blamka-round-ref.h

-- 
2.25.0



^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2020-02-21 14:29 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-06 14:27 [PATCH 0/5] Support Argon2 KDF in LUKS2 Patrick Steinhardt
2020-02-06 14:27 ` [PATCH 1/5] efi: Allocate half of available memory by default Patrick Steinhardt
2020-02-13 11:47   ` Leif Lindholm
2020-02-20 19:29     ` Patrick Steinhardt
2020-02-06 14:27 ` [PATCH 2/5] argon2: Import Argon2 from cryptsetup Patrick Steinhardt
2020-02-08 11:30   ` Milan Broz
2020-02-08 22:25     ` Patrick Steinhardt
2020-02-06 14:27 ` [PATCH 3/5] disk: luks2: Add missing newline to debug message Patrick Steinhardt
2020-02-11 21:36   ` Daniel Kiper
2020-02-12  7:48     ` Patrick Steinhardt
2020-02-06 14:27 ` [PATCH 4/5] disk: luks2: Discern Argon2i and Argon2id Patrick Steinhardt
2020-02-06 14:27 ` [PATCH 5/5] disk: luks2: Support key derival via Argon2 Patrick Steinhardt
2020-02-11 21:53 ` [PATCH 0/5] Support Argon2 KDF in LUKS2 Daniel Kiper
2020-02-12  7:18   ` Milan Broz
2020-02-20 19:34     ` Patrick Steinhardt
2020-02-12  7:47   ` Patrick Steinhardt
2020-02-13 11:42     ` Daniel Kiper
2020-02-20 14:50       ` Patrick Steinhardt
2020-02-20 18:00 ` [PATCH v2 0/6] " Patrick Steinhardt
2020-02-20 18:00   ` [PATCH v2 1/6] efi: Allocate half of available memory by default Patrick Steinhardt
2020-02-20 18:00   ` [PATCH v2 2/6] types.h: add UINT-related macros needed for Argon2 Patrick Steinhardt
2020-02-21 12:34     ` Daniel Kiper
2020-02-20 18:00   ` [PATCH v2 3/6] argon2: Import Argon2 from cryptsetup Patrick Steinhardt
2020-02-21 12:39     ` Daniel Kiper
2020-02-20 18:00   ` [PATCH v2 4/6] luks2: Add missing newline to debug message Patrick Steinhardt
2020-02-20 18:00   ` [PATCH v2 5/6] luks2: Discern Argon2i and Argon2id Patrick Steinhardt
2020-02-21 12:54     ` Daniel Kiper
2020-02-20 18:00   ` [PATCH v2 6/6] luks2: Support key derival via Argon2 Patrick Steinhardt
2020-02-21 13:03     ` Daniel Kiper
2020-02-20 18:38   ` [PATCH v2 0/6] Support Argon2 KDF in LUKS2 Leif Lindholm
2020-02-21 12:26   ` Daniel Kiper
2020-02-21 14:29     ` Patrick Steinhardt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.