From eb55cbc991ae01a858e8becf8246719415375d30 Mon Sep 17 00:00:00 2001 From: Vlad Gheorghiu Date: Tue, 14 Jan 2025 17:45:48 -0500 Subject: [PATCH] Version 0.12.0 Signed-off-by: Vlad Gheorghiu --- README.md | 4 ++-- include/oqs_cpp.hpp | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e034293..69ccdf3 100644 --- a/README.md +++ b/README.md @@ -15,8 +15,8 @@ C library, which is a C library for quantum-resistant cryptographic algorithms. The wrapper is written in standard C++11, hence in the following it is assumed that you have access to a C++11 compliant compiler. liboqs-cpp has been -extensively tested on Linux, macOS and Windows platforms. Continuous integration -is provided via GitHub actions. +extensively tested on Linux, macOS, FreeBSD and Windows platforms. Continuous +integration is provided via GitHub actions. The project contains the following files and directories: diff --git a/include/oqs_cpp.hpp b/include/oqs_cpp.hpp index 64bc81f..6212ffb 100644 --- a/include/oqs_cpp.hpp +++ b/include/oqs_cpp.hpp @@ -655,6 +655,10 @@ class Signature { * \return Message signature */ bytes sign_with_ctx_str(const bytes& message, const bytes& context) const { + if (!context.empty() && !alg_details_.sig_with_ctx_support) + throw std::runtime_error( + "Signing with context string not supported"); + if (secret_key_.size() != alg_details_.length_secret_key) throw std::runtime_error( "Incorrect secret key length, make sure you " @@ -710,6 +714,10 @@ class Signature { bool verify_with_ctx_str(const bytes& message, const bytes& signature, const bytes& context, const bytes& public_key) const { + if (!context.empty() && !alg_details_.sig_with_ctx_support) + throw std::runtime_error( + "Verifying with context string not supported"); + if (public_key.size() != alg_details_.length_public_key) throw std::runtime_error("Incorrect public key length");