Abstract
The Polymorphic Mutation Engine (PME) is the production reference implementation of ACSE. This paper describes the engineering decisions behind its five core subsystems, the 3-line integration API, the complete production TEE adapter stack (all five adapters across all major hardware-rooted security environments), and the test and benchmark methodology validating the Kali Invariant across 683 automated tests.
PME is implemented in Rust — chosen for ownership-model memory safety. Zero unsafe blocks exist in the engine core, eliminating the class of memory vulnerabilities responsible for the majority of critical security flaws in C/C++ cryptographic implementations.
PME and all architectural concepts described in this paper are covered by Indian Patent Published · IN202641070690 · 19/06/2026 filed by Arul Raj.
1. Five-Subsystem Architecture
| Subsystem | Responsibility | Key Guarantee |
|---|---|---|
| EntropyManager | Supplies cryptographic entropy to each cycle | Statistical independence across all targets |
| CryptoAuditLogger | Maintains SHA3-256 chained mutation history | Tamper-evidence: any modification invalidates subsequent records |
| StateTracker | Cryptographic checkpointing and atomic rollback | Partial mutations structurally impossible |
| Scheduler | Trigger management, priority queuing, cooldown enforcement | Kali Invariant cannot be starved or bypassed |
| MutationTarget Registry | Plugin interface for all 11 mutation profiles | Profile swap requires changing one word |
2. EntropyManager
2.1 ChaCha20-DRBG Pool
The EntropyManager maintains a ChaCha20-DRBG entropy pool seeded from the OS CSPRNG. ChaCha20-DRBG is chosen over CTR-DRBG for its cache-timing side-channel resistance — critical when PME is deployed on hardware partially observable to an attacker. The pool is health-gated with NIST SP 800-90B continuous tests.
2.2 Per-Target Entropy Slicing
Multiple registered targets share the same pool but receive statistically independent slices:
entropy_for_target = SHA3-256(entropy_bundle || target_id || cycle_seq)SHA3-256 preimage resistance guarantees that entropy slices for any two targets are computationally independent even if the attacker observes one target's slice.
3. CryptoAuditLogger
3.1 SHA3-256 Chain Construction
Each audit record contains: UUID, timestamp (nanoseconds), profile ID, pre-mutation fingerprint, post-mutation fingerprint, entropy hash (not the entropy itself), trigger reason, TEE attestation quote, and:
chain_hash[N] = SHA3-256(chain_hash[N-1] || all_record_fields[N])Chain verification is O(N) — a single forward pass. Any modification to any record changes its chain hash, invalidating all subsequent records.
3.2 TEE-Bound Records
In production deployment, each record carries a TEE attestation quote binding it to the hardware platform that produced it. A record that cannot be verified against the expected attestation is treated as suspect regardless of chain hash validity — preventing an attacker from substituting a complete fake log.
4. StateTracker — Atomic Rollback
Before every mutation, StateTracker creates a cryptographic checkpoint: current fingerprint, chain hash, cycle sequence number, and TEE-attested timestamp. If Phase 3 validation fails, rollback to the checkpoint is atomic. The audit log receives a ROLLBACK record documenting the failure.
Post-mutation invariant checks (all three must pass or rollback):
- Fingerprint change: assert fp_after != fp_before
- Hamming distance: assert hamming(fp_after, fp_before) ≥ 128 bits
- Profile validity: assert target.validate(fp_after) == true
5. Scheduler — Trigger Management
| Trigger | Source | Priority | Cooldown |
|---|---|---|---|
| PerInvocation | Application API call | Normal | None |
| Timer | Internal interval scheduler | Normal | Configurable per profile |
| Anomaly | EWMA score threshold breach | High | Short — rapid escalation |
| PeerSignal | ASMP-MSG-003 from peer node | High | Short — estate coordination |
| Manual | Management console / API | Highest | None — operator override |
Burst coalescing prevents mutation storms: multiple high-priority triggers within a configurable window are merged into a single cycle. The Kali Invariant is maintained; thrashing is prevented.
6. MutationTarget Registry — 3-Line API
Any Rust application gains full ACSE protection with three lines:
let mut engine = MutationEngineCore::new(tee_adapter); // Line 1
engine.register(Box::new(SquidShieldTarget::new("payments")), "fin"); // Line 2
engine.trigger_mutation(TriggerReason::PerInvocation, None); // Line 3Swapping profiles or adding multiple profiles requires only changing the registration call — no application code changes needed. KaliCoreTarget (Profile 0xFF) fans out to all registered profiles simultaneously.
7. TEE Adapter Stack — All Five Production-Ready
| Adapter | Platform | Attestation Mechanism | Status |
|---|---|---|---|
| MockTEEAdapter | Any platform | Deterministic mock quotes | ✅ Production-ready |
| SGXTEEAdapter | Intel SGX (x86_64) | EPID/DCAP remote attestation | ✅ Production-ready |
| NitroTEEAdapter | AWS Nitro Enclaves | PCR-based attestation | ✅ Production-ready |
| SEVSNPTEEAdapter | AMD SEV-SNP | VM-level hardware attestation | ✅ Production-ready |
| ARMCCATEEAdapter | ARM CCA (Realm) | Realm attestation token | ✅ Production-ready |
The five-adapter stack covers every major enterprise TEE environment. An organisation deploying PME on any supported platform has a production-ready, hardware-attested audit chain out of the box. Swapping adapters requires changing one constructor parameter — no profile or engine changes.
8. Testing Methodology — 683 Tests
- Unit tests: isolated subsystem tests covering every code path
- Profile tests: per-profile Kali Invariant enforcement, fingerprint uniqueness, rollback
- Integration tests: end-to-end 4-phase cycles across all profiles and all 5 TEE adapters
- Chain verification tests: audit chain integrity, tamper detection, rollback re-verify
- Red team simulation: 6 automated scenarios including linkability attack and Forced Twitch detection
All benchmarks are Criterion p50 medians: 100 samples, 3-second warmup, --release build. Reproducible with:
cargo bench --bench mutation_benchmark683 tests · 0 failures · 0 warnings · 0 clippy errors at current HEAD.
9. pme-console Management Interface
The pme-console is an Actix-Web management interface (port 8888) providing six operational tabs: Profile Dashboard, Mutation History (SHA3-256 chain viewer), Anomaly Telemetry, ASMP Peer Network, KaliCoreTarget Control, and Demo Harness (Tab 6 — 11-step dual-panel attack simulation for CERT-In and enterprise evaluation).