Skip to content

Commit cc470a4

Browse files
fix(ci): guard PME boundary test behind SIGNET_ENABLE_COMMERCIAL
test_boundary_constants.cpp included signet/crypto/pme.hpp unconditionally, which emits a hard #error outside the commercial tier. The CI Ubuntu / Windows MSVC / UBSan / Mutation Testing jobs all build with the non-commercial 'ci' preset and were failing with C1189 / #error. Guarded the PME include, the pme namespace alias, and the §BV-09 PME TEST_CASE behind #if defined(SIGNET_ENABLE_COMMERCIAL) && SIGNET_ENABLE_COMMERCIAL, matching the pattern already used in test_interop.cpp and test_encryption.cpp. Verified locally: - non-commercial build: 13/13 boundary cases pass - commercial build: 14/14 boundary cases pass (§BV-09 included)
1 parent 15c490c commit cc470a4

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

tests/test_boundary_constants.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
#include <catch2/catch_test_macros.hpp>
1212
#include "signet/crypto/sha256.hpp"
1313
#include "signet/crypto/aes_core.hpp"
14+
#if defined(SIGNET_ENABLE_COMMERCIAL) && SIGNET_ENABLE_COMMERCIAL
1415
#include "signet/crypto/pme.hpp"
16+
#endif
1517

1618
#include <cstdint>
1719
#include <array>
@@ -20,7 +22,9 @@
2022
using namespace signet::forge::crypto;
2123
namespace sha = signet::forge::crypto::detail::sha256;
2224
namespace aes = signet::forge::crypto::detail::aes;
25+
#if defined(SIGNET_ENABLE_COMMERCIAL) && SIGNET_ENABLE_COMMERCIAL
2326
namespace pme = signet::forge::crypto::detail::pme;
27+
#endif
2428

2529
// ═══════════════════════════════════════════════════════════════════════
2630
// §BV-01: SHA-256 Initial Hash Values (FIPS 180-4 §5.3.3)
@@ -155,9 +159,10 @@ TEST_CASE("§BV-08 GF(2^8) multiplication identities", "[boundary][constants]")
155159
}
156160

157161
// ═══════════════════════════════════════════════════════════════════════
158-
// §BV-09: PME Constants
162+
// §BV-09: PME Constants (commercial tier only)
159163
// ═══════════════════════════════════════════════════════════════════════
160164

165+
#if defined(SIGNET_ENABLE_COMMERCIAL) && SIGNET_ENABLE_COMMERCIAL
161166
TEST_CASE("§BV-09 PME key and module type constants", "[boundary][constants]") {
162167
REQUIRE(PME_REQUIRED_KEY_SIZE == 32); // AES-256
163168
REQUIRE(signet::forge::crypto::PME_AES128_KEY_SIZE == 16); // AES-128 (for AAD)
@@ -171,6 +176,7 @@ TEST_CASE("§BV-09 PME key and module type constants", "[boundary][constants]")
171176
for (int j = i+1; j < 4; ++j)
172177
REQUIRE(mods[i] != mods[j]);
173178
}
179+
#endif
174180

175181
// ═══════════════════════════════════════════════════════════════════════
176182
// §BV-10: SHA-256 rotr at boundary rotations

0 commit comments

Comments
 (0)