MS Sec Boot Ref Des WP v1
MS Sec Boot Ref Des WP v1
MS Sec Boot Ref Des WP v1
Reference Design
White Paper
June 2014
Abstract
Networked embedded systems are used in an ever-expanding range of applications, where monitoring and
control are a critical element. Unfortunately, this ubiquitous connection can allow network-based attacks
and fielded systems may be subject to hardware attacks. This paper describes a reference design created
by Microsemi that illustrates a secure boot process which can be used to insure the boot process for an
MCU, DSP, or SoC FPGA is secure and authentic. A live demonstration of the accompanying reference
design is available in the Microsemi booth for attendees wishing to see the specific implementation details.
Introduction
Embedded systems are used in an ever-expanding range of applications where monitoring and control are
a critical element. In industrial process controllers, financial transaction systems, transportation
infrastructure and the rapidly developing Machine-to-Machine (M2M) collection of the Internet of Things
(IoT), embedded systems literally control our world. The addition of networked connectivity delivers
advantages for both the user and the system operator. Unfortunately, the ubiquitous connection can allow
network-based attacks against these embedded systems; and fielded systems may be subject to hardware
attacks. One of the most vulnerable processes targeted by advanced threats is the system boot process.
Protecting it is critical if an embedded system needs to be secure from either network-based threats or
hardware-targeted intrusions.
This paper provides a detailed introduction to the Microsemi secure boot reference design. The reference
design is detailed and complete enough to demonstrate a real world secure boot implementation. It is
organized to simplify customization for a wide range of target applications and with a variety of target
processors, many of which, like many MCUs, MPUs, and most DSPs, do not intrinsically support secure
boot. The design shows how the code may be authenticated to prevent tampering and encrypted to
preserve confidentiality. All the details of the implementation including demonstration boards, schematics,
FPGA design files, and applications code are all available as part of the reference design.
The development of new forms of detection is only one aspect of the rise in vulnerability for networked
embedded systems. New software tools have been developed that can be used to detect vulnerabilities of
networked equipment. In most cases these tools, like those illustrated in Figure 2 below, are useful for
testing a network so that countermeasures can be developed. Unfortunately, unscrupulous uses could
detect vulnerabilities in targeted systems, perhaps found through Shodan, and thus make attacks much
easier to launch.
It is essential that any code be validated prior to delivery and execution to ensure that no compromise has
occurred that could subvert or damage the boot of each phase. This can be done using either symmetric or
asymmetric key cryptographic techniques. One approach is to build an inherently trusted RSA or ECC
security key into the immutable Phase-0 boot loader. The developer uses the RSA or ECC private key to
digitally sign the Phase-1 code. During Phase-0, the Root-of-Trust subsystem validates the digital
signature of the Phase-1 code before allowing execution. The boot process is aborted if invalid. It is
critically important that the inherently trusted security key and the immutable Root-of-Trust signature
checking process cannot be modified by a would-be hacker. If a hacker could substitute another security
key or subvert the process, they could spoof subsequently loaded digitally signed code.
Figure 4: Block Diagram and Key Secure Boot Processes for an Example System
The SmartFusion2 SoC FPGA device has an integrated processor (ARMCortex-M3), on-chip oscillator
(OSC), True Random Number Generator (TRNG), embedded SRAM (eSRAM), embedded Nonvolatile
Flash Memory (eNVM), a Physically Unclonable Function (PUF), crypto accelerators, and FPGA fabric.
These key hardware elements, along with a variety of intrinsic security features, make the SmartFusion2
SoC FPGA an ideal target for an exceptionally secure hardware RoT.
In order to better understand the example design, a quick overview of the SmartFusion2 SoC FPGA
architecture is given in the following section. After the SmartFusion2 SoC FPGA overview, we will return to
the discussion of the example design with a better understanding of the key features and capabilities of the
SmartFusion2 SoC FPGA device and their use in implementing the secure boot capability.
The first step is illustrated in Figure 7 below. The main action in this step is to send the boot loader to the
target processor. In our example design the boot loader consists of the WhiteboxCRYPTO code, a number
used only once (or nonce), the obfuscated AES security key, and the RSA public key. This is all sent in
plain-text form to the target processor when it begins its start-up process. The AES key and nonce are
used by the target processor to calculate a CBC-MAC for code authentication using WhiteBoxCRYPTO.
The second step in the secure boot process, illustrated in Figure 8 on page 11, is to establish a shared key
between the SmartFusion2 SoC FPGA device and the target processor for exporting CEK and CSK in
encrypted form to the target processor. CEK and CSK will be used by the target processor to decrypt and
authenticate the encrypted application code.
The target processor generates the ESK and encrypts it with the WhiteBoxCRYPTO AES key. The RSA
public key is used to encrypt the result and the target processor sends this to the SmartFusion2 SoC
FPGA device.
Figure 8: Step 2 Establishes the Shared Key for the Encrypted Application Code
The third and final step in the secure boot design, shown in Figure 9 on page 12, is to authenticate and
decrypt the application code. The received CEK and CSK are unwrapped by the target processor, which
then requests the secured application code. This code is then transmitted by the SmartFusion2 SoC FPGA
device over the SPI port. The application code is received and decrypted, and if authenticated successfully
the target processor can begin execution. The application code is known to be secure and tamper-free.
The secure boot process is completed.
The process used in the reference design and described in Figure 10 is, still basically a three stage
process. During the first stage, the Boot Code is transferred to the target processor in a secure and
validated fashion (the large yellow box labeled Boot Code). Once it is known that the boot code is
securely delivered and validated, the second stage transports and unwraps the shared keys. These keys
are used to decrypt and authorize the target processor application code stored in external nonvolatile
memory. During the third stage, the secure application code (the smaller yellow box labeled Application
Code) is authorized, decrypted, and available to execute. A more detailed description of each step in the
overall secure boot process is given below:
1. The SmartFusion2 SoC FPGA boots itself securely from its internal eNVM. After which a self-
integrity test can be performed. This test is a Smartfusion2 SoC FPGA built-in feature that
provides assurance against both natural and maliciously induced failures on all the nonvolatile
configuration memory segments, including security keys, security settings, the FPGA fabric
configuration, and any eNVM pages declared as ROM (all the write-protected pages). The
SmartFusion2 SoC FPGA holds the target processor in reset state until it completes the power-on
integrity self-test.
2. The SmartFusion2 SoC FPGA device releases the reset of the target processor so that it can start
to boot from its internal boot ROM.
3. These tasks (steps three and four) operate in parallel. Once the target processor is released from
reset, the boot-loader program stored in the target processors internal boot ROM fetches
additional boot code through the SPI bus. This code will be loaded into its internal SRAM for
execution.
Figure 11: Secure Boot Reference Design Hardware and Configuration Mode Screen
The Microsemi secure boot reference design has several features that make it easy to observe and control
the operation of key processes. The three main operating modes of the design are shown in the screen
shot of the design utility user interface given in Figure 11.
Figure 12: Secure Boot Demo and Log User Interface Screen Shots
A log of all the key operations done during execution of the secure boot are available in the Log mode. A
screen shot of the logged operations is shown on the right side of Figure 12. This log lists all the operations
executed during the secure boot process making it easy to identify and track execution when considering
the creation of a custom implementation.
To Learn More
1. Secure Boot Reference Design
2. Securely Booting an External Processor with a SmartFusion2 SoC FPGA, User Guide
3. SmartFusion2 SoC FPGA Product Information Webpage
4. Microsemi Security Webpage
5. Microsemi WhiteboxCRYPTO Product Information Webpage
6. WhiteboxCRYPTO Strength of Security Whitepaper