From 5b043f38e6a1b678ebb0f3bdbc465606efd7aa3c Mon Sep 17 00:00:00 2001 From: Basil Hess Date: Thu, 7 Mar 2024 09:25:22 +0100 Subject: [PATCH] remove superfluous defined, touching less files --- scripts/copy_from_upstream/src/kem/family/kem_scheme.c | 5 ++++- scripts/copy_from_upstream/src/sig/family/sig_scheme.c | 5 ++++- src/kem/classic_mceliece/kem_classic_mceliece_348864.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_348864f.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_460896.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_460896f.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_6688128.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_6960119.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_6960119f.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_8192128.c | 2 -- src/kem/classic_mceliece/kem_classic_mceliece_8192128f.c | 2 -- src/kem/hqc/kem_hqc_128.c | 2 -- src/kem/hqc/kem_hqc_192.c | 2 -- src/kem/hqc/kem_hqc_256.c | 2 -- src/kem/kyber/kem_kyber_1024.c | 2 -- src/kem/kyber/kem_kyber_512.c | 2 -- src/kem/kyber/kem_kyber_768.c | 2 -- src/kem/ml_kem/kem_ml_kem_1024_ipd.c | 1 + src/kem/ml_kem/kem_ml_kem_512_ipd.c | 1 + src/kem/ml_kem/kem_ml_kem_768_ipd.c | 1 + src/sig/dilithium/sig_dilithium_2.c | 2 -- src/sig/dilithium/sig_dilithium_3.c | 2 -- src/sig/dilithium/sig_dilithium_5.c | 2 -- src/sig/falcon/sig_falcon_1024.c | 2 -- src/sig/falcon/sig_falcon_512.c | 2 -- src/sig/ml_dsa/sig_ml_dsa_44_ipd.c | 1 + src/sig/ml_dsa/sig_ml_dsa_65_ipd.c | 1 + src/sig/ml_dsa/sig_ml_dsa_87_ipd.c | 1 + src/sig/sphincs/sig_sphincs_sha2_128f_simple.c | 2 -- src/sig/sphincs/sig_sphincs_sha2_128s_simple.c | 2 -- src/sig/sphincs/sig_sphincs_sha2_192f_simple.c | 2 -- src/sig/sphincs/sig_sphincs_sha2_192s_simple.c | 2 -- src/sig/sphincs/sig_sphincs_sha2_256f_simple.c | 2 -- src/sig/sphincs/sig_sphincs_sha2_256s_simple.c | 2 -- src/sig/sphincs/sig_sphincs_shake_128f_simple.c | 2 -- src/sig/sphincs/sig_sphincs_shake_128s_simple.c | 2 -- src/sig/sphincs/sig_sphincs_shake_192f_simple.c | 2 -- src/sig/sphincs/sig_sphincs_shake_192s_simple.c | 2 -- src/sig/sphincs/sig_sphincs_shake_256f_simple.c | 2 -- src/sig/sphincs/sig_sphincs_shake_256s_simple.c | 2 -- 41 files changed, 14 insertions(+), 68 deletions(-) diff --git a/scripts/copy_from_upstream/src/kem/family/kem_scheme.c b/scripts/copy_from_upstream/src/kem/family/kem_scheme.c index 861d79690e..a78b30fb5a 100644 --- a/scripts/copy_from_upstream/src/kem/family/kem_scheme.c +++ b/scripts/copy_from_upstream/src/kem/family/kem_scheme.c @@ -6,8 +6,9 @@ {% for scheme in schemes -%} #if defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['alias_scheme'] }}){%- endif %} - +{% if 'alias_scheme' in scheme %} #if defined(OQS_ENABLE_KEM_{{ family }}_{{ scheme['scheme'] }}) +{% endif %} OQS_KEM *OQS_KEM_{{ family }}_{{ scheme['scheme'] }}_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -31,7 +32,9 @@ OQS_KEM *OQS_KEM_{{ family }}_{{ scheme['scheme'] }}_new(void) { return kem; } +{%- if 'alias_scheme' in scheme %} #endif +{%- endif -%} {%- if 'alias_scheme' in scheme %} diff --git a/scripts/copy_from_upstream/src/sig/family/sig_scheme.c b/scripts/copy_from_upstream/src/sig/family/sig_scheme.c index 1cf9a54770..fcb364be71 100644 --- a/scripts/copy_from_upstream/src/sig/family/sig_scheme.c +++ b/scripts/copy_from_upstream/src/sig/family/sig_scheme.c @@ -6,8 +6,9 @@ {% for scheme in schemes -%} #if defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}) {%- if 'alias_scheme' in scheme %} || defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['alias_scheme'] }}){%- endif %} - +{% if 'alias_scheme' in scheme %} #if defined(OQS_ENABLE_SIG_{{ family }}_{{ scheme['scheme'] }}) +{% endif %} OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -30,7 +31,9 @@ OQS_SIG *OQS_SIG_{{ family }}_{{ scheme['scheme'] }}_new(void) { return sig; } +{%- if 'alias_scheme' in scheme %} #endif +{%- endif -%} {%- if 'alias_scheme' in scheme %} diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_348864.c b/src/kem/classic_mceliece/kem_classic_mceliece_348864.c index 14c34eba2f..87b74a1b98 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_348864.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_348864.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_348864) -#if defined(OQS_ENABLE_KEM_classic_mceliece_348864) OQS_KEM *OQS_KEM_classic_mceliece_348864_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_348864_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_348864f.c b/src/kem/classic_mceliece/kem_classic_mceliece_348864f.c index 734ec93832..a3c347af8f 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_348864f.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_348864f.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_348864f) -#if defined(OQS_ENABLE_KEM_classic_mceliece_348864f) OQS_KEM *OQS_KEM_classic_mceliece_348864f_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_348864f_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_460896.c b/src/kem/classic_mceliece/kem_classic_mceliece_460896.c index 44f2c828dc..839f8d4535 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_460896.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_460896.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_460896) -#if defined(OQS_ENABLE_KEM_classic_mceliece_460896) OQS_KEM *OQS_KEM_classic_mceliece_460896_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_460896_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_460896f.c b/src/kem/classic_mceliece/kem_classic_mceliece_460896f.c index 9824686315..0629166487 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_460896f.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_460896f.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_460896f) -#if defined(OQS_ENABLE_KEM_classic_mceliece_460896f) OQS_KEM *OQS_KEM_classic_mceliece_460896f_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_460896f_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_6688128.c b/src/kem/classic_mceliece/kem_classic_mceliece_6688128.c index ff9ec8cba2..91a70105dc 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_6688128.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_6688128.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_6688128) -#if defined(OQS_ENABLE_KEM_classic_mceliece_6688128) OQS_KEM *OQS_KEM_classic_mceliece_6688128_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_6688128_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c b/src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c index c392b05ea2..d97e5c3501 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_6688128f) -#if defined(OQS_ENABLE_KEM_classic_mceliece_6688128f) OQS_KEM *OQS_KEM_classic_mceliece_6688128f_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_6688128f_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_6960119.c b/src/kem/classic_mceliece/kem_classic_mceliece_6960119.c index 7278eb9108..70d828fcdd 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_6960119.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_6960119.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_6960119) -#if defined(OQS_ENABLE_KEM_classic_mceliece_6960119) OQS_KEM *OQS_KEM_classic_mceliece_6960119_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_6960119_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE6960119_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE6960119_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_6960119f.c b/src/kem/classic_mceliece/kem_classic_mceliece_6960119f.c index cd594ab2e6..5c4bfa71a7 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_6960119f.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_6960119f.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_6960119f) -#if defined(OQS_ENABLE_KEM_classic_mceliece_6960119f) OQS_KEM *OQS_KEM_classic_mceliece_6960119f_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_6960119f_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE6960119F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE6960119F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_8192128.c b/src/kem/classic_mceliece/kem_classic_mceliece_8192128.c index 1bd9e7728d..4dc8fe263b 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_8192128.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_8192128.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_8192128) -#if defined(OQS_ENABLE_KEM_classic_mceliece_8192128) OQS_KEM *OQS_KEM_classic_mceliece_8192128_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_8192128_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE8192128_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE8192128_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/classic_mceliece/kem_classic_mceliece_8192128f.c b/src/kem/classic_mceliece/kem_classic_mceliece_8192128f.c index 575593de93..81981c1fad 100644 --- a/src/kem/classic_mceliece/kem_classic_mceliece_8192128f.c +++ b/src/kem/classic_mceliece/kem_classic_mceliece_8192128f.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_classic_mceliece_8192128f) -#if defined(OQS_ENABLE_KEM_classic_mceliece_8192128f) OQS_KEM *OQS_KEM_classic_mceliece_8192128f_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_classic_mceliece_8192128f_new(void) { return kem; } -#endif extern int PQCLEAN_MCELIECE8192128F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_MCELIECE8192128F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/hqc/kem_hqc_128.c b/src/kem/hqc/kem_hqc_128.c index cdecc29875..edabb8c2f2 100644 --- a/src/kem/hqc/kem_hqc_128.c +++ b/src/kem/hqc/kem_hqc_128.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_hqc_128) -#if defined(OQS_ENABLE_KEM_hqc_128) OQS_KEM *OQS_KEM_hqc_128_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_hqc_128_new(void) { return kem; } -#endif extern int PQCLEAN_HQC128_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_HQC128_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/hqc/kem_hqc_192.c b/src/kem/hqc/kem_hqc_192.c index 41c57452b9..3da83c5e9e 100644 --- a/src/kem/hqc/kem_hqc_192.c +++ b/src/kem/hqc/kem_hqc_192.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_hqc_192) -#if defined(OQS_ENABLE_KEM_hqc_192) OQS_KEM *OQS_KEM_hqc_192_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_hqc_192_new(void) { return kem; } -#endif extern int PQCLEAN_HQC192_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_HQC192_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/hqc/kem_hqc_256.c b/src/kem/hqc/kem_hqc_256.c index bb5a2ab792..a80197c228 100644 --- a/src/kem/hqc/kem_hqc_256.c +++ b/src/kem/hqc/kem_hqc_256.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_hqc_256) -#if defined(OQS_ENABLE_KEM_hqc_256) OQS_KEM *OQS_KEM_hqc_256_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_hqc_256_new(void) { return kem; } -#endif extern int PQCLEAN_HQC256_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_HQC256_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/kyber/kem_kyber_1024.c b/src/kem/kyber/kem_kyber_1024.c index c37994d63c..db72b23cd5 100644 --- a/src/kem/kyber/kem_kyber_1024.c +++ b/src/kem/kyber/kem_kyber_1024.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_kyber_1024) -#if defined(OQS_ENABLE_KEM_kyber_1024) OQS_KEM *OQS_KEM_kyber_1024_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_kyber_1024_new(void) { return kem; } -#endif extern int pqcrystals_kyber1024_ref_keypair(uint8_t *pk, uint8_t *sk); extern int pqcrystals_kyber1024_ref_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/kyber/kem_kyber_512.c b/src/kem/kyber/kem_kyber_512.c index 3eca1a76f7..a226787f65 100644 --- a/src/kem/kyber/kem_kyber_512.c +++ b/src/kem/kyber/kem_kyber_512.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_kyber_512) -#if defined(OQS_ENABLE_KEM_kyber_512) OQS_KEM *OQS_KEM_kyber_512_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_kyber_512_new(void) { return kem; } -#endif extern int pqcrystals_kyber512_ref_keypair(uint8_t *pk, uint8_t *sk); extern int pqcrystals_kyber512_ref_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/kyber/kem_kyber_768.c b/src/kem/kyber/kem_kyber_768.c index 99675c0d24..bc21b00380 100644 --- a/src/kem/kyber/kem_kyber_768.c +++ b/src/kem/kyber/kem_kyber_768.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_KEM_kyber_768) -#if defined(OQS_ENABLE_KEM_kyber_768) OQS_KEM *OQS_KEM_kyber_768_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); @@ -30,7 +29,6 @@ OQS_KEM *OQS_KEM_kyber_768_new(void) { return kem; } -#endif extern int pqcrystals_kyber768_ref_keypair(uint8_t *pk, uint8_t *sk); extern int pqcrystals_kyber768_ref_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk); diff --git a/src/kem/ml_kem/kem_ml_kem_1024_ipd.c b/src/kem/ml_kem/kem_ml_kem_1024_ipd.c index e7434f6abb..7667187f4d 100644 --- a/src/kem/ml_kem/kem_ml_kem_1024_ipd.c +++ b/src/kem/ml_kem/kem_ml_kem_1024_ipd.c @@ -7,6 +7,7 @@ #if defined(OQS_ENABLE_KEM_ml_kem_1024_ipd) || defined(OQS_ENABLE_KEM_ml_kem_1024) #if defined(OQS_ENABLE_KEM_ml_kem_1024_ipd) + OQS_KEM *OQS_KEM_ml_kem_1024_ipd_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); diff --git a/src/kem/ml_kem/kem_ml_kem_512_ipd.c b/src/kem/ml_kem/kem_ml_kem_512_ipd.c index baf28b88e4..c9cf816630 100644 --- a/src/kem/ml_kem/kem_ml_kem_512_ipd.c +++ b/src/kem/ml_kem/kem_ml_kem_512_ipd.c @@ -7,6 +7,7 @@ #if defined(OQS_ENABLE_KEM_ml_kem_512_ipd) || defined(OQS_ENABLE_KEM_ml_kem_512) #if defined(OQS_ENABLE_KEM_ml_kem_512_ipd) + OQS_KEM *OQS_KEM_ml_kem_512_ipd_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); diff --git a/src/kem/ml_kem/kem_ml_kem_768_ipd.c b/src/kem/ml_kem/kem_ml_kem_768_ipd.c index d6eddb2da0..da8ef0883a 100644 --- a/src/kem/ml_kem/kem_ml_kem_768_ipd.c +++ b/src/kem/ml_kem/kem_ml_kem_768_ipd.c @@ -7,6 +7,7 @@ #if defined(OQS_ENABLE_KEM_ml_kem_768_ipd) || defined(OQS_ENABLE_KEM_ml_kem_768) #if defined(OQS_ENABLE_KEM_ml_kem_768_ipd) + OQS_KEM *OQS_KEM_ml_kem_768_ipd_new(void) { OQS_KEM *kem = malloc(sizeof(OQS_KEM)); diff --git a/src/sig/dilithium/sig_dilithium_2.c b/src/sig/dilithium/sig_dilithium_2.c index d6bdb16b27..de1b2ad1fa 100644 --- a/src/sig/dilithium/sig_dilithium_2.c +++ b/src/sig/dilithium/sig_dilithium_2.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_dilithium_2) -#if defined(OQS_ENABLE_SIG_dilithium_2) OQS_SIG *OQS_SIG_dilithium_2_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_dilithium_2_new(void) { return sig; } -#endif extern int pqcrystals_dilithium2_ref_keypair(uint8_t *pk, uint8_t *sk); extern int pqcrystals_dilithium2_ref_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/dilithium/sig_dilithium_3.c b/src/sig/dilithium/sig_dilithium_3.c index a1ded109fc..f1a8311a20 100644 --- a/src/sig/dilithium/sig_dilithium_3.c +++ b/src/sig/dilithium/sig_dilithium_3.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_dilithium_3) -#if defined(OQS_ENABLE_SIG_dilithium_3) OQS_SIG *OQS_SIG_dilithium_3_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_dilithium_3_new(void) { return sig; } -#endif extern int pqcrystals_dilithium3_ref_keypair(uint8_t *pk, uint8_t *sk); extern int pqcrystals_dilithium3_ref_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/dilithium/sig_dilithium_5.c b/src/sig/dilithium/sig_dilithium_5.c index 1f4b0e65ca..06871be6e6 100644 --- a/src/sig/dilithium/sig_dilithium_5.c +++ b/src/sig/dilithium/sig_dilithium_5.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_dilithium_5) -#if defined(OQS_ENABLE_SIG_dilithium_5) OQS_SIG *OQS_SIG_dilithium_5_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_dilithium_5_new(void) { return sig; } -#endif extern int pqcrystals_dilithium5_ref_keypair(uint8_t *pk, uint8_t *sk); extern int pqcrystals_dilithium5_ref_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/falcon/sig_falcon_1024.c b/src/sig/falcon/sig_falcon_1024.c index a8d66e2fcc..06562cdea7 100644 --- a/src/sig/falcon/sig_falcon_1024.c +++ b/src/sig/falcon/sig_falcon_1024.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_falcon_1024) -#if defined(OQS_ENABLE_SIG_falcon_1024) OQS_SIG *OQS_SIG_falcon_1024_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_falcon_1024_new(void) { return sig; } -#endif extern int PQCLEAN_FALCON1024_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_FALCON1024_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/falcon/sig_falcon_512.c b/src/sig/falcon/sig_falcon_512.c index 3291dc29ce..d77e3eb735 100644 --- a/src/sig/falcon/sig_falcon_512.c +++ b/src/sig/falcon/sig_falcon_512.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_falcon_512) -#if defined(OQS_ENABLE_SIG_falcon_512) OQS_SIG *OQS_SIG_falcon_512_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_falcon_512_new(void) { return sig; } -#endif extern int PQCLEAN_FALCON512_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_FALCON512_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/ml_dsa/sig_ml_dsa_44_ipd.c b/src/sig/ml_dsa/sig_ml_dsa_44_ipd.c index 1362e59feb..6d3f1e2cc2 100644 --- a/src/sig/ml_dsa/sig_ml_dsa_44_ipd.c +++ b/src/sig/ml_dsa/sig_ml_dsa_44_ipd.c @@ -7,6 +7,7 @@ #if defined(OQS_ENABLE_SIG_ml_dsa_44_ipd) || defined(OQS_ENABLE_SIG_ml_dsa_44) #if defined(OQS_ENABLE_SIG_ml_dsa_44_ipd) + OQS_SIG *OQS_SIG_ml_dsa_44_ipd_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); diff --git a/src/sig/ml_dsa/sig_ml_dsa_65_ipd.c b/src/sig/ml_dsa/sig_ml_dsa_65_ipd.c index 3e3e17905c..4c175d680c 100644 --- a/src/sig/ml_dsa/sig_ml_dsa_65_ipd.c +++ b/src/sig/ml_dsa/sig_ml_dsa_65_ipd.c @@ -7,6 +7,7 @@ #if defined(OQS_ENABLE_SIG_ml_dsa_65_ipd) || defined(OQS_ENABLE_SIG_ml_dsa_65) #if defined(OQS_ENABLE_SIG_ml_dsa_65_ipd) + OQS_SIG *OQS_SIG_ml_dsa_65_ipd_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); diff --git a/src/sig/ml_dsa/sig_ml_dsa_87_ipd.c b/src/sig/ml_dsa/sig_ml_dsa_87_ipd.c index e33b512ead..2ba18d57c5 100644 --- a/src/sig/ml_dsa/sig_ml_dsa_87_ipd.c +++ b/src/sig/ml_dsa/sig_ml_dsa_87_ipd.c @@ -7,6 +7,7 @@ #if defined(OQS_ENABLE_SIG_ml_dsa_87_ipd) || defined(OQS_ENABLE_SIG_ml_dsa_87) #if defined(OQS_ENABLE_SIG_ml_dsa_87_ipd) + OQS_SIG *OQS_SIG_ml_dsa_87_ipd_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); diff --git a/src/sig/sphincs/sig_sphincs_sha2_128f_simple.c b/src/sig/sphincs/sig_sphincs_sha2_128f_simple.c index 0b7e9de76d..d3872e9c3c 100644 --- a/src/sig/sphincs/sig_sphincs_sha2_128f_simple.c +++ b/src/sig/sphincs/sig_sphincs_sha2_128f_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_sha2_128f_simple) -#if defined(OQS_ENABLE_SIG_sphincs_sha2_128f_simple) OQS_SIG *OQS_SIG_sphincs_sha2_128f_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_sha2_128f_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHA2128FSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHA2128FSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_sha2_128s_simple.c b/src/sig/sphincs/sig_sphincs_sha2_128s_simple.c index 0c5ca214db..d9dab73c1e 100644 --- a/src/sig/sphincs/sig_sphincs_sha2_128s_simple.c +++ b/src/sig/sphincs/sig_sphincs_sha2_128s_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_sha2_128s_simple) -#if defined(OQS_ENABLE_SIG_sphincs_sha2_128s_simple) OQS_SIG *OQS_SIG_sphincs_sha2_128s_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_sha2_128s_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHA2128SSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHA2128SSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_sha2_192f_simple.c b/src/sig/sphincs/sig_sphincs_sha2_192f_simple.c index 130fb7b58b..b7e2cf4372 100644 --- a/src/sig/sphincs/sig_sphincs_sha2_192f_simple.c +++ b/src/sig/sphincs/sig_sphincs_sha2_192f_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_sha2_192f_simple) -#if defined(OQS_ENABLE_SIG_sphincs_sha2_192f_simple) OQS_SIG *OQS_SIG_sphincs_sha2_192f_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_sha2_192f_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHA2192FSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHA2192FSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_sha2_192s_simple.c b/src/sig/sphincs/sig_sphincs_sha2_192s_simple.c index 506471387f..5104a7e5be 100644 --- a/src/sig/sphincs/sig_sphincs_sha2_192s_simple.c +++ b/src/sig/sphincs/sig_sphincs_sha2_192s_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_sha2_192s_simple) -#if defined(OQS_ENABLE_SIG_sphincs_sha2_192s_simple) OQS_SIG *OQS_SIG_sphincs_sha2_192s_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_sha2_192s_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHA2192SSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHA2192SSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_sha2_256f_simple.c b/src/sig/sphincs/sig_sphincs_sha2_256f_simple.c index a1bf3de4e2..3e372e359d 100644 --- a/src/sig/sphincs/sig_sphincs_sha2_256f_simple.c +++ b/src/sig/sphincs/sig_sphincs_sha2_256f_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_sha2_256f_simple) -#if defined(OQS_ENABLE_SIG_sphincs_sha2_256f_simple) OQS_SIG *OQS_SIG_sphincs_sha2_256f_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_sha2_256f_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHA2256FSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHA2256FSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_sha2_256s_simple.c b/src/sig/sphincs/sig_sphincs_sha2_256s_simple.c index c688c0719f..c2e468ccde 100644 --- a/src/sig/sphincs/sig_sphincs_sha2_256s_simple.c +++ b/src/sig/sphincs/sig_sphincs_sha2_256s_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_sha2_256s_simple) -#if defined(OQS_ENABLE_SIG_sphincs_sha2_256s_simple) OQS_SIG *OQS_SIG_sphincs_sha2_256s_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_sha2_256s_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHA2256SSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHA2256SSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_shake_128f_simple.c b/src/sig/sphincs/sig_sphincs_shake_128f_simple.c index 1022310ad1..f3539ddb74 100644 --- a/src/sig/sphincs/sig_sphincs_shake_128f_simple.c +++ b/src/sig/sphincs/sig_sphincs_shake_128f_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_shake_128f_simple) -#if defined(OQS_ENABLE_SIG_sphincs_shake_128f_simple) OQS_SIG *OQS_SIG_sphincs_shake_128f_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_shake_128f_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHAKE128FSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHAKE128FSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_shake_128s_simple.c b/src/sig/sphincs/sig_sphincs_shake_128s_simple.c index c02d94e490..c46327547a 100644 --- a/src/sig/sphincs/sig_sphincs_shake_128s_simple.c +++ b/src/sig/sphincs/sig_sphincs_shake_128s_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_shake_128s_simple) -#if defined(OQS_ENABLE_SIG_sphincs_shake_128s_simple) OQS_SIG *OQS_SIG_sphincs_shake_128s_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_shake_128s_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHAKE128SSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHAKE128SSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_shake_192f_simple.c b/src/sig/sphincs/sig_sphincs_shake_192f_simple.c index 5a6859a2dc..9d48934cfb 100644 --- a/src/sig/sphincs/sig_sphincs_shake_192f_simple.c +++ b/src/sig/sphincs/sig_sphincs_shake_192f_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_shake_192f_simple) -#if defined(OQS_ENABLE_SIG_sphincs_shake_192f_simple) OQS_SIG *OQS_SIG_sphincs_shake_192f_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_shake_192f_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHAKE192FSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHAKE192FSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_shake_192s_simple.c b/src/sig/sphincs/sig_sphincs_shake_192s_simple.c index 41b27d06d0..add522d162 100644 --- a/src/sig/sphincs/sig_sphincs_shake_192s_simple.c +++ b/src/sig/sphincs/sig_sphincs_shake_192s_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_shake_192s_simple) -#if defined(OQS_ENABLE_SIG_sphincs_shake_192s_simple) OQS_SIG *OQS_SIG_sphincs_shake_192s_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_shake_192s_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHAKE192SSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHAKE192SSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_shake_256f_simple.c b/src/sig/sphincs/sig_sphincs_shake_256f_simple.c index eb974d6201..73143d77d0 100644 --- a/src/sig/sphincs/sig_sphincs_shake_256f_simple.c +++ b/src/sig/sphincs/sig_sphincs_shake_256f_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_shake_256f_simple) -#if defined(OQS_ENABLE_SIG_sphincs_shake_256f_simple) OQS_SIG *OQS_SIG_sphincs_shake_256f_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_shake_256f_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHAKE256FSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHAKE256FSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk); diff --git a/src/sig/sphincs/sig_sphincs_shake_256s_simple.c b/src/sig/sphincs/sig_sphincs_shake_256s_simple.c index c4be7208d3..832292dc3d 100644 --- a/src/sig/sphincs/sig_sphincs_shake_256s_simple.c +++ b/src/sig/sphincs/sig_sphincs_shake_256s_simple.c @@ -6,7 +6,6 @@ #if defined(OQS_ENABLE_SIG_sphincs_shake_256s_simple) -#if defined(OQS_ENABLE_SIG_sphincs_shake_256s_simple) OQS_SIG *OQS_SIG_sphincs_shake_256s_simple_new(void) { OQS_SIG *sig = malloc(sizeof(OQS_SIG)); @@ -29,7 +28,6 @@ OQS_SIG *OQS_SIG_sphincs_shake_256s_simple_new(void) { return sig; } -#endif extern int PQCLEAN_SPHINCSSHAKE256SSIMPLE_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk); extern int PQCLEAN_SPHINCSSHAKE256SSIMPLE_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);