Skip to content
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
40 changes: 20 additions & 20 deletions src/kem/classic_mceliece/kem_classic_mceliece.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#define OQS_KEM_classic_mceliece_348864_length_secret_key 6492
#define OQS_KEM_classic_mceliece_348864_length_ciphertext 96
#define OQS_KEM_classic_mceliece_348864_length_shared_secret 32
#define OQS_KEM_classic_mceliece_348864_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_348864_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_348864_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_348864_length_encaps_seed 32

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to change the encaps_seed. This leads to test failure because derand encapsulation is not implemented.

Patch here: #5

OQS_KEM *OQS_KEM_classic_mceliece_348864_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -25,8 +25,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864_decaps(uint8_t *shared_secret
#define OQS_KEM_classic_mceliece_348864f_length_secret_key 6492
#define OQS_KEM_classic_mceliece_348864f_length_ciphertext 96
#define OQS_KEM_classic_mceliece_348864f_length_shared_secret 32
#define OQS_KEM_classic_mceliece_348864f_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_348864f_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_348864f_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_348864f_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_348864f_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864f_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -40,8 +40,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864f_decaps(uint8_t *shared_secre
#define OQS_KEM_classic_mceliece_460896_length_secret_key 13608
#define OQS_KEM_classic_mceliece_460896_length_ciphertext 156
#define OQS_KEM_classic_mceliece_460896_length_shared_secret 32
#define OQS_KEM_classic_mceliece_460896_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_460896_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_460896_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_460896_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_460896_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -55,8 +55,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896_decaps(uint8_t *shared_secret
#define OQS_KEM_classic_mceliece_460896f_length_secret_key 13608
#define OQS_KEM_classic_mceliece_460896f_length_ciphertext 156
#define OQS_KEM_classic_mceliece_460896f_length_shared_secret 32
#define OQS_KEM_classic_mceliece_460896f_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_460896f_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_460896f_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_460896f_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_460896f_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896f_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -70,8 +70,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896f_decaps(uint8_t *shared_secre
#define OQS_KEM_classic_mceliece_6688128_length_secret_key 13932
#define OQS_KEM_classic_mceliece_6688128_length_ciphertext 208
#define OQS_KEM_classic_mceliece_6688128_length_shared_secret 32
#define OQS_KEM_classic_mceliece_6688128_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_6688128_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_6688128_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_6688128_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_6688128_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -85,8 +85,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128_decaps(uint8_t *shared_secre
#define OQS_KEM_classic_mceliece_6688128f_length_secret_key 13932
#define OQS_KEM_classic_mceliece_6688128f_length_ciphertext 208
#define OQS_KEM_classic_mceliece_6688128f_length_shared_secret 32
#define OQS_KEM_classic_mceliece_6688128f_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_6688128f_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_6688128f_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_6688128f_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_6688128f_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128f_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -100,8 +100,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128f_decaps(uint8_t *shared_secr
#define OQS_KEM_classic_mceliece_6960119_length_secret_key 13948
#define OQS_KEM_classic_mceliece_6960119_length_ciphertext 194
#define OQS_KEM_classic_mceliece_6960119_length_shared_secret 32
#define OQS_KEM_classic_mceliece_6960119_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_6960119_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_6960119_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_6960119_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_6960119_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6960119_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6960119_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -115,8 +115,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6960119_decaps(uint8_t *shared_secre
#define OQS_KEM_classic_mceliece_6960119f_length_secret_key 13948
#define OQS_KEM_classic_mceliece_6960119f_length_ciphertext 194
#define OQS_KEM_classic_mceliece_6960119f_length_shared_secret 32
#define OQS_KEM_classic_mceliece_6960119f_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_6960119f_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_6960119f_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_6960119f_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_6960119f_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6960119f_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6960119f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -130,8 +130,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6960119f_decaps(uint8_t *shared_secr
#define OQS_KEM_classic_mceliece_8192128_length_secret_key 14120
#define OQS_KEM_classic_mceliece_8192128_length_ciphertext 208
#define OQS_KEM_classic_mceliece_8192128_length_shared_secret 32
#define OQS_KEM_classic_mceliece_8192128_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_8192128_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_8192128_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_8192128_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_8192128_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_8192128_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_8192128_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand All @@ -145,8 +145,8 @@ OQS_API OQS_STATUS OQS_KEM_classic_mceliece_8192128_decaps(uint8_t *shared_secre
#define OQS_KEM_classic_mceliece_8192128f_length_secret_key 14120
#define OQS_KEM_classic_mceliece_8192128f_length_ciphertext 208
#define OQS_KEM_classic_mceliece_8192128f_length_shared_secret 32
#define OQS_KEM_classic_mceliece_8192128f_length_keypair_seed 0
#define OQS_KEM_classic_mceliece_8192128f_length_encaps_seed 0
#define OQS_KEM_classic_mceliece_8192128f_length_keypair_seed 32
#define OQS_KEM_classic_mceliece_8192128f_length_encaps_seed 32
OQS_KEM *OQS_KEM_classic_mceliece_8192128f_new(void);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_8192128f_keypair(uint8_t *public_key, uint8_t *secret_key);
OQS_API OQS_STATUS OQS_KEM_classic_mceliece_8192128f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed);
Expand Down
19 changes: 15 additions & 4 deletions src/kem/classic_mceliece/kem_classic_mceliece_348864.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,31 @@ OQS_KEM *OQS_KEM_classic_mceliece_348864_new(void) {
}

extern int PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);

#if defined(OQS_ENABLE_KEM_classic_mceliece_348864_avx2)
extern int PQCLEAN_MCELIECE348864_AVX2_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE348864_AVX2_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE348864_AVX2_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE348864_AVX2_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
#endif

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
(void)public_key;
(void)secret_key;
(void)seed;
return OQS_ERROR;
#if defined(OQS_ENABLE_KEM_classic_mceliece_348864_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_MCELIECE348864_AVX2_crypto_kem_keypair_derand(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_MCELIECE348864_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864_keypair(uint8_t *public_key, uint8_t *secret_key) {
Expand Down
19 changes: 15 additions & 4 deletions src/kem/classic_mceliece/kem_classic_mceliece_348864f.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,31 @@ OQS_KEM *OQS_KEM_classic_mceliece_348864f_new(void) {
}

extern int PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);

#if defined(OQS_ENABLE_KEM_classic_mceliece_348864f_avx2)
extern int PQCLEAN_MCELIECE348864F_AVX2_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE348864F_AVX2_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE348864F_AVX2_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE348864F_AVX2_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
#endif

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
(void)public_key;
(void)secret_key;
(void)seed;
return OQS_ERROR;
#if defined(OQS_ENABLE_KEM_classic_mceliece_348864f_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI1)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_MCELIECE348864F_AVX2_crypto_kem_keypair_derand(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_MCELIECE348864F_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_348864f_keypair(uint8_t *public_key, uint8_t *secret_key) {
Expand Down
19 changes: 15 additions & 4 deletions src/kem/classic_mceliece/kem_classic_mceliece_460896.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,31 @@ OQS_KEM *OQS_KEM_classic_mceliece_460896_new(void) {
}

extern int PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);

#if defined(OQS_ENABLE_KEM_classic_mceliece_460896_avx2)
extern int PQCLEAN_MCELIECE460896_AVX2_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE460896_AVX2_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE460896_AVX2_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE460896_AVX2_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
#endif

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
(void)public_key;
(void)secret_key;
(void)seed;
return OQS_ERROR;
#if defined(OQS_ENABLE_KEM_classic_mceliece_460896_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_MCELIECE460896_AVX2_crypto_kem_keypair_derand(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_MCELIECE460896_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896_keypair(uint8_t *public_key, uint8_t *secret_key) {
Expand Down
19 changes: 15 additions & 4 deletions src/kem/classic_mceliece/kem_classic_mceliece_460896f.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,31 @@ OQS_KEM *OQS_KEM_classic_mceliece_460896f_new(void) {
}

extern int PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);

#if defined(OQS_ENABLE_KEM_classic_mceliece_460896f_avx2)
extern int PQCLEAN_MCELIECE460896F_AVX2_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE460896F_AVX2_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE460896F_AVX2_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE460896F_AVX2_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
#endif

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
(void)public_key;
(void)secret_key;
(void)seed;
return OQS_ERROR;
#if defined(OQS_ENABLE_KEM_classic_mceliece_460896f_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI1)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_MCELIECE460896F_AVX2_crypto_kem_keypair_derand(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_MCELIECE460896F_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_460896f_keypair(uint8_t *public_key, uint8_t *secret_key) {
Expand Down
19 changes: 15 additions & 4 deletions src/kem/classic_mceliece/kem_classic_mceliece_6688128.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,31 @@ OQS_KEM *OQS_KEM_classic_mceliece_6688128_new(void) {
}

extern int PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);

#if defined(OQS_ENABLE_KEM_classic_mceliece_6688128_avx2)
extern int PQCLEAN_MCELIECE6688128_AVX2_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE6688128_AVX2_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE6688128_AVX2_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE6688128_AVX2_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
#endif

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
(void)public_key;
(void)secret_key;
(void)seed;
return OQS_ERROR;
#if defined(OQS_ENABLE_KEM_classic_mceliece_6688128_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_MCELIECE6688128_AVX2_crypto_kem_keypair_derand(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_MCELIECE6688128_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128_keypair(uint8_t *public_key, uint8_t *secret_key) {
Expand Down
19 changes: 15 additions & 4 deletions src/kem/classic_mceliece/kem_classic_mceliece_6688128f.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,20 +35,31 @@ OQS_KEM *OQS_KEM_classic_mceliece_6688128f_new(void) {
}

extern int PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);

#if defined(OQS_ENABLE_KEM_classic_mceliece_6688128f_avx2)
extern int PQCLEAN_MCELIECE6688128F_AVX2_crypto_kem_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_MCELIECE6688128F_AVX2_crypto_kem_keypair_derand(uint8_t *pk, uint8_t *sk, const uint8_t seed[32]);
extern int PQCLEAN_MCELIECE6688128F_AVX2_crypto_kem_enc(uint8_t *ct, uint8_t *ss, const uint8_t *pk);
extern int PQCLEAN_MCELIECE6688128F_AVX2_crypto_kem_dec(uint8_t *ss, const uint8_t *ct, const uint8_t *sk);
#endif

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128f_keypair_derand(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
(void)public_key;
(void)secret_key;
(void)seed;
return OQS_ERROR;
#if defined(OQS_ENABLE_KEM_classic_mceliece_6688128f_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2) && OQS_CPU_has_extension(OQS_CPU_EXT_POPCNT) && OQS_CPU_has_extension(OQS_CPU_EXT_BMI1)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_MCELIECE6688128F_AVX2_crypto_kem_keypair_derand(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_MCELIECE6688128F_CLEAN_crypto_kem_keypair_derand(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_KEM_classic_mceliece_6688128f_keypair(uint8_t *public_key, uint8_t *secret_key) {
Expand Down
Loading