Zen Software / Apple Internal Investigator
Technical and layperson-oriented analysis · October 6, 2026← All papers

Comprehensive Technical & Layman's Analysis of Secure Enclave Processor (SEP) Test Artifacts

This report provides a granular technical examination, disambiguation, and layman's translation of the Secure Enclave Processor (SEP) test frameworks, provisioning protocols, and display/thermal calibration systems documented in the Apple Internal iOS 12.1.1 (Build 16C49) artifact corpora (XsMax_12.1.1_JF36/AppleInternal/CoreOS/AppleSEP/unit_tests/).


1. Executive Summary & Scope

The Secure Enclave Processor (SEP) is a hardware-isolated coprocessor embedded in Apple SoCs responsible for handling sensitive cryptographic operations, key management, biometric authentication data (Touch ID / Face ID), and factory provisioning.

Within the audited internal artifact repository, two primary SEP test frameworks are exposed under AppleInternal/CoreOS/AppleSEP/unit_tests/:

  1. SIGPROV (Signal Provisioning / Maha): HSM (Hardware Security Module) emulation scripts and cryptographic test vectors for secure device fusing and credential injection.
  2. Hilo / LTH (Lightweight Thermal / Display Calibration): 17 shell scripts and calibration binary test vectors verifying display color/gain state accumulation, compression, rate limiting, secure backup, and attested cross-device transfer.

2. Category 1: SEP Provisioning, HSM Emulation & Cryptographic Fusing (SIGPROV / Maha)

2.1 Overview and Protocol Flow

Located at <$>/SiProvisioning/siprov_HSM_emulator/, the provisioning framework revolves around siprov_HSM_emulator.sh (21,863 bytes) and supporting cryptographic artifacts (d-maha-s.pem, q-maha-s.der, d-maha-e.pem, q-maha-e.der2, kgengid3b.txt, and private fuse vector binaries).

The test harness simulates an HSM orchestrating an eight-message provisioning protocol across several operational stages:


2.2 Cryptographic Primitives & Key Derivation

Technical Analysis

Layman's Translation

Imagine two secure vaults (the factory server "Maha" and the device's Secure Enclave "SEP") needing to exchange ultra-sensitive manufacturing data (fuses).

  1. Handshake: They perform a secure mathematical handshake (ECDH) to establish a shared secret without sending it over the wire.
  2. Key Mixing: They mix this secret with a master seed (kgengid3b) using a mathematical blender (HMAC) to manufacture specific, single-purpose keys.
  3. Directional Locking: To prevent mix-ups, messages sent from SEP to Maha are hashed with their inputs in one order, while messages from Maha to SEP reverse that exact order.
  4. Encrypted Delivery: The actual fuse data is locked inside a standard cryptographic box (AES-256-CBC) accompanied by a digital tamper-evident seal (MAC).

2.3 Private Fuse Values ASN.1 Schemas

The payload files (privatefusevalues.bin.*) encode structured fuse provisioning blocks in ASN.1 DER format:

Key Finding: The leading 48-byte OCTET STRING acts as a provenance/partitioning tag grouping vectors (e.g., .personalization and .hdcp22 share one prefix; .hdcp13 and .hdcp13.hdcp22 share another), rather than representing a fixed static magic constant.


3. Category 2: Hilo & Lightweight Thermal / Display Calibration Subsystem (LTH)

3.1 Overview and Test Scripts Inventory

Located at <$>/hilo/, this subsystem manages display calibration data (Lightweight Thermal / LTH maps). The directory contains 17 automated test scripts:


3.2 LTH Raw Layout & Compression Architecture

Technical Analysis

Layman's Translation

Think of LTH data as a specialized, high-resolution topographical map of your screen's color response and thermal/lighting calibration.


3.3 Fail-Closed Anti-Oracle Security (test_lth_backup.sh)

Technical Analysis

The test harness explicitly documents a critical security requirement regarding backup verification:

"As an additional security requirement, we want to ensure that on a failed backup load the LTH in the SEP is zeroed (to avoid an attacker learning something about the decryption of messages that won't verify)."

If a backup fails cryptographic MAC verification, the SEP immediately wipes its internal LTH state to prevent oracle attacks (differential timing or decryption oracle attacks).

Layman's Translation

If someone tries to trick the Secure Enclave into loading a fake, corrupted, or maliciously altered display calibration backup, the SEP doesn't just say "Access Denied." It immediately nukes its entire internal calibration memory. This ensures that an attacker cannot probe the system by watching how it reacts to slightly modified backup files.


3.4 Attested Cross-Device Transfer & SCRT Binding

The transfer tests (test_lth_transfer_message.sh, test_lth_transfer_attestation.sh) prove that LTH state can be migrated between devices or backed up securely:


4. Category 3: Security State, Hardware Identity & Factory Data

4.1 AP vs. SEP Security State Separation

Lockdown domain queries (PurpleSNIFF logs) demonstrate independent inspection keys for Application Processor (AP) and Secure Enclave Processor (SEP) states:

This confirms that Apple's manufacturing and factory provisioning infrastructure tracks the production/secure-enabling state of the AP and the SEP as decoupled security domains.

4.2 Factory Provisioning Artifacts (scrt)

Device factory cache (System/Library/Caches/com.apple.factorydata/scrt-00008015-001551680450E02E) contains an IMG4 binary embedding verifiable hardware identifiers:


5. Synthesis & Architectural Implications for Emulators

Subsystem / Test Suite Emulator / Implementation Requirement
SIGPROV (SiProvisioning) Must support P-256 ECDSA/ECDH, HMAC-SHA256 key derivation with direction/purpose string labeling, and raw-key AES-256-CBC with zero IV.
Hilo / LTH Must allocate 3-plane 32-bit spatial buffers matching the $\lceil w/2 \rceil, w, \lceil w/2 \rceil$ geometry, implement strict gain restriction phase counters (0 → 1 → 2), and enforce zero-on-verify-failure behavior for backups.
Security State / Lockdown Must decouple AP and SEP production/security flags and enforce activation state (Unactivated) as a blocking security gate.