Skip to content

Commit a95190e

Browse files
authored
Move PQDSA to FIPSMODULE (#2166)
As part of validating ML-DSA into AWS-LC-FIPS we must include both PQDSA and ML-DSA directories into the fipsmodule.
1 parent 2c6ff65 commit a95190e

File tree

15 files changed

+112
-110
lines changed

15 files changed

+112
-110
lines changed

crypto/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ add_library(
421421
evp_extra/p_ed25519_asn1.c
422422
evp_extra/p_hmac_asn1.c
423423
evp_extra/p_kem_asn1.c
424-
evp_extra/p_pqdsa.c
425424
evp_extra/p_pqdsa_asn1.c
426425
evp_extra/p_rsa_asn1.c
427426
evp_extra/p_x25519.c
@@ -471,7 +470,6 @@ add_library(
471470
poly1305/poly1305_arm.c
472471
poly1305/poly1305_vec.c
473472
pool/pool.c
474-
pqdsa/pqdsa.c
475473
rand_extra/deterministic.c
476474
rand_extra/entropy_passive.c
477475
rand_extra/forkunsafe.c

crypto/evp_extra/evp_asn1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
#include "../bytestring/internal.h"
6969
#include "../internal.h"
7070
#include "internal.h"
71-
#include "../pqdsa/internal.h"
71+
#include "../fipsmodule/pqdsa/internal.h"
7272

7373
// parse_key_type takes the algorithm cbs sequence |cbs| and extracts the OID.
7474
// The OID is then searched against ASN.1 methods for a method with that OID.

crypto/evp_extra/p_methods.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ static const EVP_PKEY_METHOD *const non_fips_pkey_evp_methods[] = {
1111
&x25519_pkey_meth,
1212
&dh_pkey_meth,
1313
&dsa_pkey_meth,
14-
&pqdsa_pkey_meth
1514
};
1615

1716
const EVP_PKEY_ASN1_METHOD *const asn1_evp_pkey_methods[] = {

crypto/evp_extra/p_pqdsa_asn1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#include <openssl/err.h>
88
#include <openssl/mem.h>
99

10-
#include "../crypto/pqdsa/internal.h"
10+
#include "../crypto/fipsmodule/pqdsa/internal.h"
1111
#include "../crypto/internal.h"
1212
#include "../fipsmodule/evp/internal.h"
1313
#include "../ml_dsa/ml_dsa.h"

crypto/evp_extra/p_pqdsa_test.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "../fipsmodule/evp/internal.h"
1616
#include "../internal.h"
1717
#include "../ml_dsa/ml_dsa.h"
18-
#include "../pqdsa/internal.h"
18+
#include "../fipsmodule/pqdsa/internal.h"
1919
#include "../test/file_test.h"
2020
#include "../test/test_util.h"
2121

crypto/evp_extra/print.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
#include "../fipsmodule/evp/internal.h"
6666
#include "../fipsmodule/rsa/internal.h"
6767
#include "../ml_dsa/ml_dsa.h"
68-
#include "../pqdsa/internal.h"
68+
#include "../fipsmodule/pqdsa/internal.h"
6969

7070
static int print_hex(BIO *bp, const uint8_t *data, size_t len, int off) {
7171
for (size_t i = 0; i < len; i++) {

crypto/fipsmodule/bcm.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@
118118
#include "evp/p_hkdf.c"
119119
#include "evp/p_hmac.c"
120120
#include "evp/p_kem.c"
121+
#include "evp/p_pqdsa.c"
121122
#include "evp/p_rsa.c"
122123
#include "hkdf/hkdf.c"
123124
#include "hmac/hmac.c"
@@ -136,6 +137,7 @@
136137
#include "modes/xts.c"
137138
#include "modes/polyval.c"
138139
#include "pbkdf/pbkdf.c"
140+
#include "pqdsa/pqdsa.c"
139141
#include "rand/ctrdrbg.c"
140142
#include "rand/fork_detect.c"
141143
#include "rand/rand.c"

crypto/fipsmodule/evp/digestsign.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757

5858
#include <openssl/err.h>
5959

60-
#include "../../pqdsa/internal.h"
60+
#include "../pqdsa/internal.h"
6161
#include "../delocate.h"
6262
#include "../digest/internal.h"
6363
#include "internal.h"

crypto/fipsmodule/evp/evp_ctx.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ DEFINE_LOCAL_DATA(struct fips_evp_pkey_methods, AWSLC_fips_evp_pkey_methods) {
7575
out->methods[4] = EVP_PKEY_hmac_pkey_meth();
7676
out->methods[5] = EVP_PKEY_ed25519_pkey_meth();
7777
out->methods[6] = EVP_PKEY_kem_pkey_meth();
78+
out->methods[7] = EVP_PKEY_pqdsa_pkey_meth();
7879
}
7980

8081
static const EVP_PKEY_METHOD *evp_pkey_meth_find(int type) {

crypto/fipsmodule/evp/internal.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,8 +381,8 @@ typedef struct {
381381
void evp_pkey_set_cb_translate(BN_GENCB *cb, EVP_PKEY_CTX *ctx);
382382

383383
#define ED25519_PUBLIC_KEY_OFFSET 32
384-
#define FIPS_EVP_PKEY_METHODS 7
385-
#define NON_FIPS_EVP_PKEY_METHODS 4
384+
#define FIPS_EVP_PKEY_METHODS 8
385+
#define NON_FIPS_EVP_PKEY_METHODS 3
386386
#define ASN1_EVP_PKEY_METHODS 10
387387

388388
struct fips_evp_pkey_methods {

0 commit comments

Comments
 (0)