Starting method of embedded device

By verifying the legitimacy of the public key and signature area during the first power-on startup of an embedded device, and only performing HMAC value verification during hibernation startup, the problem of slow device startup speed and insufficient security is solved, and fast and safe Hibernate startup process.

CN119127322APending Publication Date: 2024-12-13HANGZHOU NATCHIP SCI & TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411210839.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

Existing embedded devices are slow to start after hibernation wakeup and are inadequate in security, especially when they are vulnerable to attack during the hibernation startup phase.

Method used

By verifying the legality of the public key and Boot signature areas in FLASH on the first power-on startup, and verifying the integrity of the APP firmware only through the HMAC value during sleep startup, reducing the number of RSA sign-in verifications, simplifying the startup process for fast and secure start up.

Benefits of technology

It realizes the fast startup of embedded devices, and ensures the security of data and trust chains in a dormant state, saves time for RSA sign verification and HMAC calculation, and improves startup efficiency and security.

✦ Generated by Eureka AI based on patent content.
Patent Text Reader

Abstract

The invention discloses a starting method of embedded equipment. The method comprises first-time power-on starting and dormant state starting. The first-time power-on starting comprises an ROM stage, a Boot stage and an APP stage, in the Boot stage, a secret key in OTP is used, an HMAC value of APP firmware is calculated, and the HMAC value and the initial address and size of the APP firmware in FLASH are stored in a safe memory in a chip. The dormant state starting only comprises an ROM stage and an APP stage, in the ROM stage, the HMAC value of the APP firmware is calculated through a secret key in the OTP, the HMAC value is compared with the stored HMAC value of the APP firmware, and it is ensured that the APP firmware is not tampered. According to the method, the legality of the APP firmware is verified and the HMAC value of the APP firmware is calculated during the first secure startup, and only the APP firmware needs to be ensured not to be tampered under the dormant startup. The signature verification time is omitted, and starting is fast and safe.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of embedded devices, and in particular relates to a method for quickly and safely starting an embedded device. Technical Background With the widespread application of embedded systems in various fields, the startup speed and security of devices have become the focus of users. Embedded systems are often used in scenarios such as IoT devices, smart homes, industrial control, and medical equipment. These devices may need to frequently enter and exit sleep mode in daily use to save energy and extend the life of the device. Sleep mode is a common energy-saving technology that reduces energy consumption by temporarily shutting down some or all of the functions of the device. When the device needs to be restarted, it can quickly resume normal operation from sleep mode. The application of sleep mode can not only extend battery life, but also reduce the energy consumption of the device, which meets the requirements of green environmental protection.

[0002] In many application scenarios, embedded devices need to recover from sleep mode to working mode in a very short time. For example, in industrial control systems, devices need to respond quickly to ensure the continuous operation of production lines; in medical equipment, fast startup can provide timely medical support in emergency situations. Therefore, how to achieve fast startup of embedded devices has become an important research topic.

[0003] As embedded devices become more connected and intelligent, security issues are becoming more and more prominent. Devices may face various security threats during the startup process, such as malware attacks, data tampering, etc., especially during the sleep startup phase. Therefore, it is crucial to ensure the security of the device during the startup process.

[0004] At present, many embedded systems have implemented sleep and fast startup functions, but there are still some deficiencies in startup speed and security. For example, some systems require a lot of initialization operations during the startup process, resulting in a long startup time; and in terms of security, some systems lack effective security mechanisms and are vulnerable to attacks.

[0005] The secure boot is divided into the first power-on boot and the hibernation boot. The processes of the existing secure boot for the first power-on boot and the hibernation boot are the same, both including the ROM stage, the Boot stage, and the APP stage.

[0006] The ROM phase process is as follows: (1) Calculate the hash value of the public key and compare it with the hash in the one-time programmable memory (OTP) to ensure that the public key is legitimate; (2) Calculate the hash value of the signature area and read the calculated hash in the firmware header, and compare the two to ensure the integrity of the firmware; (3) Use the RSA3072 algorithm to perform RSA signature verification to ensure the legitimacy of the firmware; (4) Clear some security resources and jump to the boot stage, and the ROM stage is completed.

[0007] The Boot phase process is as follows: a. Calculate the hash value of the APP public key and compare it with the hash value extracted from the ROM signature verification area to ensure that the public key is legitimate; b. Calculate the hash value of the APP signature area and read the calculated hash in the APP firmware header, and compare the two to ensure the integrity of the firmware; c. Use RSA3072 algorithm to perform RSA signature verification to ensure the legitimacy of the firmware; d. Clear security resources and jump to the APP stage. The Boot stage is completed.

[0008] The APP stage is to directly start the APP. Summary of the invention

[0009] The purpose of the present invention is to provide a method for starting an embedded device in a dormant state, in order to solve the problem that the secure startup after waking up from dormancy takes too long in the prior art, so as to achieve fast startup and ensure the security of data and trust chain.

[0010] The method of the present invention includes first power-on startup and dormant state startup.

[0011] The first power-on startup includes the ROM stage, Boot stage, and APP stage.

[0012] The specific process of the ROM stage is as follows: (1) Calculate the hash value of the public key in the FLASH and compare it with the hash value in the one-time programmable memory OTP. If they are the same, execute step (2); otherwise, terminate the startup; (2) Calculate the hash value of the Boot signature area, read the hash value in the Boot firmware header, and compare the two. If they are the same, execute step (3), otherwise terminate the boot; (3) Use the RSA3072 algorithm to perform RSA verification on the Boot signature area. If the verification passes, execute step (4); otherwise, terminate the boot process. (4) Clear the security resources in the SRAM area of ​​ROM and jump to the boot stage. The ROM stage is completed.

[0013] The specific process of the Boot phase is as follows: a. Extract the APP public key in the Boot signature area, calculate the hash value of the APP public key, extract the hash value of the Boot signature area, compare the two, if they are the same, execute step b, otherwise end the startup; b. Calculate the hash value of the APP signature area, read the hash value in the APP firmware header, compare the two, if they are the same, execute step c, otherwise end the startup; c. Use the RSA3072 algorithm to perform RSA verification on the APP signature area. If the verification passes, proceed to step d, otherwise terminate the startup; d. Use the key in the one-time programmable memory OTP to calculate the HMAC value of the APP firmware; e. Get the starting address and size of the APP firmware in FLASH, and save it together with the HMAC value of the APP firmware to the secure memory inside the chip; f. Clear the security resources in the Boot SRAM area and jump to the APP stage. The Boot stage is completed.

[0014] The APP stage is to directly start the APP, and the first power-on startup is completed.

[0015] The dormant state startup includes a ROM stage and an APP stage.

[0016] The specific process of the ROM stage is as follows: A. Obtain the starting address and size of the APP firmware in the FLASH stored in the secure memory during the Boot phase of the first power-on startup, and the HMAC value of the APP firmware; B. Use the key in the one-time programmable memory OTP to calculate the HMAC value of the APP firmware and compare it with the saved HMAC value of the APP firmware. If they are the same, execute step C, otherwise terminate the startup; C. Clear the security resources in the SRAM area of ​​ROM, jump to the APP stage, and the ROM stage is completed; The APP stage is to directly start the APP, and the startup is completed in the dormant state.

[0017] Since the method of the present invention verifies the legitimacy of the APP firmware and calculates the HMAC value of the APP firmware during the first secure startup, the security requirements can be met by only ensuring that the APP firmware has not been tampered with during the sleep startup. Since the key for calculating the HMAC comes from the OTP, the confidentiality of the key is guaranteed, and the legitimacy of the HMAC of the APP firmware in the secure memory is guaranteed during the first power-on startup. During the sleep startup, it is only necessary to calculate the HMAC of the APP firmware and compare the HMAC value stored in the secure area during the first power-on startup to achieve security verification. Compared with the traditional sleep startup, it saves the time of RSA signature verification of the Boot firmware in the ROM stage and RSA signature verification of the APP firmware in the Boot stage. Compared with the calculation of HMAC, RSA signature verification is relatively time-consuming. The present invention only performs HMAC once during the sleep startup to omit the signature verification time, thereby achieving the purpose of fast and secure startup. DETAILED DESCRIPTION

[0018] A startup method for an embedded device includes first power-on startup and dormant state startup.

[0019] The first power-on startup, that is, the startup of the embedded device in the power-on state, includes the ROM stage, the Boot stage, and the APP stage; the legitimacy of the Boot firmware is determined through the ROM stage, and the legitimacy of the APP is determined through the Boot stage.

[0020] The specific process of the ROM stage is as follows: (1) Calculate the hash value of the public key in the FLASH and compare it with the hash value in the one-time programmable memory OTP (One Time Programmable). If they are the same, execute step (2); otherwise, terminate the startup to ensure that the public key is legitimate.

[0021] (2) Calculate the hash value of the Boot signature area, read the hash value in the Boot firmware header, and compare the two. If they are the same, execute step (3); otherwise, terminate the startup to ensure the integrity of the Boot firmware.

[0022] (3) Use the RSA3072 algorithm to perform RSA verification on the Boot signature area. RSA verification is a standard signature verification method. If the verification passes, execute step (4), otherwise terminate the startup to ensure the legitimacy of the Boot firmware.

[0023] (4) Clear the security resources in the SRAM area of ​​ROM and jump to the boot stage. The ROM stage is completed.

[0024] The specific process of the Boot phase is as follows: a. Extract the APP public key in the Boot signature area, calculate the hash value of the APP public key, extract the hash value of the Boot signature area, and compare the two. If they are the same, execute step b, otherwise terminate the startup to ensure the legitimacy of the APP public key.

[0025] b. Calculate the hash value of the APP signature area, read the hash value in the APP firmware header, and compare the two. If they are the same, execute step c, otherwise terminate the startup to ensure the integrity of the APP firmware.

[0026] c. Use the RSA3072 algorithm to perform RSA verification on the APP signature area. If the verification passes, execute step d, otherwise terminate the startup to ensure the legitimacy of the APP firmware.

[0027] d. Use the key in the one-time programmable memory OTP to calculate the HMAC value of the APP firmware.

[0028] e. Get the starting address and size of the APP firmware in FLASH, and save it together with the HMAC value of the APP firmware to the secure memory inside the chip.

[0029] f. Clear the security resources in the Boot SRAM area and jump to the APP stage. The Boot stage is completed.

[0030] The APP stage is to directly start the APP, and the first power-on startup is completed.

[0031] Hibernation state startup refers to the startup of an embedded device in a low-power state, including the ROM stage and the APP stage.

[0032] Since the trust chain security of the FLASH firmware is ensured during the first power-on startup, the dormant state startup only needs to verify the integrity of the APP firmware to prevent tampering. To speed up the secure boot process, the dormant state startup is simplified into two stages. In the ROM stage, the HMAC value of the APP is calculated using the HMAC key in the OTP to verify the integrity of the firmware. This method reduces the time for multiple signature verifications, thereby achieving the goal of fast startup.

[0033] The specific process of the ROM stage is as follows: A. Get the starting address and size of the APP firmware in the FLASH stored in the secure memory during the Boot phase of the first power-on startup, and the HMAC value of the APP firmware.

[0034] B. Use the key in the one-time programmable memory OTP to calculate the HMAC value of the APP firmware and compare it with the saved HMAC value of the APP firmware. If they are the same, execute step C, otherwise terminate the startup to ensure that the APP firmware has not been tampered with.

[0035] C. Clear the security resources in the SRAM area of ​​ROM, jump to the APP stage, and the ROM stage is completed.

[0036] The APP stage is to directly start the APP, and the startup is completed in the dormant state.

[0037] The first power-on startup and the startup in hibernation state work together to complete the hibernation fast and safe startup function.

Claims

1. A startup method for an embedded device, including first power-on startup and sleep state startup, characterized in that: The first power-on startup includes a ROM stage, a Boot stage, and an APP stage; The specific process of the ROM stage is as follows: (1) Calculate the hash value of the public key in the FLASH and compare it with the hash value in the one-time programmable memory OTP. If they are the same, execute step (2); otherwise, terminate the startup; (2) Calculate the hash value of the Boot signature area, read the hash value in the Boot firmware header, and compare the two. If they are the same, execute step (3), otherwise terminate the boot; (3) Use the RSA3072 algorithm to perform RSA verification on the Boot signature area. If the verification passes, execute step (4); otherwise, terminate the boot process. (4) Clear the security resources in the SRAM area of ​​ROM and jump to the boot stage. The ROM stage is completed; The specific process of the Boot phase is as follows: a. Extract the APP public key in the Boot signature area, calculate the hash value of the APP public key, extract the hash value of the Boot signature area, compare the two, if they are the same, execute step b, otherwise end the startup; b. Calculate the hash value of the APP signature area, read the hash value in the APP firmware header, compare the two, if they are the same, execute step c, otherwise end the startup; c. Use the RSA3072 algorithm to perform RSA verification on the APP signature area. If the verification passes, proceed to step d, otherwise terminate the startup; d. Use the key in the one-time programmable memory OTP to calculate the HMAC value of the APP firmware; e. Get the starting address and size of the APP firmware in FLASH, and save it together with the HMAC value of the APP firmware to the secure memory inside the chip; f. Clear the security resources in the Boot SRAM area and jump to the APP stage. The Boot stage is completed; The APP stage is to directly start the APP, and the first power-on startup is completed; The dormant state startup includes a ROM stage and an APP stage; The specific process of the ROM stage is as follows: A. Obtain the starting address and size of the APP firmware in the FLASH stored in the secure memory during the Boot phase of the first power-on startup, and the HMAC value of the APP firmware; B. Use the key in the one-time programmable memory OTP to calculate the HMAC value of the APP firmware and compare it with the saved HMAC value of the APP firmware. If they are the same, execute step C, otherwise terminate the startup; C. Clear the security resources in the SRAM area of ​​ROM, jump to the APP stage, and the ROM stage is completed; The APP stage is to directly start the APP, and the startup is completed in the dormant state.

Citation Information

Cited By

  • Chip starting control method and system and electronic equipment

    CN121834913A