[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v3 0/5] Support Argon2 KDF in LUKS2
From: |
Patrick Steinhardt |
Subject: |
[PATCH v3 0/5] Support Argon2 KDF in LUKS2 |
Date: |
Tue, 10 Mar 2020 19:58:27 +0100 |
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 <address@hidden>
+ Reviewed-by: Daniel Kiper <address@hidden>
## 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 <address@hidden>
+ Reviewed-by: Daniel Kiper <address@hidden>
## Makefile.util.def ##
@@ Makefile.util.def: AutoGen definitions Makefile.tpl;
--
2.25.1