Support Argon2 KDF in LUKS2
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest5 patches 28 repliesIn review
- v26 patches 7 repliesSuperseded
- v15 patches 12 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/5 | efi: Always try to allocate heap size of 1.6GBgrub-core/ | +11 | 6 replies | |
| 2/5 | types.h: add UINT-related macros needed for Argon2include/ | +8 | 1 reply | |
| 3/5 | argon2: Import Argon2 from cryptsetupdocs/ grub-core/ grub-core/ +8 more | +2195 | 27 replies | |
| 4/5 | luks2: Discern Argon2i and Argon2idgrub-core/ | +8 | 0 replies | |
| 5/5 | luks2: Support key derival via Argon2Makefile.util.def grub-core/ grub-core/ | +17 | 0 replies |
Reviews trailers per patch
4 of 5 patches have a Reviewed-by or Acked-by.
| Patch | Daniel Kiper | Petr Vorel |
|---|---|---|
| 1/5 | ||
| 2/5 | R-b | |
| 3/5 | R-b | |
| 4/5 | R-b | |
| 5/5 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/5] Support Argon2 KDF in LUKS2
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.
+ Reviewed-by: Daniel Kiper <[email protected]>
## 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.
+ Reviewed-by: Daniel Kiper <[email protected]>
## Makefile.util.def ##
@@ Makefile.util.def: AutoGen definitions Makefile.tpl;
Signature · 1 line
2.25.1