Skip to content

Commit

Permalink
remove superfluous defined, touching less files
Browse files Browse the repository at this point in the history
  • Loading branch information
bhess committed Mar 7, 2024
1 parent 5ddc008 commit 5b043f3
Show file tree
Hide file tree
Showing 41 changed files with 14 additions and 68 deletions.
5 changes: 4 additions & 1 deletion scripts/copy_from_upstream/src/kem/family/kem_scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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 %}

Expand Down
5 changes: 4 additions & 1 deletion scripts/copy_from_upstream/src/sig/family/sig_scheme.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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 %}

Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_348864.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_348864f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_460896.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_460896f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_6688128.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_6960119.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_6960119f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_8192128.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/classic_mceliece/kem_classic_mceliece_8192128f.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/hqc/kem_hqc_128.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/hqc/kem_hqc_192.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/hqc/kem_hqc_256.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/kyber/kem_kyber_1024.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/kyber/kem_kyber_512.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/kem/kyber/kem_kyber_768.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
1 change: 1 addition & 0 deletions src/kem/ml_kem/kem_ml_kem_1024_ipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/kem/ml_kem/kem_ml_kem_512_ipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
1 change: 1 addition & 0 deletions src/kem/ml_kem/kem_ml_kem_768_ipd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 0 additions & 2 deletions src/sig/dilithium/sig_dilithium_2.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/sig/dilithium/sig_dilithium_3.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/sig/dilithium/sig_dilithium_5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions src/sig/falcon/sig_falcon_1024.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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);
Expand Down
Loading

0 comments on commit 5b043f3

Please sign in to comment.