All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/5] Support Argon2 KDF in LUKS2
@ 2020-03-10 18:58 Patrick Steinhardt
  2020-03-10 18:58 ` [PATCH v3 1/5] efi: Always try to allocate heap size of 1.6GB Patrick Steinhardt
                   ` (5 more replies)
  0 siblings, 6 replies; 41+ messages in thread
From: Patrick Steinhardt @ 2020-03-10 18:58 UTC (permalink / raw)
  To: grub-devel
  Cc: Patrick Steinhardt, Daniel Kiper, Leif Lindholm, agraf, pjones,
	mjg59, phcoder, Milan Broz

Hi,

this is the third version of my patchset to support the Argon2 KDF in
LUKS2. The following things have changed in comparison to v2:

    - Improved the GRUB_UINT_C macros to not use `elif 1` and fixed
      indentation.

    - Dropped the upstreamed patch to fix a missing newline.

    - Reworked how we allocate memory on EFI. Previously, we always
      targeted to acquire 1/4 of available memory. Now we're always
      trying to allocate MAX_HEAP_SIZE (1.6GB) but clamp it to at most
      1/2 of available memory and at least MIN_HEAP_SIZE (100MB).

So especially the last part is the interesting one. I _think_ that it's
roughly what Leif had in mind, but please do correct me if I'm wrong.

Regards
Patrick

Patrick Steinhardt (5):
  efi: Always try to allocate heap size of 1.6GB
  types.h: add UINT-related macros needed for Argon2
  argon2: Import Argon2 from cryptsetup
  luks2: Discern Argon2i and Argon2id
  luks2: Support key derival via Argon2

 Makefile.util.def                             |   6 +-
 docs/grub-dev.texi                            |  64 +++
 grub-core/Makefile.core.def                   |  10 +-
 grub-core/disk/luks2.c                        |  26 +-
 grub-core/kern/efi/mm.c                       |  21 +-
 grub-core/lib/argon2/argon2.c                 | 232 ++++++++
 grub-core/lib/argon2/argon2.h                 | 264 +++++++++
 grub-core/lib/argon2/blake2/blake2-impl.h     | 151 +++++
 grub-core/lib/argon2/blake2/blake2.h          |  89 +++
 grub-core/lib/argon2/blake2/blake2b.c         | 388 +++++++++++++
 .../lib/argon2/blake2/blamka-round-ref.h      |  56 ++
 grub-core/lib/argon2/core.c                   | 525 ++++++++++++++++++
 grub-core/lib/argon2/core.h                   | 228 ++++++++
 grub-core/lib/argon2/ref.c                    | 190 +++++++
 include/grub/types.h                          |   8 +
 15 files changed, 2239 insertions(+), 19 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
 create mode 100644 grub-core/lib/argon2/core.c
 create mode 100644 grub-core/lib/argon2/core.h
 create mode 100644 grub-core/lib/argon2/ref.c

Range-diff against v2:
1:  15bdf830e < -:  --------- efi: Allocate half of available memory by default
-:  --------- > 1:  c783f34d7 efi: Always try to allocate heap size of 1.6GB
2:  e81db7d95 ! 2:  724713a8b types.h: add UINT-related macros needed for Argon2
    @@ include/grub/types.h: typedef grub_int32_t	grub_ssize_t;
      #endif
      # define GRUB_LONG_MIN (-GRUB_LONG_MAX - 1)
      
    -+# define GRUB_UINT32_C(x) x ## U
    -+# if GRUB_ULONG_MAX >> 31 >> 31 >> 1 == 1
    -+#  define GRUB_UINT64_C(x) x##UL
    -+# elif 1
    -+#  define GRUB_UINT64_C(x) x##ULL
    -+# endif
    ++#define GRUB_UINT32_C(x) x ## U
    ++#if GRUB_ULONG_MAX >> 31 >> 31 >> 1 == 1
    ++# define GRUB_UINT64_C(x) x##UL
    ++#else
    ++# define GRUB_UINT64_C(x) x##ULL
    ++#endif
     +
      typedef grub_uint64_t grub_properly_aligned_t;
      
3:  50aff9670 ! 3:  eadc4bcd8 argon2: Import Argon2 from cryptsetup
    @@ docs/grub-dev.texi: GRUB includes some code from other projects, and it is somet
     +* Argon2::
      * Gnulib::
      * jsmn::
    + * minilzo::
      @end menu
      
     +@node Argon2
4:  af3f85665 < -:  --------- luks2: Add missing newline to debug message
5:  89abe827b ! 4:  61bc6c0e5 luks2: Discern Argon2i and Argon2id
    @@ Commit message
         accordingly.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
    +    Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
     
      ## grub-core/disk/luks2.c ##
     @@ grub-core/disk/luks2.c: GRUB_MOD_LICENSE ("GPLv3+");
6:  70a354e0b ! 5:  012e3d442 luks2: Support key derival via Argon2
    @@ Commit message
         now trivial.
     
         Signed-off-by: Patrick Steinhardt <ps@pks.im>
    +    Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
     
      ## Makefile.util.def ##
     @@ Makefile.util.def: AutoGen definitions Makefile.tpl;
-- 
2.25.1



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

end of thread, other threads:[~2021-08-08 15:03 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-10 18:58 [PATCH v3 0/5] Support Argon2 KDF in LUKS2 Patrick Steinhardt
2020-03-10 18:58 ` [PATCH v3 1/5] efi: Always try to allocate heap size of 1.6GB Patrick Steinhardt
2020-03-13 12:42   ` Daniel Kiper
2020-03-13 12:55   ` Leif Lindholm
2020-03-13 13:59     ` Daniel Kiper
2020-03-15 14:01       ` Patrick Steinhardt
2020-03-15 10:14     ` Patrick Steinhardt
2020-03-15 10:41     ` Patrick Steinhardt
2020-03-10 18:58 ` [PATCH v3 2/5] types.h: add UINT-related macros needed for Argon2 Patrick Steinhardt
2020-03-13 12:49   ` Daniel Kiper
2020-03-10 18:58 ` [PATCH v3 3/5] argon2: Import Argon2 from cryptsetup Patrick Steinhardt
2020-03-10 20:44   ` Eli Schwartz
2020-03-10 21:42     ` Patrick Steinhardt
2020-03-13 13:13   ` Daniel Kiper
2020-03-16 17:21     ` Daniel Kiper
2020-03-16 17:52       ` Patrick Steinhardt
2020-03-16 20:03         ` Daniel Kiper
2020-03-17  5:51           ` Patrick Steinhardt
2020-03-17 10:45             ` Leif Lindholm
2020-03-16 19:57       ` Konrad Rzeszutek Wilk
2020-03-18 11:52         ` Patrick Steinhardt
2021-01-19  0:07   ` Petr Vorel
2021-01-19 11:10     ` Dmitry
2021-01-19 13:06       ` Petr Vorel
2021-01-19 15:42         ` Matt Turner
2021-01-19 19:03         ` Patrick Steinhardt
2021-01-19 19:31           ` Petr Vorel
2021-01-21 14:49             ` IS: GRUB release cycle: WAS: " Daniel Kiper
2021-01-21 21:30               ` Petr Vorel
2021-01-26 13:00                 ` Daniel Kiper
2021-01-26 19:57                   ` Petr Vorel
2021-08-08 13:58   ` [PATCH v4 0/5] Support Argon2 KDF in LUKS2 Patrick Steinhardt
2021-08-08 13:58     ` [PATCH v4 1/5] kern: dl: Allow modules under CC0 license Patrick Steinhardt
2021-08-08 15:03       ` Petr Vorel
2021-08-08 13:58     ` [PATCH v4 2/5] types.h: Add UINT-related macros needed for Argon2 Patrick Steinhardt
2021-08-08 13:58     ` [PATCH v4 3/5] argon2: Import reference implementation of Argon2 Patrick Steinhardt
2021-08-08 13:58     ` [PATCH v4 4/5] luks2: Discern Argon2i and Argon2id Patrick Steinhardt
2021-08-08 13:59     ` [PATCH v4 5/5] luks2: Support key derival via Argon2 Patrick Steinhardt
2020-03-10 18:58 ` [PATCH v3 4/5] luks2: Discern Argon2i and Argon2id Patrick Steinhardt
2020-03-10 18:58 ` [PATCH v3 5/5] luks2: Support key derival via Argon2 Patrick Steinhardt
2020-03-25 17:12 ` [PATCH v3 0/5] Support Argon2 KDF in LUKS2 Daniel Kiper

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.