Skip to content

Commit 36ab448

Browse files
committed
Merge branch 'main' of github.com:aws/aws-lc into sha3_absorb_squeeze
2 parents 86fa4b0 + c826c21 commit 36ab448

32 files changed

+959
-957
lines changed

crypto/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,6 @@ if(ENABLE_DILITHIUM)
330330
DILITHIUM_SOURCES
331331

332332
evp_extra/p_pqdsa_asn1.c
333-
dilithium/ml_dsa.c
334333
)
335334
endif()
336335

@@ -778,13 +777,13 @@ if(BUILD_TESTING)
778777
ecdh_extra/ecdh_test.cc
779778
dh_extra/dh_test.cc
780779
digest_extra/digest_test.cc
781-
dilithium/p_pqdsa_test.cc
782780
dsa/dsa_test.cc
783781
des/des_test.cc
784782
endian_test.cc
785783
err/err_test.cc
786784
evp_extra/evp_extra_test.cc
787785
evp_extra/evp_test.cc
786+
evp_extra/p_pqdsa_test.cc
788787
evp_extra/scrypt_test.cc
789788
fipsmodule/aes/aes_test.cc
790789
fipsmodule/bn/bn_test.cc

crypto/evp_extra/internal.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <openssl/base.h>
88
#include "../fipsmodule/evp/internal.h"
99

10-
#include "../dilithium/ml_dsa.h"
10+
#include "../fipsmodule/ml_dsa/ml_dsa.h"
1111

1212
#define PKCS8_VERSION_ONE 0
1313
#define PKCS8_VERSION_TWO 1

crypto/evp_extra/p_pqdsa_asn1.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77
#include <openssl/err.h>
88
#include <openssl/mem.h>
99

10-
#include "internal.h"
11-
#include "../fipsmodule/evp/internal.h"
1210
#include "../crypto/fipsmodule/pqdsa/internal.h"
1311
#include "../crypto/internal.h"
14-
#include "../dilithium/ml_dsa.h"
12+
#include "../fipsmodule/evp/internal.h"
13+
#include "../fipsmodule/ml_dsa/ml_dsa.h"
14+
#include "internal.h"
1515

1616
static void pqdsa_free(EVP_PKEY *pkey) {
1717
PQDSA_KEY_free(pkey->pkey.pqdsa_key);

crypto/dilithium/p_pqdsa_test.cc crypto/evp_extra/p_pqdsa_test.cc

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
#ifdef ENABLE_DILITHIUM
1818

19+
#include "../fipsmodule/ml_dsa/ml_dsa.h"
1920
#include "../test/file_test.h"
2021
#include "../test/test_util.h"
21-
#include "ml_dsa.h"
2222

2323
// mldsa44kPublicKey is an example ML-DSA-44 public key
2424
static const uint8_t mldsa44kPublicKey[] = {
@@ -1001,7 +1001,7 @@ static const struct PQDSATestVector parameterSet[] = {
10011001
1312,
10021002
2560,
10031003
2420,
1004-
"dilithium/kat/MLDSA_44_hedged_pure.txt",
1004+
"ml_dsa/kat/MLDSA_44_hedged_pure.txt",
10051005
mldsa44kPublicKey,
10061006
mldsa44kPublicKeySPKI,
10071007
1334,
@@ -1015,7 +1015,7 @@ static const struct PQDSATestVector parameterSet[] = {
10151015
1952,
10161016
4032,
10171017
3309,
1018-
"dilithium/kat/MLDSA_65_hedged_pure.txt",
1018+
"ml_dsa/kat/MLDSA_65_hedged_pure.txt",
10191019
mldsa65kPublicKey,
10201020
mldsa65kPublicKeySPKI,
10211021
1974,
@@ -1029,7 +1029,7 @@ static const struct PQDSATestVector parameterSet[] = {
10291029
2592,
10301030
4896,
10311031
4627,
1032-
"dilithium/kat/MLDSA_87_hedged_pure.txt",
1032+
"ml_dsa/kat/MLDSA_87_hedged_pure.txt",
10331033
mldsa87kPublicKey,
10341034
mldsa87kPublicKeySPKI,
10351035
2614,
@@ -1046,7 +1046,7 @@ INSTANTIATE_TEST_SUITE_P(All, PQDSAParameterTest, testing::ValuesIn(parameterSet
10461046
-> std::string { return params.param.name; });
10471047

10481048
TEST_P(PQDSAParameterTest, KAT) {
1049-
std::string kat_filepath = "crypto/";
1049+
std::string kat_filepath = "crypto/fipsmodule/";
10501050
kat_filepath += GetParam().kat_filename;
10511051

10521052
FileTestGTest(kat_filepath.c_str(), [&](FileTest *t) {

crypto/evp_extra/print.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
#include "../fipsmodule/rsa/internal.h"
6767

6868
#ifdef ENABLE_DILITHIUM
69-
#include "../dilithium/ml_dsa.h"
69+
#include "../fipsmodule/ml_dsa/ml_dsa.h"
7070
#include "../fipsmodule/pqdsa/internal.h"
7171
#endif
7272

crypto/fipsmodule/bcm.c

+3
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
#include "kem/kem.c"
131131
#include "md4/md4.c"
132132
#include "md5/md5.c"
133+
#ifdef ENABLE_DILITHIUM
134+
#include "ml_dsa/ml_dsa.c"
135+
#endif
133136
#include "ml_kem/ml_kem.c"
134137
#include "modes/cbc.c"
135138
#include "modes/cfb.c"

crypto/fipsmodule/evp/p_pqdsa.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#include <openssl/err.h>
66
#include <openssl/mem.h>
77

8-
#include "../delocate.h"
9-
#include "../crypto/dilithium/ml_dsa.h"
108
#include "../crypto/evp_extra/internal.h"
9+
#include "../crypto/fipsmodule/ml_dsa/ml_dsa.h"
1110
#include "../crypto/internal.h"
11+
#include "../delocate.h"
1212
#include "../pqdsa/internal.h"
1313

1414
// PQDSA PKEY functions

crypto/dilithium/ml_dsa.c crypto/fipsmodule/ml_dsa/ml_dsa.c

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
22
// SPDX-License-Identifier: Apache-2.0 OR ISC
33

4-
#include "../evp_extra/internal.h"
5-
#include "../fipsmodule/evp/internal.h"
4+
#include "../../evp_extra/internal.h"
5+
#include "../evp/internal.h"
66
#include "ml_dsa.h"
7-
#include "pqcrystals_dilithium_ref_common/sign.h"
8-
#include "pqcrystals_dilithium_ref_common/params.h"
7+
#include "ml_dsa_ref/params.h"
8+
#include "ml_dsa_ref/sign.h"
99

1010
// These includes are required to compile ML-DSA. These can be moved to bcm.c
1111
// when ML-DSA is added to the fipsmodule directory.
12-
#include "./pqcrystals_dilithium_ref_common/ntt.c"
13-
#include "./pqcrystals_dilithium_ref_common/packing.c"
14-
#include "./pqcrystals_dilithium_ref_common/params.c"
15-
#include "./pqcrystals_dilithium_ref_common/poly.c"
16-
#include "./pqcrystals_dilithium_ref_common/polyvec.c"
17-
#include "./pqcrystals_dilithium_ref_common/reduce.c"
18-
#include "./pqcrystals_dilithium_ref_common/rounding.c"
19-
#include "./pqcrystals_dilithium_ref_common/sign.c"
12+
#include "./ml_dsa_ref/ntt.c"
13+
#include "./ml_dsa_ref/packing.c"
14+
#include "./ml_dsa_ref/params.c"
15+
#include "./ml_dsa_ref/poly.c"
16+
#include "./ml_dsa_ref/polyvec.c"
17+
#include "./ml_dsa_ref/reduce.c"
18+
#include "./ml_dsa_ref/rounding.c"
19+
#include "./ml_dsa_ref/sign.c"
2020

2121
// Note: These methods currently default to using the reference code for
2222
// ML-DSA. In a future where AWS-LC has optimized options available,
File renamed without changes.

crypto/dilithium/pqcrystals_dilithium_ref_common/poly.c crypto/fipsmodule/ml_dsa/ml_dsa_ref/poly.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#include "ntt.h"
55
#include "reduce.h"
66
#include "rounding.h"
7-
#include "../../fipsmodule/sha/internal.h"
7+
#include "../../sha/internal.h"
88

99
/*************************************************
1010
* Name: ml_dsa_poly_reduce

0 commit comments

Comments
 (0)