Skip to content

Commit

Permalink
Dilithum, Kyber: Update to final specification
Browse files Browse the repository at this point in the history
FIPS 203 and FIPS 204 final specification changes.
  • Loading branch information
SparkiDev committed Aug 26, 2024
1 parent 8b57e3e commit cf7be6c
Show file tree
Hide file tree
Showing 16 changed files with 17,787 additions and 11,139 deletions.
10 changes: 4 additions & 6 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1240,8 +1240,8 @@ do
1024)
ENABLED_KYBER1024=yes
;;
ml-kem)
ENABLED_ML_KEM=yes
original)
ENABLED_ORIGINAL=yes
;;
*)
AC_MSG_ERROR([Invalid choice for KYBER []: $ENABLED_KYBER.])
Expand All @@ -1251,7 +1251,6 @@ done

if test "$ENABLED_KYBER" != "no"
then
AS_IF([ test "$ENABLED_EXPERIMENTAL" != "yes" ],[ AC_MSG_ERROR([KYBER requires --enable-experimental.]) ])
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_HAVE_KYBER"
# Use liboqs if specified.
if test "$ENABLED_LIBOQS" = "no"; then
Expand All @@ -1269,8 +1268,8 @@ then
if test "$ENABLED_KYBER1024" = ""; then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_KYBER1024"
fi
if test "$ENABLED_ML_KEM" = "yes"; then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_ML_KEM"
if test "$ENABLED_ORIGINAL" = "yes"; then
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_KYBER_ORIGINAL"
fi

if test "$ENABLED_WC_KYBER" = "yes"
Expand Down Expand Up @@ -1346,7 +1345,6 @@ done

if test "$ENABLED_DILITHIUM" != "no"
then
AS_IF([ test "$ENABLED_EXPERIMENTAL" != "yes" ],[ AC_MSG_ERROR([DILITHIUM requires --enable-experimental.]) ])
AM_CFLAGS="$AM_CFLAGS -DHAVE_DILITHIUM"

if test "$ENABLED_MLDSA44" = ""; then
Expand Down
22,028 changes: 13,253 additions & 8,775 deletions tests/api.c

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions wolfcrypt/benchmark/benchmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -685,6 +685,11 @@
#define BENCH_KYBER1024 0x00000080
#define BENCH_KYBER (BENCH_KYBER512 | BENCH_KYBER768 | \
BENCH_KYBER1024)
#define BENCH_ML_KEM_512 0x00000020
#define BENCH_ML_KEM_768 0x00000040
#define BENCH_ML_KEM_1024 0x00000080
#define BENCH_ML_KEM (BENCH_ML_KEM_512 | BENCH_ML_KEM_768 | \
BENCH_ML_KEM_1024)
#define BENCH_FALCON_LEVEL1_SIGN 0x00000001
#define BENCH_FALCON_LEVEL5_SIGN 0x00000002
#define BENCH_DILITHIUM_LEVEL2_SIGN 0x04000000
Expand Down Expand Up @@ -1087,6 +1092,10 @@ static const bench_pq_alg bench_pq_asym_opt[] = {
{ "-kyber512", BENCH_KYBER512 },
{ "-kyber768", BENCH_KYBER768 },
{ "-kyber1024", BENCH_KYBER1024 },
{ "-ml-kem", BENCH_ML_KEM },
{ "-ml-kem-512", BENCH_ML_KEM_512 },
{ "-ml-kem-768", BENCH_ML_KEM_768 },
{ "-ml-kem-1024", BENCH_ML_KEM_1024 },
#endif
#if defined(HAVE_FALCON)
{ "-falcon_level1", BENCH_FALCON_LEVEL1_SIGN },
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/aes_gcm_asm.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; /* aes_gcm_asm.asm */
; /*
; * Copyright (C) 2006-2024 wolfSSL Inc.
; * Copyright (C) 2006-2024 wolfSSL Inc.
; *
; * This file is part of wolfSSL.
; *
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/aes_xts_asm.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; /* aes_xts_asm.asm */
; /*
; * Copyright (C) 2006-2024 wolfSSL Inc.
; * Copyright (C) 2006-2024 wolfSSL Inc.
; *
; * This file is part of wolfSSL.
; *
Expand Down
2 changes: 1 addition & 1 deletion wolfcrypt/src/chacha_asm.asm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
; /* chacha_asm.asm */
; /*
; * Copyright (C) 2006-2024 wolfSSL Inc.
; * Copyright (C) 2006-2024 wolfSSL Inc.
; *
; * This file is part of wolfSSL.
; *
Expand Down
Loading

0 comments on commit cf7be6c

Please sign in to comment.