A program verification system, verification method and storage medium for a multi-core controller
By decomposing the program verification process in the multi-core controller, only starting after part of the program verification passes, and performing full verification after startup, the problem of the controller startup time in the existing technology being too long is solved, and a fast and efficient Safe boot.
Patent Information
- Application Number
- CN202210391424.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-14
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-04-14
AI Technical Summary
When faced with large-scale applications, the existing safe startup technology of automobile controllers cannot meet the car's requirements for controller startup time, resulting in too long startup time.
Design a program verification system for multi-core controllers, including a trusted unit, a startup enable unit, a verification core and multiple startup cores. By decomposing the program verification process, the controller is started only after part of the program verification passes. And perform full verification after startup to ensure safety.
It effectively reduces the startup time of the controller, while ensuring the safety of the controller and meeting the car's requirements for the startup time of the controller.
Smart Images

Figure CN114764347B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automotive electronic and electrical information security technology, and in particular to a program verification system, a verification method and a storage medium for a multi-core controller. Background Art
[0002] With the rapid development of intelligent and networked vehicles, the risk of automobile information security is also increasing. As the last line of defense for information security, the legitimacy and integrity of the program itself are the basis of the in-vehicle controller. In order to protect the legitimacy of the in-vehicle controller program itself, the common practice in the industry is to use a trusted root to verify the legitimacy and integrity of the program to be run during the power-on startup of the controller, and only run the program that has passed the verification. This technology is called secure boot technology.
[0003] The secure boot technology needs to rely on the trusted root of the controller's internal hardware to ensure that its own program is not illegally tampered with. It uses a general security algorithm to perform step-by-step verification of the boot program and application program. For example, the invention patent application with application number 201510246872.0 discloses a secure boot method for embedded devices and a secure embedded device. The embedded device includes an embedded processor, a non-volatile memory, an FPGA and an external boot ROM; the embedded processor is connected to the non-volatile memory through a local bus; the address bus and control bus of the embedded processor are connected to the external boot ROM through the FPGA; the data bus of the embedded processor is directly connected to the external boot ROM. The secure boot method includes two steps: establishing a secure boot authentication environment and executing a secure boot authentication module; after resetting, the processor first executes the secure boot authentication module in the external boot ROM, and determines whether the boot program is secure based on the execution result of the secure boot authentication module; if it is secure, the device starts normally, otherwise, the device cannot start. This method can perform a safety check when the device starts up to ensure the safe startup of the device. However, for the controller in the car, in order not to affect the user's car experience, the car has a relatively high requirement for the startup time of the controller. Generally, the startup time of the controller is required to be less than 200ms. However, with the increase of intelligent functions, the application programs of the controller in the car are getting larger and larger. If the verification is performed according to the above-mentioned safety startup technology, the startup time of the controller will be much longer than the car's requirement for the startup time of the controller. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the technical problem to be solved by the present invention is: how to provide a program verification system and verification method for a multi-core controller that can meet the automobile's requirements for controller startup time while taking into account the safe startup of the controller.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] A program verification system for a multi-core controller includes a trusted unit, a startup enabling unit, a verification core, and a plurality of startup cores;
[0007] The startup core is provided with a first boot program module and a first application program module, wherein the first application program module includes a first application verification program and a plurality of first application programs;
[0008] The verification core is provided with a second boot program module and a second application program module, the second application program module includes a verification unit and a second application program, the verification unit is used to verify the first application program module and the second application program;
[0009] The trusted unit is a storage unit with a one-time write feature, and the reference values of the first boot program module and the second boot program module are stored in the trusted unit;
[0010] The flag bit of the boot enabling unit is assigned by the trusted unit, the first boot program module, the second boot program module and the verification unit, and the trusted unit can verify the flag bit of the boot enabling unit when the controller is powered on.
[0011] A program verification method for a multi-core controller, using the program verification system for the multi-core controller, comprises the following steps:
[0012] Step 1) Power on the controller;
[0013] Step 2) The trusted unit verifies the flag bit of the startup enable unit. If the verification passes, step 3 is executed. If the verification fails, step 10 is executed.
[0014] Step 3) The trusted unit verifies each of the first boot program module and the second boot program module. If both verifications pass, execute step 4). If any verification fails, execute step 10).
[0015] Step 4) running each of the first boot program module and the second boot program module;
[0016] Step 5) Each of the first boot program modules verifies the corresponding first application verification program respectively. If the verification passes, the first application program module is started and step 6 is executed. If the verification fails, the flag bit corresponding to the startup enabling unit is assigned a value of 0 and step 10 is executed.
[0017] Step 6) The second boot program module verifies the verification unit. If the verification passes, step 7 is executed. If the verification fails, a flag bit corresponding to the startup enabling unit is assigned a value of 0 and step 10 is executed.
[0018] Step 7) the verification unit verifies each of the first application modules, and if the verification passes, executes step 8); if the verification fails, assigns a value of 0 to the flag bit corresponding to the start-up enabling unit and then executes step 10);
[0019] Step 8) the verification unit verifies the second application program, and if the verification passes, executes step 9); if the verification fails, assigns a value of 0 to the flag bit corresponding to the startup enabling unit and then executes step 10);
[0020] Step 9) Return to step 7);
[0021] Step 10) If the verification fails, the controller stops starting.
[0022] Preferably, step 3) includes the following steps:
[0023] Step 3.1) The method for the trusted unit to verify the first boot program module is: the trusted unit uses a digest algorithm to obtain a hash value of the first boot program module, and determines whether the obtained hash value of the first boot program module is the same as the reference value of the first boot program module, if so, executing step 3.3), otherwise executing step 3.2);
[0024] Step 3.2) Whether the number of times the trusted unit verifies the first boot program module has reached the set number, if yes, execute step 10), if not, return to execute step 3.1);
[0025] Step 3.3) The method for the trusted unit to verify the second boot program module is: the trusted unit uses a digest algorithm to obtain a hash value of the second boot program module, and determines whether the obtained hash value of the second boot program module is the same as the reference value of the second boot program module, if so, execute step 4), otherwise execute step 3.4);
[0026] Step 3.4) Whether the number of times the trusted unit verifies the second boot program module has reached a set number, if yes, execute step 10), if not, return to execute step 3.3).
[0027] Preferably, step 5) includes the following steps:
[0028] Step 5.1) The method for the first boot program module to verify the first application verification program is as follows: the signature value and public key value of the first application verification program are stored in the first boot program module, the first boot program module verifies the signature value through the public key value to obtain the reference hash value of the first application verification program, and the first boot program module calculates the calculated hash value of the first application verification program, the first boot program module determines whether the reference hash value and the calculated hash value of the first application verification program are equal, if so, execute step 6), otherwise execute step 5.2);
[0029] Step 5.2) Whether the number of times the first boot program module verifies the first application verification program has reached a set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 5.1).
[0030] Preferably, step 6) includes the following steps:
[0031] Step 6.1) The method for the second boot program module to verify the verification unit is: the signature value and the public key value of the verification unit are stored in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the verification unit, and the second boot program module calculates the calculated hash value of the verification unit, the second boot program module determines whether the reference hash value and the calculated hash value of the verification unit are equal, if so, execute step 7), if not, execute step 6.2);
[0032] Step 6.2) The second boot program module verifies whether the number of times the verification unit has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 6.1).
[0033] Preferably, the step 7) includes the following steps:
[0034] Step 7.1) The method for the second boot program module to verify the first application module is: storing the signature value and public key value of the first application module in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the first application module, and the second boot program module calculates the calculated hash value of the first application module, the second boot program module determines whether the reference hash value and the calculated hash value of the first application module are equal, if so, execute step 8), if not, execute step 7.2);
[0035] Step 7.2) Whether the number of times the second boot program module verifies the first application program module has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 7.1).
[0036] Preferably, the step 8) includes the following steps:
[0037] Step 8.1) The method for the second boot program module to verify the second application is: storing the signature value and public key value of the second application in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the second application, and the second boot program module calculates the calculated hash value of the second application, the second boot program module determines whether the reference hash value and the calculated hash value of the second application are equal, if so, execute step 9), otherwise execute step 8.2);
[0038] Step 8.2) The second boot program module verifies whether the number of times the second application has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 8.1).
[0039] Preferably, the set number of times in step 3), step 5), step 6), step 7) and step 8) is 3 times.
[0040] The present solution also provides a storage medium, which stores one or more programs. When the one or more programs are run by a processor, the program verification method of the multi-core controller is executed.
[0041] When performing program verification of the controller, this solution sets a verification core and multiple startup cores in the controller, and divides the first application module in the startup core into a first application verification program and multiple first applications, and the second application module in the verification core is divided into a verification unit and a second application. In this way, after the first boot program module passes the verification of the first application verification program, the first application module can be directly started. At the same time, after the second boot program module passes the verification of the verification unit, the verification unit will verify all programs in the first application module. When any program in the first application module fails the verification, the controller will stop starting. In this way, the controller does not need to complete the verification of all programs before starting. The controller of this solution will start after verifying some programs. At the same time, the detection unit will verify all programs after starting. Once the verification fails, the controller will stop starting. Therefore, this solution greatly reduces the startup time of the controller and also ensures the safety of the controller. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 A system block diagram of a program verification system for a multi-core controller of the present invention;
[0043] Figure 2 It is a flow chart of the program verification method of the multi-core controller of the present invention;
[0044] Figure 3 A system block diagram of a specific embodiment of a program verification system for a multi-core controller of the present invention. DETAILED DESCRIPTION
[0045] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0046] As attached Figure 1 As shown, a program verification system for a multi-core controller includes a trusted unit, a startup enabling unit, a verification core, and multiple startup cores;
[0047] A first boot program module and a first application program module are provided in the startup core, and the first application program module includes a first application verification program and a plurality of first application programs;
[0048] A second boot program module and a second application program module are provided in the verification core, the second application program module includes a verification unit and a second application program, and the verification unit is used to verify the first application program module and the second application program;
[0049] The trusted unit is a storage unit with a one-time write feature, and the reference values of the first boot program module and the second boot program module are stored in the trusted unit;
[0050] The flag bit of the boot enabling unit is assigned by the trusted unit, the first boot program module, the second boot program module and the verification unit, and the trusted unit can verify the flag bit of the boot enabling unit when the controller is powered on.
[0051] As attached Figure 2 As shown, a program verification method for a multi-core controller adopts the program verification system of the multi-core controller, and includes the following steps:
[0052] Step 1) Power on the controller;
[0053] Step 2) The trusted unit verifies the flag bit of the start-up enable unit. If the verification passes, execute step 3. If the verification fails, execute step 10.
[0054] Step 3) The trusted unit verifies each first boot program module and the second boot program module. If both verifications pass, execute step 4). If any verification fails, execute step 10);
[0055] Step 4) running each first boot program module and the second boot program module;
[0056] Step 5) Each first boot program module verifies the corresponding first application verification program respectively. If the verification passes, the first application program module is started and step 6 is executed. If the verification fails, the flag bit corresponding to the startup enable unit is assigned a value of 0 and step 10 is executed.
[0057] Step 6) The second boot program module verifies the verification unit. If the verification passes, step 7 is executed. If the verification fails, the flag bit corresponding to the startup enable unit is assigned a value of 0 and step 10 is executed.
[0058] Step 7) The verification unit verifies each first application module. If the verification passes, step 8 is executed. If the verification fails, a flag bit corresponding to the start-up enabling unit is assigned a value of 0 and step 10 is executed.
[0059] Step 8) The verification unit verifies the second application program. If the verification passes, step 9 is executed. If the verification fails, a flag bit corresponding to the start-up enabling unit is assigned a value of 0 and step 10 is executed.
[0060] Step 9) Return to step 7);
[0061] Step 10) If the verification fails, the controller stops starting.
[0062] In this embodiment, step 3) includes the following steps:
[0063] Step 3.1) The method for the trusted unit to verify the first boot program module is: the trusted unit uses a digest algorithm to obtain a hash value of the first boot program module, and determines whether the obtained hash value of the first boot program module is the same as the reference value of the first boot program module, if so, execute step 3.3), otherwise execute step 3.2);
[0064] Step 3.2) Whether the number of times the trusted unit verifies the first boot program module has reached the set number, if yes, execute step 10), if not, return to execute step 3.1);
[0065] Step 3.3) The method for the trusted unit to verify the second boot program module is: the trusted unit uses a digest algorithm to obtain a hash value of the second boot program module, and determines whether the obtained hash value of the second boot program module is the same as the reference value of the second boot program module. If so, execute step 4); otherwise, execute step 3.4);
[0066] Step 3.4) Whether the number of times the trusted unit verifies the second boot program module has reached the set number, if yes, execute step 10), if not, return to execute step 3.3).
[0067] In this embodiment, step 5) includes the following steps:
[0068] Step 5.1) The method for the first boot program module to verify the first application verification program is as follows: the signature value and public key value of the first application verification program are stored in the first boot program module, the first boot program module verifies the signature value through the public key value to obtain the reference hash value of the first application verification program, and the first boot program module calculates the calculated hash value of the first application verification program, the first boot program module determines whether the reference hash value and the calculated hash value of the first application verification program are equal, if so, execute step 6), if not, execute step 5.2);
[0069] Step 5.2) Whether the number of times the first boot program module verifies the first application verification program has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 5.1).
[0070] In this embodiment, step 6) includes the following steps:
[0071] Step 6.1) The method for the second boot program module to verify the verification unit is: the signature value and the public key value of the verification unit are stored in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the verification unit, and the second boot program module calculates the calculated hash value of the verification unit, the second boot program module determines whether the reference hash value and the calculated hash value of the verification unit are equal, if so, execute step 7), if not, execute step 6.2);
[0072] Step 6.2) The second boot program module verifies whether the number of times the verification unit has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enable unit and then execute step 10), if not, return to execute step 6.1).
[0073] In this embodiment, step 7) includes the following steps:
[0074] Step 7.1) The method for the second boot program module to verify the first application module is: the signature value and public key value of the first application module are stored in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the first application module, and the second boot program module calculates the calculated hash value of the first application module, the second boot program module determines whether the reference hash value and the calculated hash value of the first application module are equal, if so, execute step 8), if not, execute step 7.2);
[0075] Step 7.2) The second boot program module verifies whether the number of times the first application program module has reached the set number, if so, assign 0 to the flag bit corresponding to the boot enable unit and then execute step 10), if not, return to execute step 7.1).
[0076] In this embodiment, step 8) includes the following steps:
[0077] Step 8.1) The method for the second boot program module to verify the second application is: the signature value and public key value of the second application are stored in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the second application, and the second boot program module calculates the calculated hash value of the second application, the second boot program module determines whether the reference hash value and the calculated hash value of the second application are equal, if so, execute step 9), otherwise execute step 8.2);
[0078] Step 8.2) The second boot program module verifies whether the number of times the second application has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 8.1).
[0079] In this embodiment, the setting times in step 3), step 5), step 6), step 7) and step 8) are all 3 times.
[0080] The present solution also provides a storage medium, which stores one or more programs. When the one or more programs are run by a processor, the program verification method of the multi-core controller is executed. Specific embodiments
[0081] The following further describes the scheme in the form of a controller including a check core and a startup core:
[0082] like Figure 3As shown, the controller includes a startup core, namely core 1, and a verification core, namely core 2. Each core runs independently. The trusted unit is a storage unit with a one-time write feature, that is, once the program in the trusted unit is written, it cannot be modified. During specific execution, the trusted unit can be a storage area with a one-time write feature inside each core, or it can be an area independent of the core. There is no limitation. In this solution, the trusted unit is a storage unit independent of the two cores.
[0083] After the controller is powered on, the trusted unit is started first. The trusted unit stores the reference values of the first boot program module and the second boot program module (i.e., the legal SHA256 value). After writing, the trusted unit cannot be changed. After the trusted unit is started, the flag bit of the boot enable unit is checked. The boot enable unit is used to identify whether the programs of core 1 and core 2 before the last power-off are legal. The specific identification method is not limited and can be set according to the specific situation. In this specific scheme: 00 indicates that both cores are illegal, 11 indicates that both cores are legal, 01 indicates that core 1 is illegal and core 2 is legal, and 10 indicates that core 1 is legal and core 2 is illegal. In this way, the trusted unit needs to check whether the boot enable unit is 11. If it is not 11, the controller stops starting. If it is 11, it means that the programs of the two cores with the flag bit of the boot enable unit are legal when the last power-off is on, then the trusted unit continues to check the integrity and legality of the first boot program module and the second boot program module. The verification algorithm can be an international or national secret general signature algorithm without specific restrictions. Specifically, the trusted unit first verifies the first boot program module. The trusted unit calls the digest algorithm SHA256 to calculate the SHA256 value (hash value) of the first boot program module and compares it with the reference value in the trusted unit. If they are different, the verification is repeated three times. If they are still different, the controller stops starting. If they are the same, the SHA256 value of the second boot program module is verified in the same way as the verification of the first boot program module. If the verification fails, the controller stops starting. If the verification succeeds, the core 1 program jumps to the first boot program module and the core 2 program jumps to the second boot program module. In core 1, the first application program module is sampled and divided into n parts. The sampling method can be uniform division, extraction of key points, etc., without specific restrictions. The first boot program module verifies the integrity and legality of the first application verification program after sampling the first application program module. Specifically, the first boot program module stores the signature value of the first application verification program and the public key value corresponding to the signature private key. The signature value is obtained by first calculating SHA256 by the first application verification program and then signing it with the private key in a pair of RSA2048 keys. After the first application verification program runs, the calculated SHA256 of the first application verification program is calculated, and the signature value is verified by the public key to obtain the base SHA256 of the application. If the two are different, the verification is repeated 3 times. If they are still different, the controller stops running. If they are the same, the verification passes and the first application module starts running. Similarly, core 2 divides the second application module into a verification unit and a second application, and the second boot program module performs integrity and legitimacy authentication on the verification unit.Specifically, the second boot program module stores the signature value of the verification unit and the public key value corresponding to the signature private key. The signature value is obtained by first calculating SHA256 of the verification unit and then signing it with the RSA2048 private key. After the second boot program module is running, the calculation SHA256 of the verification unit is calculated, and the signature value is verified by the public key to obtain the baseline SHA256 of the application. If the two are different, the verification is repeated 3 times. If they are still different, the controller stops running. If they are the same, the verification unit starts. After the verification unit passes the authentication, the verification unit is executed, and then the verification unit verifies the first application module in real time and cyclically. The verification order is not limited. The verification algorithm includes international and national secret general signature algorithms, and there is no specific restriction. If the verification fails, the verification is repeated. After multiple verification failures (the specific number is not limited), it is determined that the core 1 program has been illegally tampered with, and the startup enable unit is recorded as 01 (core 1 is illegal). If the verification is successful, the verification unit continues to verify the second application. The verification algorithm includes international and national secret general signature algorithms, and there is no specific restriction. If the verification fails, the verification is repeated multiple times (the specific number is not limited). If it still fails, the program stops at the verification unit, and the startup enable unit is recorded as 10 (core 2 is illegal). Specifically, the verification unit stores the signature values of the first application module and the second application. After the verification unit is started, the first application module and the second application are verified in the same way as the verification of the first application verification program module and the verification unit. When the verification of the first application module fails 3 times, the startup enable unit is assigned to 01. When the verification of the second application fails 3 times, the startup enable unit is assigned to 10.
[0084] When the controller is powered on again, the trusted unit is run first. After the trusted unit is started, the boot enable unit is checked. When the boot enable unit value is 10, 01 or 00, the controller stops starting and the program stays in the trusted unit.
[0085] It should be noted that the sampling ratio of the first application verification program is not limited, and the sampling principle is to meet the startup time requirement, maximize sampling, and the sampling method can be uniform sampling, key area sampling, etc., or other sampling methods, without limitation. When multiple startup cores are included in the controller, such as the controller also includes core 3, core 4, core 5, etc., core 3, core 4, core 5 are all startup cores, and the overall architecture of core 3, core 4, core 5 is similar to core 1, and the verification unit in core 2 needs to verify the first application program module in core 3, core 4, and core 5 respectively. Therefore, the above method of this solution can be analogized to the verification of controllers with multiple cores, which are all within the protection scope of this patent and will not be described in detail.
[0086] When performing program verification of the controller, this solution sets a verification core and multiple startup cores in the controller, and divides the first application module in the startup core into a first application verification program and multiple first applications, and the second application module in the verification core is divided into a verification unit and a second application. In this way, after the first boot program module passes the verification of the first application verification program, the first application module can be directly started. At the same time, after the second boot program module passes the verification of the verification unit, the verification unit will verify all programs in the first application module. When any program in the first application module fails the verification, the controller will stop starting. In this way, the controller does not need to complete the verification of all programs before starting. The controller of this solution will start after verifying some programs. At the same time, the detection unit will verify all programs after starting. Once the verification fails, the controller will stop starting. Therefore, this solution greatly reduces the startup time of the controller and also ensures the safety of the controller.
[0087] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit the technical solution. Those skilled in the art should understand that those modifications or equivalent substitutions of the technical solution of the present invention that do not depart from the purpose and scope of the technical solution should be included in the scope of the claims of the present invention.
Claims
1. A program verification system for a multi-core controller, characterized in that: It includes a trusted unit, a boot enable unit, a verification core, and multiple boot cores; The startup core is provided with a first boot program module and a first application program module, wherein the first application program module includes a first application verification program and a plurality of first application programs; The verification core is provided with a second boot program module and a second application program module, the second application program module includes a verification unit and a second application program, the verification unit is used to verify the first application program module and the second application program; The trusted unit is a storage unit with a one-time write feature, and the reference values of the first boot program module and the second boot program module are stored in the trusted unit; The flag bit of the boot enabling unit is assigned by the trusted unit, the first boot program module, the second boot program module and the verification unit, and the trusted unit can verify the flag bit of the boot enabling unit when the controller is powered on; The first application module is sampled and divided into n parts. The first boot program module verifies the integrity and legality of the first application verification program after sampling the first application module. The controller will start after verifying some programs. At the same time, the detection unit will verify all programs after starting, thereby greatly reducing the startup time of the controller and ensuring the safety of the controller.
2. A program verification method for a multi-core controller, characterized in that: A program checking system using a multi-core controller as claimed in claim 1, comprising the following steps: Step 1) Power on the controller; Step 2) The trusted unit verifies the flag bit of the startup enable unit. If the verification passes, step 3 is executed. If the verification fails, step 10 is executed. Step 3) The trusted unit verifies each of the first boot program module and the second boot program module. If both verifications pass, execute step 4). If any verification fails, execute step 10). Step 4) running each of the first boot program module and the second boot program module; Step 5) Each of the first boot program modules verifies the corresponding first application verification program respectively. If the verification passes, the first application program module is started and step 6 is executed. If the verification fails, the flag bit corresponding to the startup enabling unit is assigned a value of 0 and step 10 is executed. Step 6) The second boot program module verifies the verification unit. If the verification passes, step 7 is executed. If the verification fails, a flag bit corresponding to the startup enabling unit is assigned a value of 0 and step 10 is executed. Step 7) the verification unit verifies each of the first application modules, and if the verification passes, executes step 8); if the verification fails, assigns a value of 0 to the flag bit corresponding to the start-up enabling unit and then executes step 10); Step 8) the verification unit verifies the second application program, and if the verification passes, executes step 9); if the verification fails, assigns a value of 0 to the flag bit corresponding to the startup enabling unit and then executes step 10); Step 9) Return to step 7); Step 10) If the verification fails, the controller stops starting.
3. The program verification method of a multi-core controller according to claim 2, characterized in that: Step 3) includes the following steps: Step 3.1) The method for the trusted unit to verify the first boot program module is: the trusted unit uses a digest algorithm to obtain a hash value of the first boot program module, and determines whether the obtained hash value of the first boot program module is the same as the reference value of the first boot program module, if so, executing step 3.3), otherwise executing step 3.2); Step 3.2) Whether the number of times the trusted unit verifies the first boot program module has reached the set number, if yes, execute step 10), if not, return to execute step 3.1); Step 3.3) The method for the trusted unit to verify the second boot program module is: the trusted unit uses a digest algorithm to obtain a hash value of the second boot program module, and determines whether the obtained hash value of the second boot program module is the same as the reference value of the second boot program module, if so, execute step 4), otherwise execute step 3.4); Step 3.4) Whether the number of times the trusted unit verifies the second boot program module has reached a set number, if yes, execute step 10), if not, return to execute step 3.3).
4. The program verification method of a multi-core controller according to claim 3, characterized in that: Step 5) includes the following steps: Step 5.1) The method for the first boot program module to verify the first application verification program is as follows: the signature value and public key value of the first application verification program are stored in the first boot program module, the first boot program module verifies the signature value through the public key value to obtain the reference hash value of the first application verification program, and the first boot program module calculates the calculated hash value of the first application verification program, the first boot program module determines whether the reference hash value and the calculated hash value of the first application verification program are equal, if so, execute step 6), otherwise execute step 5.2); Step 5.2) Whether the number of times the first boot program module verifies the first application verification program has reached a set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 5.1).
5. The program verification method of a multi-core controller according to claim 4, characterized in that: Step 6) includes the following steps: Step 6.1) The method for the second boot program module to verify the verification unit is: the signature value and the public key value of the verification unit are stored in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the verification unit, and the second boot program module calculates the calculated hash value of the verification unit, the second boot program module determines whether the reference hash value and the calculated hash value of the verification unit are equal, if so, execute step 7), if not, execute step 6.2); Step 6.2) The second boot program module verifies whether the number of times the verification unit has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 6.1).
6. The program verification method of a multi-core controller according to claim 5, characterized in that: The step 7) includes the following steps: Step 7.1) The method for the second boot program module to verify the first application module is: storing the signature value and public key value of the first application module in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the first application module, and the second boot program module calculates the calculated hash value of the first application module, the second boot program module determines whether the reference hash value and the calculated hash value of the first application module are equal, if so, execute step 8), if not, execute step 7.2); Step 7.2) Whether the number of times the second boot program module verifies the first application program module has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 7.1).
7. The program verification method of a multi-core controller according to claim 6, characterized in that: The step 8) includes the following steps: Step 8.1) The method for the second boot program module to verify the second application is: storing the signature value and public key value of the second application in the second boot program module, the second boot program module verifies the signature value through the public key value to obtain the reference hash value of the second application, and the second boot program module calculates the calculated hash value of the second application, the second boot program module determines whether the reference hash value and the calculated hash value of the second application are equal, if so, execute step 9), otherwise execute step 8.2); Step 8.2) The second boot program module verifies whether the number of times the second application has reached the set number, if so, assign 0 to the flag bit corresponding to the startup enabling unit and then execute step 10), if not, return to execute step 8.1).
8. The program verification method of a multi-core controller according to claim 7, characterized in that: The set times in step 3), step 5), step 6), step 7) and step 8) are all 3 times.
9. A storage medium, characterized in that: The storage medium stores one or more programs, and when the one or more programs are executed by the processor, the program verification method of the multi-core controller according to any one of claims 2 to 8 is executed.
