Skip to main content
Be Bitwise

Hardware Root of Trust & RISC-V Security

Hardware Security Architecture · Hardware Foundations track

15 min read

In this module

The Immutable Foundation

Every secure system leans on an axiom. Some component cannot be compromised. That component is the hardware root of trust: the immutable starting point from which every other security guarantee descends. Trust the root and the chain built on it stands. Compromise the root and nothing above it can be trusted, no matter how well-engineered the layers above are.

A hardware root of trust is typically a small chunk of code in mask ROM (read-only memory fabricated into the chip) or one-time programmable (OTP) fuses. It's the first code to run when the chip powers on, and no software or firmware update can alter it. That immutability is the whole point. An attacker who fully owns the OS, the bootloader, and even the firmware update mechanism still can't touch the root of trust.

The Secure Boot Chain

Secure boot builds a chain of trust from the immutable root to the operating system:

  1. Boot ROM executes first. The CPU's reset vector points at the ROM. The ROM code wakes up the bare minimum hardware (clocks, memory controller) and pulls the first-stage bootloader from flash.

  2. ROM verifies the first-stage bootloader. The ROM holds (or derives from OTP fuses) the hash of the root public key. It hashes the bootloader's signing public key, compares the result against the fused value, then verifies the bootloader's digital signature using that key. If verification fails, boot halts or falls into recovery mode.

  3. Each stage verifies the next. The first-stage bootloader vouches for the second-stage. The second-stage vouches for the kernel. The kernel vouches for drivers and modules. Each stage uses the cryptographic keys embedded or verified by the previous stage.

Modify any stage — bootloader, kernel, or driver — and the preceding signature check fails; the chain breaks. In theory that leaves no room for persistent malware. In practice attackers have found plenty of gaps:

  • Bugs in the boot ROM itself. Being immutable cuts both ways: a ROM bug can never be patched. checkm8 (2019) hit the USB recovery code in the boot ROM of Apple's A5 to A11 chips, and Fusée Gelée (2018) did the same to Nvidia's Tegra X1 in the original Nintendo Switch. Every device ever shipped with those chips stays exploitable.
  • Bugs in later, mutable stages, such as a parser in the bootloader that runs before or during signature checking. GRUB's BootHole (2020) let a malicious config file take over a signed bootloader and so defeat UEFI Secure Boot.
  • Fault injection. A well-timed voltage or clock glitch can make the CPU skip the instruction that rejects a bad signature.
  • Time-of-check to time-of-use. If the image is verified in one place and then re-read from flash before running, an attacker who controls the flash can swap it in between.
  • Stolen or leaked signing keys, which make malicious images genuinely valid, and downgrades to old signed images, which the next section covers.
  • Unverified storage. Anything the chain doesn't measure, such as configuration data or the rest of the SPI flash on a PC, is a place for implants to hide, as UEFI bootkits have shown.
Chain of Trust

A chain of trust is a sequence of software components where each verifies the integrity and authenticity of the next before executing it. The chain is only as strong as its weakest link. Critically, the first link must be immutable hardware (boot ROM), because any mutable first stage could be replaced by an attacker to fake all subsequent verifications.

Verified Boot vs Measured Boot

Everything so far is verified (or secure) boot: each stage refuses to run the next unless its signature checks out. Measured boot does something different. Each stage hashes the next and records the hash before running it, whether or not it's the expected one. On PCs the records go into a TPM's Platform Configuration Registers (PCRs), which can only be extended (new value = hash(old value ‖ measurement)), never set directly. Nothing gets blocked at boot. Instead, the TPM can later sign a quote of its PCR values, and a remote server compares them with known-good values before handing over secrets, or the TPM can seal a key (BitLocker's, for example) so it only unseals when the PCRs match. Microcontrollers without a TPM use the Trusted Computing Group's DICE architecture for the same idea: each stage derives the next stage's identity key from its own secret and the next stage's measurement, so a modified stage simply ends up with different keys. Most real platforms use both: verified boot to stop bad code running, measured boot to prove to someone else what actually ran.

Anti-Rollback Protection

A sly attack on secure boot is version rollback. The attacker installs an older signed firmware that carries a known vulnerability. The signature is valid (manufacturer signed it), so the secure boot chain happily passes. Then the attacker exploits the old hole.

To stop this, secure boot implementations keep a monotonic counter in OTP fuses. Every new firmware version bumps the counter. During verification, the boot ROM checks that the firmware's version number isn't below the fused counter value. OTP fuses can only flip 0 → 1, never back, so the counter is one-way.

Put the three checks together and each stage passes through the same gate before it gets to run. Trace the three classic attacks through it: a flipped bit in the image fails the signature, a re-signed image under the attacker's own key fails the key-hash comparison, and an old but genuine image fails only the version check.

Commercial Hardware Roots of Trust

Google Titan

Google's Titan chips act as the hardware root of trust in Google data centre servers and Pixel phones. Titan is a dedicated security microcontroller that:

  • Checks the integrity of boot firmware before the main CPU even starts running.
  • Holds cryptographic keys in hardware no host software can reach.
  • Offers attestation services to prove a server's boot state to Google's infrastructure.

On Pixel phones, the Titan M2 chip (built on a RISC-V core) handles secure boot, lock-screen credential verification, and tamper detection. It runs its own firmware on a dedicated processor, walled off from the application processor's software stack.

Apple Secure Enclave

Apple's Secure Enclave Processor (SEP) is a dedicated security subsystem baked into Apple SoCs (A-series in iPhones, M-series in Macs). A separate processor with its own boot ROM, encrypted memory, and hardware RNG.

The SEP manages:

  • Face ID and Touch ID: Biometric templates are stored and matched entirely inside the Secure Enclave. The application processor never sees raw biometric data.
  • Data Protection key hierarchy: File encryption keys are wrapped by keys living in the SEP. Unlocking the device makes the SEP unwrap them, gated on the correct passcode or biometric.
  • Apple Pay: Payment card tokens and transaction signing keys live inside the Secure Enclave.

The SEP boots from its own immutable ROM, runs its own microkernel (sepOS), and talks to the application processor through a hardware mailbox interface. Even with full control of the main OS, an attacker can't read SEP memory or pull its keys.

Microsoft Pluton

Microsoft's Pluton security processor goes a third route. Rather than a separate chip (Titan) or a separate core on the SoC (Apple's SEP), Pluton is integrated directly into the CPU die by the CPU vendor (AMD, Intel, Qualcomm). That kills the external bus between CPU and security chip — a known target for physical interception attacks.

Pluton stores secrets (BitLocker keys, Windows Hello credentials) in hardware that's physically part of the CPU. Firmware updates ride Windows Update through a measured update mechanism that blocks rollback.

Key Concept
Hardware Root of Trust Architectures

Commercial hardware roots of trust vary in their integration approach: Google Titan uses a dedicated security microcontroller, Apple's Secure Enclave is a separate core within the SoC, and Microsoft Pluton is embedded directly in the CPU die. Each approach trades off isolation strength against attack surface from inter-chip communication.

RISC-V Physical Memory Protection (PMP)

RISC-V comes at hardware security from a different angle than ARM or x86. Where TrustZone hard-codes a two-world split and SGX hard-codes an enclave model, RISC-V hands you Physical Memory Protection (PMP) — a configurable mechanism architects can shape into a variety of isolation schemes.

PMP Fundamentals

PMP is a set of CSRs (Control and Status Registers) that define memory access rules:

  • PMP address registers (pmpaddr0 through pmpaddr15): Each register specifies a physical address boundary.
  • PMP configuration registers (pmpcfg0 through pmpcfg3): Each 8-bit configuration field specifies the access permissions (Read, Write, Execute) and the address-matching mode for the corresponding region.

PMP rules are enforced for every privilege mode below Machine mode (M-mode). M-mode firmware (the top level, analogous to ARM's EL3) configures the PMP registers and, by default, is exempt from PMP checks. Two features change that. Setting an entry's lock (L) bit freezes it until the next reset and applies its permissions to M-mode too, so firmware can make its own code non-writable. The Smepmp extension goes further, letting M-mode be barred from executing or accessing memory that belongs to S-mode and U-mode, the RISC-V answer to SMEP and SMAP on x86. Supervisor mode (S-mode, where the OS lives) and User mode (U-mode, where applications run) get checked against PMP on every memory operation.

Address-Matching Modes

PMP supports several address-matching modes:

  • TOR (Top of Range): The region spans from the previous PMP address to this one. Allows arbitrary region boundaries.
  • NA4 (Naturally Aligned 4-byte): A single 4-byte region. Useful for protecting individual control registers.
  • NAPOT (Naturally Aligned Power of Two): A power-of-two-sized region with natural alignment. Efficient for protecting firmware, kernel, or application memory blocks.

PMP vs TrustZone

The architectural difference is fundamental:

TrustZone hands you a binary partition. Every resource is either Secure or Normal. Simple and hardware-efficient, but it lumps all Secure-world software into one trust domain. A bug in one trusted application sinks the entire Secure world.

PMP hands you N-way partitioning. M-mode firmware can define up to 16 (or 64 in newer specs) independent regions, each with its own permissions. Multiple isolated domains, no two-world cap. The trade-off is that simultaneously protected regions are bounded by the PMP entry count.

RISC-V Security Extensions

Keystone Enclave

Keystone is an open-source framework for building trusted execution environments on RISC-V via PMP. It has three components:

  • Security Monitor (SM): Runs in M-mode. Manages enclave lifecycle and configures PMP to keep enclaves isolated from each other and from the untrusted OS.
  • Untrusted OS: Runs in S-mode. Manages resources (scheduling, I/O) but can't reach enclave memory — PMP rules block S-mode access to enclave regions.
  • Enclaves: Run in S-mode or U-mode inside PMP-protected memory regions. Each enclave gets its own isolated address space.

Keystone's clever bit is that the Security Monitor is tiny (a few thousand lines of C) and formally verifiable. The TCB is dramatically smaller than a full TEE OS like OP-TEE.

Sanctum

Sanctum (MIT) extends RISC-V hardware for stronger isolation than PMP alone:

  • Per-enclave page tables: Each enclave has its own page table base, blocking the OS from messing with enclave address mappings.
  • Cache partitioning: Sanctum dedicates cache sets to each enclave, killing cache-based side channels between enclaves, and between enclaves and the OS.
  • DRAM region isolation: Enclaves are pinned to dedicated DRAM regions at the physical level, so no shared cache lines.

Sanctum tackles the microarchitectural side-channel weaknesses that haunt both TrustZone and SGX. It pays for that in custom hardware modifications.

Open-Source Hardware Security

RISC-V's open ISA (Instruction Set Architecture) enables a fundamentally different approach to hardware security: transparency through openness.

The Auditability Argument

Proprietary security architectures (TrustZone, SGX) are designed by one organisation and shipped in proprietary silicon. The security community has to treat the hardware as a black box, finding vulnerabilities through external testing — that's how Foreshadow, Plundervolt, and the TrustZone attacks were uncovered. The vendor controls when and whether issues get disclosed and patched.

An open-source hardware design can be:

  • Audited by anyone: Researchers can review the RTL (register-transfer level) design, not just the published spec.
  • Formally verified: Security properties can be expressed mathematically and checked against the hardware using formal methods.
  • Community-hardened: Any researcher's discovery feeds back into the whole ecosystem.

Open-source hardware isn't automatically more secure. Openness enables scrutiny; scrutiny needs expertise and effort. A complex open design that nobody actually audits is no safer than a well-reviewed proprietary one. The value is in the possibility of independent verification.

OpenTitan

OpenTitan is the highest-profile open-source hardware-root-of-trust project, led by lowRISC with Google as a founding contributor. It delivers:

  • A RISC-V-based security microcontroller design.
  • Secure boot, measured boot, and attestation capabilities.
  • Hardware-backed key storage and cryptographic acceleration.
  • A transparent design process — all RTL, verification, and documentation are public.

OpenTitan aims to be the open-source counterpart to proprietary roots of trust like Google Titan, Apple SEP, and Microsoft Pluton. The design targets server motherboards, storage controllers, and other infrastructure that genuinely needs a trustworthy root.

Open-Source Root of Trust

An open-source hardware root of trust like OpenTitan provides the same security functions as proprietary alternatives (secure boot, key storage, attestation) but with a fully transparent design. Any researcher can audit the RTL, verify the security properties, and identify vulnerabilities. This shifts the trust model from "trust the vendor" to "trust the community's review process."

Memory-Safety Hardware

Roots of trust and enclaves protect the platform. A newer family of hardware features protects ordinary programs from their own memory bugs, and they're where this module meets the exploitation tracks:

  • Arm MTE (Memory Tagging Extension) stores a 4-bit tag with every 16 bytes of memory and in each pointer's top byte; a mismatch on access faults, catching use-after-free and overflows. Pixel 8 and later phones can turn it on.
  • Arm PAC (Pointer Authentication) signs return addresses and other pointers with a key-based MAC in their unused high bits, and BTI (Branch Target Identification) restricts where indirect branches may land.
  • Intel CET adds a hardware shadow stack that catches overwritten return addresses, and Indirect Branch Tracking for forward edges.
  • CHERI (Cambridge and SRI, prototyped in Arm's Morello board) goes furthest, replacing pointers with hardware-checked capabilities that carry their own bounds and permissions.

Comparing Security Architectures

Each hardware security architecture embodies different design trade-offs:

PropertyARM TrustZoneIntel SGXIntel TDXRISC-V PMP
Isolation modelTwo worlds (Secure/Normal)User-space enclavesFull VM isolationN configurable regions
GranularitySystem-wide binary splitPer-applicationPer-VMPer-region (flexible)
Memory encryptionOptional (CCA with MEC)Yes (MEE on client, TME-MK on Xeon)Yes (TME-MK)No (software/extension)
TCB sizeTEE OS + trusted appsEnclave code onlyGuest OS + appsSecurity monitor
Side-channel resistanceShared cache/TLB (weak)Shared cache (weak)Better (guest manages pages)Depends on implementation
OpennessProprietaryProprietaryProprietaryOpen ISA (varies by impl.)
Primary deploymentMobile, embeddedCloud servers (Xeon)Cloud confidential VMsEmerging (IoT, research)

No single architecture wins universally. TrustZone's simplicity slots into mobile and embedded devices where a binary Secure/Normal split is enough. SGX's fine-grained enclaves cover specific sensitive computations on server hardware. TDX's VM-level isolation slots into cloud confidential computing with minimal tenant effort. RISC-V PMP's flexibility fits designs that need custom isolation topologies or that want open, auditable silicon.

Key Concept
Security Architecture Trade-offs

Hardware security architectures trade off isolation granularity, memory encryption, TCB size, side-channel resistance, and openness. TrustZone offers simple binary partitioning for embedded use. SGX provides fine-grained enclaves but with a large attack surface. TDX lifts isolation to the VM level for practical cloud deployment. RISC-V PMP enables flexible, auditable isolation through configurable memory regions.

The Convergence: Confidential Computing

Whatever their architectural differences, modern hardware security architectures are funnelling toward one shared goal: confidential computing, protecting data in use — not just at rest and in transit — through hardware-enforced isolation.

ARM's Confidential Compute Architecture (CCA) layers memory encryption and realm management onto TrustZone. Intel TDX delivers encrypted VM isolation. RISC-V projects like Keystone and Sanctum build enclave-style isolation from open primitives. Different paths, same destination: a world where computation runs on data the infrastructure operator can't read, anchored in hardware guarantees that no software can flip.

The hardware root of trust — mask ROM boot vector, dedicated security chip, PUF-derived key, take your pick — is the anchor that makes all of this possible. Without an immutable, trustworthy starting point, no amount of software security can offer meaningful guarantees.