CROSS-REFERENCE TO RELATED APPLICATIONS

The disclosure of Japanese Patent Application No. 2018-236817 filed on Dec. 18, 2018 including the specification, drawings and abstract is incorporated herein by reference in its entirety.

BACKGROUND

The present disclosure relates to security techniques in microcontrollers and semiconductor device.

In the microcontroller, various measures are taken to prevent data tampering by a malicious program or leakage of a cryptographic key used for security data processing.

Programs executed by the microcontroller generally have a hierarchical structure such as firmware, an operating system (OS), drivers, middleware (also called libraries), and applications, but security measures must also be taken in consideration of this hierarchical structure.

Patent Document 1 describes a technique related to security measures in consideration of a hierarchical structure of software. More specifically, when a program composed of a main program and a sub-program called from the main program is executed, a return destination address at the time of returning from the sub-program to the main program is acquired. Based on the acquired return destination address, the OS is used to determine whether the main program is in the memory area in the executable state or whether the main program matches the attribute information registered in advance. If the main program is in the memory area in the executable state and the attribute information also matches, the main program is judged to be legitimate, otherwise, it is judged to be illegal, and the execution of the program is stopped.

Here, the sub-program is, for example, a plug-in that provides a security function.

PRIOR-ART DOCUMENT

[Patent Document]

[Patent Document 1] Japanese Unexamined Publication Laid-Open No. 2007-148962

SUMMARY

However, since whether the main program is legitimate or not is realized by software including the OS, security measures are not sufficient. This is because, in the case of software, a technique of falsification and leakage of information using a defect of software is known.

Other objects and novel features will become apparent from the description of the specification and drawings.

Means of Solving the Problems

The microcontroller according to the embodiment includes a CPU and a cryptographic processing circuit, and when a first program uses the cryptographic processing circuit, a second program transmits installation information of the first program and program installation information encrypted in advance to the cryptographic processing circuit. The cryptographic processing circuit decrypts the encrypted program installation information and compares it with the installation information of the first program. In the case of coincidence, the use of the cryptographic processing circuit by the first program is permitted.

The microcontroller according to another embodiment includes a CPU, a cryptographic processing circuit, a memory storing previously encrypted installation information, and a task management circuit, and the task management circuit transmits installation information corresponding to a task to the cryptographic processing circuit at the time of task switching. The cryptographic processing circuit decrypts the encrypted installation information and compares it with the installation information. If there is a match, the use of the cryptographic processing circuit by the switched task is permitted.

In the microcontroller according to one embodiment, the security capability of the microcontroller can be improved.

