Skip to content

Commit

Permalink
run patches
Browse files Browse the repository at this point in the history
Signed-off-by: mraksoll4 <[email protected]>
  • Loading branch information
mraksoll4 committed Jan 2, 2025
1 parent 46998c8 commit a032e66
Show file tree
Hide file tree
Showing 103 changed files with 5,362 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/algorithms/sig/falcon.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
- **Authors' website**: https://falcon-sign.info
- **Specification version**: 20211101.
- **Primary Source**<a name="primary-source"></a>:
- **Source**: https://github.com/PQClean/PQClean/commit/1eacfdafc15ddc5d5759d0b85b4cef26627df181
- **Source**: https://github.com/PQClean/PQClean/commit/1eacfdafc15ddc5d5759d0b85b4cef26627df181 with copy_from_upstream patches
- **Implementation license (SPDX-Identifier)**: MIT
- **Optimized Implementation sources**: https://github.com/PQClean/PQClean/commit/1eacfdafc15ddc5d5759d0b85b4cef26627df181
- **Optimized Implementation sources**: https://github.com/PQClean/PQClean/commit/1eacfdafc15ddc5d5759d0b85b4cef26627df181 with copy_from_upstream patches
- **pqclean-aarch64**:<a name="pqclean-aarch64"></a>
- **Source**: https://github.com/PQClean/PQClean/commit/7707d1bcc8ae7f9ffd296dd13b1d76d2767d14f8
- **Implementation license (SPDX-Identifier)**: Apache-2.0
Expand Down
1 change: 1 addition & 0 deletions docs/algorithms/sig/falcon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ nist-round: 3
spec-version: 20211101
primary-upstream:
source: https://github.com/PQClean/PQClean/commit/1eacfdafc15ddc5d5759d0b85b4cef26627df181
with copy_from_upstream patches
spdx-license-identifier: MIT
upstream-ancestors:
- https://www.falcon-sign.info
Expand Down
36 changes: 36 additions & 0 deletions src/sig/cross/sig_cross.h

Large diffs are not rendered by default.

38 changes: 38 additions & 0 deletions src/sig/cross/sig_cross_rsdp_128_balanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_balanced_new(void) {
sig->length_signature = OQS_SIG_cross_rsdp_128_balanced_length_signature;

sig->keypair = OQS_SIG_cross_rsdp_128_balanced_keypair;
sig->keypair_from_fseed = OQS_SIG_cross_rsdp_128_balanced_keypair_from_fseed;
sig->pubkey_from_privkey = OQS_SIG_cross_rsdp_128_balanced_pubkey_from_privkey;
sig->sign = OQS_SIG_cross_rsdp_128_balanced_sign;
sig->verify = OQS_SIG_cross_rsdp_128_balanced_verify;
sig->sign_with_ctx_str = OQS_SIG_cross_rsdp_128_balanced_sign_with_ctx_str;
Expand All @@ -32,11 +34,15 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_balanced_new(void) {
}

extern int PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);

#if defined(OQS_ENABLE_SIG_cross_rsdp_128_balanced_avx2)
extern int PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);
#endif
Expand All @@ -57,6 +63,38 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_balanced_keypair(uint8_t *public_key,
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_balanced_keypair_from_fseed(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_balanced_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_balanced_pubkey_from_privkey(uint8_t *public_key, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_balanced_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_AVX2_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP128BALANCED_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_balanced_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_balanced_avx2)
#if defined(OQS_DIST_BUILD)
Expand Down
38 changes: 38 additions & 0 deletions src/sig/cross/sig_cross_rsdp_128_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_fast_new(void) {
sig->length_signature = OQS_SIG_cross_rsdp_128_fast_length_signature;

sig->keypair = OQS_SIG_cross_rsdp_128_fast_keypair;
sig->keypair_from_fseed = OQS_SIG_cross_rsdp_128_fast_keypair_from_fseed;
sig->pubkey_from_privkey = OQS_SIG_cross_rsdp_128_fast_pubkey_from_privkey;
sig->sign = OQS_SIG_cross_rsdp_128_fast_sign;
sig->verify = OQS_SIG_cross_rsdp_128_fast_verify;
sig->sign_with_ctx_str = OQS_SIG_cross_rsdp_128_fast_sign_with_ctx_str;
Expand All @@ -32,11 +34,15 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_fast_new(void) {
}

extern int PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);

#if defined(OQS_ENABLE_SIG_cross_rsdp_128_fast_avx2)
extern int PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);
#endif
Expand All @@ -57,6 +63,38 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_fast_keypair(uint8_t *public_key, uint
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_fast_keypair_from_fseed(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_fast_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_fast_pubkey_from_privkey(uint8_t *public_key, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_fast_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_AVX2_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP128FAST_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_fast_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_fast_avx2)
#if defined(OQS_DIST_BUILD)
Expand Down
38 changes: 38 additions & 0 deletions src/sig/cross/sig_cross_rsdp_128_small.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_small_new(void) {
sig->length_signature = OQS_SIG_cross_rsdp_128_small_length_signature;

sig->keypair = OQS_SIG_cross_rsdp_128_small_keypair;
sig->keypair_from_fseed = OQS_SIG_cross_rsdp_128_small_keypair_from_fseed;
sig->pubkey_from_privkey = OQS_SIG_cross_rsdp_128_small_pubkey_from_privkey;
sig->sign = OQS_SIG_cross_rsdp_128_small_sign;
sig->verify = OQS_SIG_cross_rsdp_128_small_verify;
sig->sign_with_ctx_str = OQS_SIG_cross_rsdp_128_small_sign_with_ctx_str;
Expand All @@ -32,11 +34,15 @@ OQS_SIG *OQS_SIG_cross_rsdp_128_small_new(void) {
}

extern int PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);

#if defined(OQS_ENABLE_SIG_cross_rsdp_128_small_avx2)
extern int PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);
#endif
Expand All @@ -57,6 +63,38 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_small_keypair(uint8_t *public_key, uin
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_small_keypair_from_fseed(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_small_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_small_pubkey_from_privkey(uint8_t *public_key, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_small_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_AVX2_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP128SMALL_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_128_small_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_128_small_avx2)
#if defined(OQS_DIST_BUILD)
Expand Down
38 changes: 38 additions & 0 deletions src/sig/cross/sig_cross_rsdp_192_balanced.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_balanced_new(void) {
sig->length_signature = OQS_SIG_cross_rsdp_192_balanced_length_signature;

sig->keypair = OQS_SIG_cross_rsdp_192_balanced_keypair;
sig->keypair_from_fseed = OQS_SIG_cross_rsdp_192_balanced_keypair_from_fseed;
sig->pubkey_from_privkey = OQS_SIG_cross_rsdp_192_balanced_pubkey_from_privkey;
sig->sign = OQS_SIG_cross_rsdp_192_balanced_sign;
sig->verify = OQS_SIG_cross_rsdp_192_balanced_verify;
sig->sign_with_ctx_str = OQS_SIG_cross_rsdp_192_balanced_sign_with_ctx_str;
Expand All @@ -32,11 +34,15 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_balanced_new(void) {
}

extern int PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);

#if defined(OQS_ENABLE_SIG_cross_rsdp_192_balanced_avx2)
extern int PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);
#endif
Expand All @@ -57,6 +63,38 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_balanced_keypair(uint8_t *public_key,
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_balanced_keypair_from_fseed(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_192_balanced_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_balanced_pubkey_from_privkey(uint8_t *public_key, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_192_balanced_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_AVX2_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP192BALANCED_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_balanced_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_192_balanced_avx2)
#if defined(OQS_DIST_BUILD)
Expand Down
38 changes: 38 additions & 0 deletions src/sig/cross/sig_cross_rsdp_192_fast.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_fast_new(void) {
sig->length_signature = OQS_SIG_cross_rsdp_192_fast_length_signature;

sig->keypair = OQS_SIG_cross_rsdp_192_fast_keypair;
sig->keypair_from_fseed = OQS_SIG_cross_rsdp_192_fast_keypair_from_fseed;
sig->pubkey_from_privkey = OQS_SIG_cross_rsdp_192_fast_pubkey_from_privkey;
sig->sign = OQS_SIG_cross_rsdp_192_fast_sign;
sig->verify = OQS_SIG_cross_rsdp_192_fast_verify;
sig->sign_with_ctx_str = OQS_SIG_cross_rsdp_192_fast_sign_with_ctx_str;
Expand All @@ -32,11 +34,15 @@ OQS_SIG *OQS_SIG_cross_rsdp_192_fast_new(void) {
}

extern int PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);

#if defined(OQS_ENABLE_SIG_cross_rsdp_192_fast_avx2)
extern int PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_keypair(uint8_t *pk, uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_keypair_from_fseed(uint8_t *pk, uint8_t *sk, const uint8_t *seed);
extern int PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_pubkey_from_privkey(uint8_t *pk, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_signature(uint8_t *sig, size_t *siglen, const uint8_t *m, size_t mlen, const uint8_t *sk);
extern int PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_verify(const uint8_t *sig, size_t siglen, const uint8_t *m, size_t mlen, const uint8_t *pk);
#endif
Expand All @@ -57,6 +63,38 @@ OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_fast_keypair(uint8_t *public_key, uint
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_fast_keypair_from_fseed(uint8_t *public_key, uint8_t *secret_key, const uint8_t *seed) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_192_fast_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_keypair_from_fseed(public_key, secret_key, seed);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_fast_pubkey_from_privkey(uint8_t *public_key, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_192_fast_avx2)
#if defined(OQS_DIST_BUILD)
if (OQS_CPU_has_extension(OQS_CPU_EXT_AVX2)) {
#endif /* OQS_DIST_BUILD */
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_AVX2_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#if defined(OQS_DIST_BUILD)
} else {
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
}
#endif /* OQS_DIST_BUILD */
#else
return (OQS_STATUS) PQCLEAN_CROSSRSDP192FAST_CLEAN_crypto_sign_pubkey_from_privkey(public_key, secret_key);
#endif
}

OQS_API OQS_STATUS OQS_SIG_cross_rsdp_192_fast_sign(uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) {
#if defined(OQS_ENABLE_SIG_cross_rsdp_192_fast_avx2)
#if defined(OQS_DIST_BUILD)
Expand Down
Loading

0 comments on commit a032e66

Please sign in to comment.