TEE Boot Procedure with Crypto-accelerators in RISC-V Processors
Authors: Ckristian Duran, Trong-Thuc Hoang, Akira Tsukamoto, Kuniyasu Suzaki, and Cong-Kha Pham
TEE Boot Procedure with Crypto-accelerators in RISC-V Processors - - PowerPoint PPT Presentation
TEE Boot Procedure with Crypto-accelerators in RISC-V Processors Authors: Ckristian Duran, Trong-Thuc Hoang, Akira Tsukamoto, Kuniyasu Suzaki, and Cong-Kha Pham Outline Motivation Hardware Structure for Trusted Execution Environments
Authors: Ckristian Duran, Trong-Thuc Hoang, Akira Tsukamoto, Kuniyasu Suzaki, and Cong-Kha Pham
2
3
RAM ROM Devices Debug
4
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode
RAM ROM Devices Debug
5
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode SD Card ROM - Boot Procedure Copy BOOTLDR from SD Jump to BOOTLDR in RAM Store BOOTLDR in RAM
SD commands through a SPI Device
RAM BOOTLDR ROM Devices Debug
6
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode ROM - Boot Procedure Copy BOOTLDR from SD Jump to BOOTLDR in RAM Store BOOTLDR in RAM
RAM BOOTLDR ROM Devices Debug
7
0x00000000 0xFFFFFFFF Execution
RISC-V Processor M-mode ROM - Boot Procedure Copy BOOTLDR from SD Jump to BOOTLDR in RAM Store BOOTLDR in RAM
RAM BOOTLDR ROM Devices Debug
8
0x00000000 0xFFFFFFFF Execution
RISC-V Processor M-mode RAM Linux Devices Debug
0x00000000 0xFFFFFFFF Execution
RISC-V Processor S-mode The bootloader extracts Linux and executes it in Supervisor-Mode
RAM BOOTLDR ROM Devices Debug
9
0x00000000 0xFFFFFFFF Execution
RISC-V Processor M-mode RAM Linux Devices Debug
0x00000000 0xFFFFFFFF Execution
RISC-V Processor S-mode App 1 Memory App 2 Memory
0x00000000 0xFFFFFFFF PID 1 Execution
RISC-V Processor U-mode
PID 2 Execution
Malicious App
10
App 1 Memory App 2 Memory
0x00000000 0xFFFFFFFF PID 1 Execution
RISC-V Processor U-mode
PID 2 Execution
Sign Sign
11
App 1 Memory App 2 Memory
0x00000000 0xFFFFFFFF PID 1 Execution
RISC-V Processor U-mode
PID 2 Execution
RAM Linux Devices Debug
0x00000000 0xFFFFFFFF Execution
RISC-V Processor S-mode Linux only executes the application if the signature is authenticated.
Sign Sign
12
App 1 Memory App 2 Memory
0x00000000 0xFFFFFFFF PID 1 Execution
RISC-V Processor U-mode RAM Linux Devices Debug
0x00000000 0xFFFFFFFF Execution
RISC-V Processor S-mode Once the signature verification is performed, the attack can rewrite the instructions of any application to execute unsigned code. Unsigned Code
PID 2 Execution
Sign
13
App 1 Interface
0x00000000 0xFFFFFFFF PID 1 Execution
RISC-V Processor U-mode RAM Linux Devices Debug
0x00000000 0xFFFFFFFF Execution
RISC-V Processor S-mode RAM BOOTLDR ROM Devices Debug App 1
0x00000000 0xFFFFFFFF Execution
RISC-V Processor M-mode Signature and Execution are performed in the highest privileged mode
14
App 1 Memory Signature Procedure Hashing Generate Keypair Elliptic Curve Sign / Ver
16KB 164ms at 100MHz clock
BOOTLDR + Linux
15
App 1 Memory Signature Procedure Hashing Generate Keypair Elliptic Curve Sign / Ver
16KB 164ms at 100MHz clock
Signature Procedure Hashing Generate Keypair Elliptic Curve Sign / Ver
2MB
18.5s at 100MHz clock
16
17
ROCKET COREPLEX TILELINK SYSTEM BUS (SBUS) TILELINK PERIPHERAL BUS (PBUS) SHA-3 ROCKET RISC-V CORE 2 I$ D$ DDR controller
GPIO SPI (as MMC) UART
ROCKET RISC-V CORE 1 I$ D$ MBUS
SPI (as ROM)
TL to AXI4
18
19
20
21
22
23
RAM ZSBL Devices Debug
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode SD Card UART SPI: Contains BBL SHA3 ED25519 Sign ED25519 Base Mult Crypto Acc ROM - Boot Procedure Copy BBL from SD Calculate SHA3 (Hs) Generate Keypair (SK,PK) Generate Signature
Free Mem SM BBL
24
ZSBL Devices Debug
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode SD Card UART SPI: Contains BBL SHA3 ED25519 Sign ED25519 Base Mult Crypto Acc ROM - Boot Procedure Copy BBL from SD Calculate SHA3 (Hs) Generate Keypair (SK,PK) Generate Signature The BBL is copied to the main memory from a untrusted source (SD card). This also creates the Secure Monitor (SM)
Free Mem SM BBL
25
ZSBL Devices Debug
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode SD Card UART SPI: Contains BBL SHA3 ED25519 Sign ED25519 Base Mult Crypto Acc ROM - Boot Procedure Calculate SHA3 (Hs) Generate Keypair (SK,PK) Generate Signature Copy BBL from SD Payload The BBL is hashed using the SHA-3 hardware by pushing registers to the device.
Free Mem SM BBL
26
ZSBL Devices Debug
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode SD Card UART SPI: Contains BBL SHA3 ED25519 Sign ED25519 Base Mult Crypto Acc ROM - Boot Procedure Generate Keypair (SK,PK) Generate Signature Copy BBL from SD Hash (Hs) Calculate SHA3 (Hs) The previous hash is used by the ED25519 base-point multiplier to create the Keypair (SK,PK)
SM Sign BBL
27
ZSBL Devices Debug
0x00000000 0xFFFFFFFF Reset Vector
RISC-V Processor M-mode SD Card UART SPI: Contains BBL SHA3 ED25519 Sign ED25519 Base Mult Crypto Acc ROM - Boot Procedure Generate Signature Copy BBL from SD Auxiliar Hashes Calculate SHA3 (Hs) The Keypair and some auxiliar hashes are used to calculate the signature. Generate Keypair (SK,PK) Keypair (SK,PK)
28
29
SHA-3 RocketTile ALUTs 8108 24332 FFs 2790 15325 RAM Bits 17680 DSP 32 Total 10898 57369 Logic Utilization 3.4% 12.4% RAM Utilization 0% 1% DSP Utilization 0% 2.4% Table 1: Synthesis result on Stratix-IV GX Altera FPGA.
30
Figure 1: Comparison between software and hardware with different bootloader sizes.
2MB Bootloader Software HW SHA-3 with SW Ed25519 Ed25519 keypair (ms) 109.5 93.4 Ed25519 signature (ms) 231019 82.6
Table 2: Execution results for Ed25519 task.
31
32
33