Skip to content

Commit 7e293be

Browse files
committed
Version 0.12.0 (#24)
Signed-off-by: Vlad Gheorghiu <vsoftco@gmail.com>
1 parent eb55cbc commit 7e293be

File tree

5 files changed

+12
-9
lines changed

5 files changed

+12
-9
lines changed

CHANGES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Version 0.12.0 - January 14, 2025
1+
# Version 0.12.0 - January 15, 2025
22

33
- Fixes https://github.com/open-quantum-safe/liboqs-cpp/issues/21. The API that
44
NIST has introduced in [FIPS 204](https://csrc.nist.gov/pubs/fips/204/final)
@@ -8,6 +8,7 @@
88
const bytes& context) const`
99
- `bool Signature::verify_with_ctx_str(const bytes& message,
1010
const bytes& signature, const bytes& context, const bytes& public_key) const`
11+
- Updated examples to use `ML-KEM` and `ML-DSA` as the defaults
1112

1213
# Version 0.10.0 - March 27, 2024
1314

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ See in particular limitations on intended use.
2424

2525
## Release notes
2626

27-
This release of liboqs-cpp was released on January 14, 2025. Its release page
27+
This release of liboqs-cpp was released on January 15, 2025. Its release page
2828
on GitHub is
2929
https://github.com/open-quantum-safe/liboqs-cpp/releases/tag/0.12.0.
3030

examples/kem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main() {
1414
std::cout << "liboqs-cpp version: " << oqs::oqs_cpp_version() << '\n';
1515
std::cout << "Enabled KEMs:\n" << oqs::KEMs::get_enabled_KEMs();
1616

17-
std::string kem_name = "Kyber512";
17+
std::string kem_name = "ML-KEM-512";
1818
oqs::KeyEncapsulation client{kem_name};
1919
std::cout << "\n\nKEM details:\n" << client.get_details();
2020

examples/sig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ int main() {
1414
std::cout << "Enabled signatures:\n" << oqs::Sigs::get_enabled_sigs();
1515

1616
oqs::bytes message = "This is the message to sign"_bytes;
17-
std::string sig_name = "Dilithium2";
17+
std::string sig_name = "ML-DSA-44";
1818
oqs::Signature signer{sig_name};
1919
std::cout << "\n\nSignature details:\n" << signer.get_details();
2020

unit_tests/tests/test_kem.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,20 @@ void test_kem_wrong_ciphertext(const std::string& kem_name) {
5252
oqs::bytes wrong_ciphertext = oqs::rand::randombytes(ciphertext.size());
5353
oqs::bytes shared_secret_client;
5454
try {
55+
// this line should throw
5556
shared_secret_client = client.decap_secret(wrong_ciphertext);
57+
// if not, test should fail
58+
bool is_valid = (shared_secret_client == shared_secret_server);
59+
if (is_valid)
60+
std::cerr << kem_name << ": shared secrets should not coincide"
61+
<< std::endl;
62+
EXPECT_FALSE(is_valid);
5663
} catch (std::exception& e) {
5764
if (e.what() == std::string{"Can not decapsulate secret"})
5865
return;
5966
else
6067
throw; // this is another un-expected exception
6168
}
62-
bool is_valid = (shared_secret_client == shared_secret_server);
63-
if (is_valid)
64-
std::cerr << kem_name << ": shared secrets should not coincide"
65-
<< std::endl;
66-
EXPECT_FALSE(is_valid);
6769
}
6870

6971
TEST(oqs_KeyEncapsulation, Correctness) {

0 commit comments

Comments
 (0)