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
10 changes: 10 additions & 0 deletions src/sig/sig.c
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,16 @@ OQS_API OQS_STATUS OQS_SIG_verify_with_ctx_str(const OQS_SIG *sig, const uint8_t
}
}

OQS_API bool OQS_SIG_supports_ctx_str(const char *alg_name) {
OQS_SIG *sig = OQS_SIG_new(alg_name);
if (sig == NULL) {
return false;
}
bool result = sig->sig_with_ctx_support;
OQS_SIG_free(sig);
return result;
}

OQS_API void OQS_SIG_free(OQS_SIG *sig) {
OQS_MEM_insecure_free(sig);
}
8 changes: 8 additions & 0 deletions src/sig/sig.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,14 @@ OQS_API OQS_STATUS OQS_SIG_verify_with_ctx_str(const OQS_SIG *sig, const uint8_t
*/
OQS_API void OQS_SIG_free(OQS_SIG *sig);

/**
* Indicates whether the specified signature algorithm supports signing with a context string.
*
* @param[in] alg_name Name of the desired algorithm; one of the names in `OQS_SIG_algs`.
* @return true if the algorithm supports context string signing, false otherwise.
*/
OQS_API bool OQS_SIG_supports_ctx_str(const char *alg_name);

///// OQS_COPY_FROM_UPSTREAM_FRAGMENT_INCLUDE_START
#ifdef OQS_ENABLE_SIG_DILITHIUM
#include <oqs/sig_dilithium.h>
Expand Down
Loading