Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ML-KEM's internal header files to use unique include guards #2078

Merged
merged 1 commit into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crypto/fipsmodule/ml_kem/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ that initialize a given structure with values corresponding to a parameter set.
- `symmetric-shake.c`: unnecessary include of fips202.h is removed.
- `api.h`: `pqcrystals` prefix substituted with `ml_kem` (to be able to build alongside `crypto/kyber`).
- `poly.c`: the `poly_frommsg` function was modified to address the constant-time issue described [here](https://github.com/pq-crystals/kyber/commit/9b8d30698a3e7449aeb34e62339d4176f11e3c6c).
- All internal header files were updated with unique `ML_KEM_*` include guards.

**Testing.** The KATs were obtained from an independent implementation of ML-KEM written in SPARK Ada subset: https://github.com/awslabs/LibMLKEM.
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/cbd.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef CBD_H
#define CBD_H
#ifndef ML_KEM_CBD_H
#define ML_KEM_CBD_H

#include <stdint.h>
#include "params.h"
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/indcpa.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef INDCPA_H
#define INDCPA_H
#ifndef ML_KEM_INDCPA_H
#define ML_KEM_INDCPA_H

#include <stdint.h>
#include "params.h"
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/ntt.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef NTT_H
#define NTT_H
#ifndef ML_KEM_NTT_H
#define ML_KEM_NTT_H

#include <stdint.h>
#include "params.h"
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/params.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef PARAMS_H
#define PARAMS_H
#ifndef ML_KEM_PARAMS_H
#define ML_KEM_PARAMS_H

#include <openssl/base.h>

Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/poly.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef POLY_H
#define POLY_H
#ifndef ML_KEM_POLY_H
#define ML_KEM_POLY_H

#include <stdint.h>
#include "params.h"
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/polyvec.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef POLYVEC_H
#define POLYVEC_H
#ifndef ML_KEM_POLYVEC_H
#define ML_KEM_POLYVEC_H

#include <stdint.h>
#include "params.h"
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/reduce.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef REDUCE_H
#define REDUCE_H
#ifndef ML_KEM_REDUCE_H
#define ML_KEM_REDUCE_H

#include <stdint.h>
#include "params.h"
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/symmetric.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef SYMMETRIC_H
#define SYMMETRIC_H
#ifndef ML_KEM_SYMMETRIC_H
#define ML_KEM_SYMMETRIC_H

#include <stddef.h>
#include <stdint.h>
Expand Down
4 changes: 2 additions & 2 deletions crypto/fipsmodule/ml_kem/ml_kem_ref/verify.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef VERIFY_H
#define VERIFY_H
#ifndef ML_KEM_VERIFY_H
#define ML_KEM_VERIFY_H

#include <stddef.h>
#include <stdint.h>
Expand Down
Loading