From 049f50b8764e9c85cc2227113b5790f9d739cb53 Mon Sep 17 00:00:00 2001 From: Douglas Stebila Date: Wed, 3 Oct 2018 11:41:34 -0400 Subject: [PATCH] Sync SIG common files on master with nist-branch --- src/sig/sig.c | 10 +++++----- src/sig/sig.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/sig/sig.c b/src/sig/sig.c index 263c0f67b..cd52288d4 100644 --- a/src/sig/sig.c +++ b/src/sig/sig.c @@ -28,7 +28,7 @@ OQS_API const char *OQS_SIG_alg_identifier(size_t i) { } } -OQS_SIG *OQS_SIG_new(const char *method_name) { +OQS_API OQS_SIG *OQS_SIG_new(const char *method_name) { if (0 == strcasecmp(method_name, OQS_SIG_alg_default)) { return OQS_SIG_new(OQS_SIG_DEFAULT); } else if (0 == strcasecmp(method_name, OQS_SIG_alg_qTESLA_I)) { @@ -91,7 +91,7 @@ OQS_SIG *OQS_SIG_new(const char *method_name) { } } -OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *secret_key) { if (sig == NULL || sig->keypair(public_key, secret_key) != OQS_SUCCESS) { return OQS_ERROR; } else { @@ -99,7 +99,7 @@ OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *sec } } -OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) { +OQS_API OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key) { if (sig == NULL || sig->sign(signature, signature_len, message, message_len, secret_key) != OQS_SUCCESS) { return OQS_ERROR; } else { @@ -107,7 +107,7 @@ OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signatur } } -OQS_STATUS OQS_SIG_verify(const OQS_SIG *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key) { +OQS_API OQS_STATUS OQS_SIG_verify(const OQS_SIG *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key) { if (sig == NULL || sig->verify(message, message_len, signature, signature_len, public_key) != OQS_SUCCESS) { return OQS_ERROR; } else { @@ -115,6 +115,6 @@ OQS_STATUS OQS_SIG_verify(const OQS_SIG *sig, const uint8_t *message, size_t mes } } -void OQS_SIG_free(OQS_SIG *sig) { +OQS_API void OQS_SIG_free(OQS_SIG *sig) { OQS_MEM_insecure_free(sig); } diff --git a/src/sig/sig.h b/src/sig/sig.h index 68ec78eb5..612af37e9 100644 --- a/src/sig/sig.h +++ b/src/sig/sig.h @@ -74,7 +74,7 @@ typedef struct OQS_SIG { /** Printable string representing the name of the signature scheme. */ const char *method_name; - /** The NIST security level (1, 2, 3, 4, 5) claimed for this algorithm. */ + /** The NIST security level (1, 2, 3, 4, 5) claimed in this algorithm's original NIST submission. */ uint8_t claimed_nist_level; /** Whether the signature offers EUF-CMA security (TRUE) or not (FALSE). */ @@ -142,7 +142,7 @@ typedef struct OQS_SIG { * @param[in] method_name Name of the desired algorithm; one of the names in `OQS_SIG_algs`. * @return An OQS_SIG for the particular algorithm, or `NULL` if the algorithm has been disabled at compile-time. */ -OQS_SIG *OQS_SIG_new(const char *method_name); +OQS_API OQS_SIG *OQS_SIG_new(const char *method_name); /** * Keypair generation algorithm. @@ -156,7 +156,7 @@ OQS_SIG *OQS_SIG_new(const char *method_name); * @param[out] secret_key The secret key represented as a byte string. * @return OQS_SUCCESS or OQS_ERROR */ -OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *secret_key); /** * Signature generation algorithm. @@ -173,7 +173,7 @@ OQS_STATUS OQS_SIG_keypair(const OQS_SIG *sig, uint8_t *public_key, uint8_t *sec * @param[in] secret_key The secret key represented as a byte string. * @return OQS_SUCCESS or OQS_ERROR */ -OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key); +OQS_API OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signature_len, const uint8_t *message, size_t message_len, const uint8_t *secret_key); /** * Signature verification algorithm. @@ -186,14 +186,14 @@ OQS_STATUS OQS_SIG_sign(const OQS_SIG *sig, uint8_t *signature, size_t *signatur * @param[in] public_key The public key represented as a byte string. * @return OQS_SUCCESS or OQS_ERROR */ -OQS_STATUS OQS_SIG_verify(const OQS_SIG *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); +OQS_API OQS_STATUS OQS_SIG_verify(const OQS_SIG *sig, const uint8_t *message, size_t message_len, const uint8_t *signature, size_t signature_len, const uint8_t *public_key); /** * Frees an OQS_SIG object that was constructed by OQS_SIG_new. * * @param[in] sig The OQS_SIG object to free. */ -void OQS_SIG_free(OQS_SIG *sig); +OQS_API void OQS_SIG_free(OQS_SIG *sig); #include #include