Cryptographic Compliance Profiles
Audience: Security Guild, crypto/platform engineers, compliance reviewers, operators deploying into regulated regions. Scope: The cryptographic compliance-profile model — how StellaOps selects region-appropriate hash, HMAC, and password-hashing algorithms by purpose, the certification status of each profile, and the sanctioned interoperability escapes.
Related: Crypto profile configuration (how to select profiles, providers, and simulators) · Password hashing · Trust and signing.
StellaOps selects cryptographic algorithms by purpose rather than by name, resolving each request through the active compliance profile. This lets a single deployment satisfy a regional regulatory baseline (FIPS, eIDAS, GOST, SM, KCMVP) while keeping a fixed set of interoperability escapes for external systems that expect SHA-256.
Overview
StellaOps supports multiple cryptographic compliance profiles to meet regional regulatory requirements:
| Profile | Standard | Region | Use Case |
|---|---|---|---|
world | ISO/Default | International | Default profile, uses BLAKE3 for graph hashing |
fips | FIPS 140-3 | US Federal | US government and contractors |
gost | GOST R 34.11-2012 | Russia | Russian Federation compliance |
sm | GB/T 32905-2016 | China | Chinese national standards |
kcmvp | KCMVP | South Korea | Korean cryptographic validation |
eidas | eIDAS/ETSI TS 119 312 | European Union | EU digital identity and trust |
Certification caveats (current baselines)
fipsandeidasnow route through software allow-listed providers (fips.ecdsa.soft,eu.eidas.soft) and are labeled non-certified until a CMVP/QSCD module is attached (setFIPS_SOFT_ALLOWED=1/EIDAS_SOFT_ALLOWED=1).kcmvpis covered by a hash-only baseline provider (kr.kcmvp.hash, SHA-256) with theKCMVP_HASH_ALLOWEDgate; ARIA/SEED/KCDSA remain pending.gosthas a Linux-ready OpenSSL baseline plus a Wine sidecar for CryptoPro CSP (ru.winecsp.http); native Windows CSP stays blocked on licensed runners.smuses software SM2/SM3 (cn.sm.soft, gateSM_SOFT_ALLOWED=1); hardware PKCS#11 validation remains pending.pquses software-only Dilithium3 and Falcon512 (pq.soft, gatePQ_SOFT_ALLOWED=1); certified PQ modules are not available.
Provider identifiers (registry names)
- FIPS:
fips.ecdsa.soft - eIDAS:
eu.eidas.soft - KCMVP hash baseline:
kr.kcmvp.hash - PQ (Dilithium3/Falcon512):
pq.soft - RU GOST (Wine sidecar):
ru.winecsp.http - CN SM software:
cn.sm.soft
Configuration
The active profile and validation behavior are bound from the Crypto:Compliance configuration section, with an environment-variable override for the profile ID. The profile defaults to world and strict validation is on by default.
Authoritative option shape (section key, env-var names, defaults, strict/warn flags, per-purpose overrides): src/__Libraries/StellaOps.Cryptography/CryptoComplianceOptions.cs.
Hash Algorithm Mapping
Components request hashing by purpose, not by algorithm; the platform resolves the concrete algorithm from the active profile. The purpose set is Graph, Symbol, Content, Merkle, Attestation, Interop, and Secret. The general shape:
Graphdefaults to BLAKE3-256 underworld(fast, parallelizable content-addressing); all other purposes default to SHA-256 underworld/fips/kcmvp/eidas.gostsubstitutes GOST R 34.11-2012 (Stribog-256),smsubstitutes SM3, for all content-style purposes.Secretderives via Argon2id everywhere exceptfips, which uses PBKDF2-SHA256.Interopalways resolves to SHA-256 regardless of profile to guarantee compatibility with external tools; every use of this purpose must be documented with justification.
Authoritative purpose definitions and the per-profile mapping live in the XML docs of src/__Libraries/StellaOps.Cryptography/HashPurpose.cs (algorithm constants in HashAlgorithms.cs).
HMAC Algorithm Mapping
HMAC uses the same purpose-based selection as hashing. The purposes are Signing (DSSE envelopes, MACs), Authentication (signed URLs, ack tokens), and WebhookInterop. Shape:
SigningandAuthenticationresolve to HMAC-SHA256 underworld/fips/kcmvp/eidas, HMAC-GOST3411 undergost, and HMAC-SM3 undersm.WebhookInteropalways resolves to HMAC-SHA256 regardless of profile — required for external webhook receivers (Slack, Teams, GitHub, etc.) that expect SHA-256 signatures.
Authoritative purpose definitions and the per-profile mapping live in the XML docs of src/__Libraries/StellaOps.Cryptography/HmacPurpose.cs (algorithm constants in HmacAlgorithms.cs).
Simulation paths when hardware is missing
- RU / GOST: Linux baseline uses
ru.openssl.gost; CryptoPro CSP can be exercised via the native Linux CSP service (CryptoPro deb bundles, no Wine) when customers supply the installer. Windows CSP remains blocked until licensed runners are available. - CN / SM2: Software baseline (
cn.sm.soft) plus a containerized remote microservice (cn.sm.remote.http) that simulates SM2 signing/verification; swap the endpoint to a hardware-backed service when licensed hardware is provided. - CN / SM: Software-only SM2/SM3 provider (
cn.sm.soft) backed by BouncyCastle; enable withSM_SOFT_ALLOWED=1. Hardware PKCS#11 tokens can be added later without changing feature code because hosts resolve viaICryptoProviderRegistry. - FIPS / eIDAS: Software allow-lists (
fips.ecdsa.soft,eu.eidas.soft) enforce ES256/ES384 + SHA-2. They are labeled non-certified until a CMVP/QSCD module is supplied. - KCMVP: Hash-only baseline (
kr.kcmvp.hash) keeps SHA-256 available when ARIA/SEED/KCDSA hardware is absent. - PQ (Dilithium3/Falcon512): Software-only
pq.softprovider using BouncyCastle PQC primitives; gated byPQ_SOFT_ALLOWED=1. Certified PQ hardware is not yet available. Deterministic test vectors live insrc/__Libraries/StellaOps.Cryptography.Tests/PqSoftCryptoProviderTests.cs(fixed seeds/keys) andetc/rootpack/pq-vectors.txtfor offline verification.
Interoperability Exceptions
Certain operations must use SHA-256 (or HMAC-SHA256) regardless of the active compliance profile to maintain external compatibility. These are the only sanctioned escapes from profile enforcement, and each call site is expected to opt in explicitly via the Interop/WebhookInterop purposes.
Representative exception classes:
- Hash — Sigstore/Rekor transparency-log digests, OCI image digest computation, CycloneDX/SPDX SBOM export, and third-party webhook payloads.
- HMAC — outbound webhook signatures (e.g.
DefaultWebhookSecurityService) and third-party integrations whose API specs mandate SHA-256.
Interop call sites are marked in source with [CryptoInteropAllowed] (see src/__Libraries/StellaOps.Cryptography/Interop/), which is the authoritative inventory of exceptions.
Code Usage
Services take a constructor dependency on ICryptoHash or ICryptoHmac and call the *ForPurpose(...) methods, passing a HashPurpose/HmacPurpose constant rather than naming an algorithm. The platform resolves the profile-appropriate algorithm at runtime; Interop/WebhookInterop purposes force SHA-256. HMAC verification uses constant-time comparison.
Interface contracts: src/__Libraries/StellaOps.Cryptography/ICryptoHash.cs and ICryptoHmac.cs. For unit tests, build instances with the DefaultCryptoHash.CreateForTests() / DefaultCryptoHmac.CreateForTests() factory methods (DefaultCryptoHash.cs, DefaultCryptoHmac.cs).
Supported Algorithms
The platform exposes a fixed set of digest, HMAC, and password-hashing primitives, all 256-bit / 32-byte outputs in active use:
- Hash: BLAKE3-256 (graph content-addressing under
world), SHA-256 (FIPS 180-4; the broad default), GOST R 34.11-2012 Stribog (gost), SM3 (sm). SHA-384/512 are defined but reserved for future use. - HMAC: HMAC-SHA256 (FIPS 198-1; broad default), HMAC-GOST3411 (
gost), HMAC-SM3 (sm). HMAC-SHA384/512 are reserved. - Password hashing: Argon2id (RFC 9106) everywhere except
fips, which uses PBKDF2-SHA256.
The authoritative algorithm-identifier constants live in src/__Libraries/StellaOps.Cryptography/ — HashAlgorithms.cs, HmacAlgorithms.cs, and PasswordHashAlgorithms.cs.
Security Considerations
Algorithm Agility: The purpose-based abstraction allows algorithm upgrades without code changes.
Constant-Time Comparison: All HMAC verification uses
CryptographicOperations.FixedTimeEquals()to prevent timing attacks.Key Derivation: HKDF is used where appropriate for deriving keys from shared secrets.
Interop Safety: External-facing operations are locked to SHA-256/HMAC-SHA256 to prevent protocol confusion.
Profile Isolation: Each deployment uses exactly one profile; mixed-profile operation is not supported.
Testing Cryptographic Randomness
All tests in this repository that assert on cryptographic-randomness output (CSPRNG draws, Shamir share bytes, generated key material) follow the chi-square + Shannon-entropy pattern documented in TESTING_PRACTICES.md “Asserting on randomness”. Equality-based “shares should be different” assertions are forbidden; they have a measurable false-positive rate and produce flaky CI without protecting against real regressions. The reference implementation lives in src/Cryptography/__Tests/StellaOps.Cryptography.Tests/ShamirSecretSharingTests.cs.
Related Documents
- Password Hashing - Credential storage standards
- Trust and Signing - Signing key management
- Crypto Registry Decision - Provider architecture
- Crypto Routing Audit - Audit trail
- Testing Practices: Asserting on randomness - Statistical-test methodology for randomness assertions (chi-square, Shannon entropy, Pearson correlation)
