Skip to content

Commit a975ca5

Browse files
committed
Add SLH-DSA-Ascon-128[s|f]
Signed-off-by: Stephan Mueller <smueller@chronox.de>
1 parent 6b2235b commit a975ca5

28 files changed

+3637
-12
lines changed

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Changes 1.3.0-prerelease
1717

1818
* Add optional Jitter RNG entropy source
1919

20+
* Add SLH-DSA-Ascon-128[s|f]
21+
2022
Changes 1.2.0
2123
* Locking für seeded_rng added to avoid requiring the caller providing a lock
2224

TODO

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@
2525

2626
- RISCV asm: check whether it works for RISCV32
2727

28+
- Add SLH-DSA-Ascon to Linux kernel

linux_kernel/lc_sphincs_shake_128f.h.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the Dilithium security strength
22
{gsub("@sphincs_strength@", "17088", $0) ;
3+
gsub("@sphincs_hash@", "lc_shake256", $0) ;
34
gsub("@sphincs_name@", "lc_sphincs_shake_128f", $0) ;
45
gsub("@sphincs_header@", "SHAKE_128F_", $0) ;
56

linux_kernel/lc_sphincs_shake_128s.h.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the Dilithium security strength
22
{gsub("@sphincs_strength@", "7856", $0) ;
3+
gsub("@sphincs_hash@", "lc_shake256", $0) ;
34
gsub("@sphincs_name@", "lc_sphincs_shake_128s", $0) ;
45
gsub("@sphincs_header@", "SHAKE_128S_", $0) ;
56

linux_kernel/lc_sphincs_shake_192f.h.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the Dilithium security strength
22
{gsub("@sphincs_strength@", "35664", $0) ;
3+
gsub("@sphincs_hash@", "lc_shake256", $0) ;
34
gsub("@sphincs_name@", "lc_sphincs_shake_192f", $0) ;
45
gsub("@sphincs_header@", "SHAKE_192F_", $0) ;
56

linux_kernel/lc_sphincs_shake_192s.h.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the Dilithium security strength
22
{gsub("@sphincs_strength@", "16224", $0) ;
3+
gsub("@sphincs_hash@", "lc_shake256", $0) ;
34
gsub("@sphincs_name@", "lc_sphincs_shake_192s", $0) ;
45
gsub("@sphincs_header@", "SHAKE_192S_", $0) ;
56

linux_kernel/lc_sphincs_shake_256f.h.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the Dilithium security strength
22
{gsub("@sphincs_strength@", "49856", $0) ;
3+
gsub("@sphincs_hash@", "lc_shake256", $0) ;
34
gsub("@sphincs_name@", "lc_sphincs_shake_256f", $0) ;
45
gsub("@sphincs_header@", "SHAKE_256F_", $0) ;
56

linux_kernel/lc_sphincs_shake_256s.h.awk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Set the Dilithium security strength
22
{gsub("@sphincs_strength@", "29792", $0) ;
3+
gsub("@sphincs_hash@", "lc_shake256", $0) ;
34
gsub("@sphincs_name@", "lc_sphincs_shake_256s", $0) ;
45
gsub("@sphincs_header@", "SHAKE_256S_", $0) ;
56

meson.build

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,9 @@ if (get_option('sphincs_shake_256s').enabled() or
150150
get_option('sphincs_shake_192s').enabled() or
151151
get_option('sphincs_shake_192f').enabled() or
152152
get_option('sphincs_shake_128s').enabled() or
153-
get_option('sphincs_shake_128f').enabled())
153+
get_option('sphincs_shake_128f').enabled() or
154+
get_option('slh_dsa_ascon_128s').enabled() or
155+
get_option('slh_dsa_ascon_128f').enabled())
154156
add_global_arguments([ '-DLC_SPHINCS' ], language: 'c')
155157
sphincs_enabled = true
156158
endif
@@ -478,6 +480,16 @@ if get_option('sha3').disabled() and get_option('ascon_keccak').enabled()
478480
error('Ascon-Keccak support requires SHA-3')
479481
endif
480482

483+
if (get_option('slh_dsa_ascon_128s').enabled() and
484+
get_option('ascon').disabled())
485+
error('SLH-DSA-Ascon-128s support requires Ascon')
486+
endif
487+
488+
if (get_option('slh_dsa_ascon_128f').enabled() and
489+
get_option('ascon').disabled())
490+
error('SLH-DSA-Ascon-128f support requires Ascon')
491+
endif
492+
481493
if get_option('x509_parser').disabled() and get_option('pkcs7_parser').enabled()
482494
error('PKCS#7 parser support requires X.509 parser support')
483495
endif

meson_options.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ This option enables the Ascon-Keccak 256, and Ascon-Keccak 512 AEAD. Note, this
1919
requires also SHA-3 being enabled.
2020
''')
2121

22+
option('slh_dsa_ascon_128s', type: 'feature', value: 'enabled',
23+
description: '''SLH-DSA-Ascon-128s support
24+
25+
This option enables the SLH-DSA-Ascon-128s support with the same parameters
26+
as SLH-DSA-SHAKE-128s. Note, this requires Ascon being enabled.
27+
''')
28+
29+
option('slh_dsa_ascon_128f', type: 'feature', value: 'enabled',
30+
description: '''SLH-DSA-Ascon-128f support
31+
32+
This option enables the SLH-DSA-Ascon-128f support with the same parameters
33+
as SLH-DSA-SHAKE-128f. Note, this requires Ascon being enabled.
34+
''')
35+
2236
option('chacha20', type: 'feature', value: 'enabled',
2337
description: 'ChaCha20 support')
2438
option('chacha20_drng', type: 'feature', value: 'enabled',

0 commit comments

Comments
 (0)