← Research WP-02 Security Engineers · Deployment Architects

PME — Engineering the Polymorphic Mutation Engine

Implementation deep-dive: five core subsystems, all five production TEE adapters, 3-line integration API, and 683-test validation methodology

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.

Patent Notice

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

MutationEngineCore(KaliCore)EntropyManagerSENSORYChaCha20-DRBG · health-gatedper-target independent slicesCryptoAuditLoggerMEMORYSHA3-256 chaintamper-evident append-onlyStateTrackerGUARDIANCheckpoint · rollbackPost-mutation validationSchedulerEXECUTORPriority queue · cooldownMutation storm preventionMutationTargetRegistryPLUGIN INTERFACE3-line API · 11 profilesHot-swap capableAll five subsystems communicate only through MutationEngineCore — no subsystem bypasses another.
Figure 1: PME Five-Subsystem Architecture — all subsystems communicate only through MutationEngineCore
SubsystemResponsibilityKey Guarantee
EntropyManagerSupplies cryptographic entropy to each cycleStatistical independence across all targets
CryptoAuditLoggerMaintains SHA3-256 chained mutation historyTamper-evidence: any modification invalidates subsequent records
StateTrackerCryptographic checkpointing and atomic rollbackPartial mutations structurally impossible
SchedulerTrigger management, priority queuing, cooldown enforcementKali Invariant cannot be starved or bypassed
MutationTarget RegistryPlugin interface for all 11 mutation profilesProfile 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):

  1. Fingerprint change: assert fp_after != fp_before
  2. Hamming distance: assert hamming(fp_after, fp_before) ≥ 128 bits
  3. Profile validity: assert target.validate(fp_after) == true

5. Scheduler — Trigger Management

TriggerSourcePriorityCooldown
PerInvocationApplication API callNormalNone
TimerInternal interval schedulerNormalConfigurable per profile
AnomalyEWMA score threshold breachHighShort — rapid escalation
PeerSignalASMP-MSG-003 from peer nodeHighShort — estate coordination
ManualManagement console / APIHighestNone — 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 3

Swapping 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

PME APPLICATION LAYERProfile selection · 3-line APITEE ADAPTER TRAIT (Rust)Single interface — adapter-agnosticPRODUCTION ADAPTERS — ALL 5 READYMockTEEAdapterDev · CI/CDDeterministicSGXTEEAdapterIntel SGXEPID/DCAPNitroTEEAdapterAWS NitroPCR-attestSEVSNPTEEAdapterAMD SEV-SNPVM attestARMCCATEEAdapterARM CCARealm attestSwapping adapters requires changing one constructor parameter — no profile or engine changes.
Figure 2: TEE Adapter Stack — all five production-ready adapters
AdapterPlatformAttestation MechanismStatus
MockTEEAdapterAny platformDeterministic mock quotes✅ Production-ready
SGXTEEAdapterIntel SGX (x86_64)EPID/DCAP remote attestation✅ Production-ready
NitroTEEAdapterAWS Nitro EnclavesPCR-based attestation✅ Production-ready
SEVSNPTEEAdapterAMD SEV-SNPVM-level hardware attestation✅ Production-ready
ARMCCATEEAdapterARM CCA (Realm)Realm attestation token✅ Production-ready
Full TEE Coverage

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_benchmark
Test Results

683 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).

Read the full formatted version:

Download PDF ← All Papers