WO2017097042A1 - 一种安全芯片及其非易失性存储控制装置、方法 - Google Patents

一种安全芯片及其非易失性存储控制装置、方法 Download PDF

Info

Publication number
WO2017097042A1
WO2017097042A1 PCT/CN2016/102839 CN2016102839W WO2017097042A1 WO 2017097042 A1 WO2017097042 A1 WO 2017097042A1 CN 2016102839 W CN2016102839 W CN 2016102839W WO 2017097042 A1 WO2017097042 A1 WO 2017097042A1
Authority
WO
WIPO (PCT)
Prior art keywords
unit
cyclic redundancy
storage area
redundancy check
check value
Prior art date
Application number
PCT/CN2016/102839
Other languages
English (en)
French (fr)
Inventor
谢华
刘娟
唐佳捷
Original Assignee
国民技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 国民技术股份有限公司 filed Critical 国民技术股份有限公司
Publication of WO2017097042A1 publication Critical patent/WO2017097042A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/70Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer
    • G06F21/78Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data
    • G06F21/79Protecting specific internal or peripheral components, in which the protection of a component leads to protection of the entire computer to assure secure storage of data in semiconductor storage media, e.g. directly-addressable memories

Definitions

  • the present invention relates to the field of security chip technologies, and in particular, to a security chip and a nonvolatile storage control device and method thereof.
  • Security chip refers to integrated circuit chip with data encryption and anti-security attack technology. It is widely used in digital signature, identity authentication and other fields. For example, common bus cards and social security cards, such as smart cards and online banking, are all security chip applications. example.
  • Non-intrusive attacks do not need to directly touch the internal components of the chip, nor do they cause any damage to the chip.
  • timing attack and power analysis belong to this category; intrusive attacks require direct contact with internal components of the chip, such as chemistry.
  • Corrosion and laser cutting are examples of this type; semi-invasive attacks are between non-invasive and invasive attacks. They also need to open the chip's package to access the chip surface, but do not need to make electrical contact with the metal surface. There is no mechanical damage to silicon, such as the common laser attack.
  • the common methods used by the chip to combat laser attacks mainly include the use of a passive shielding layer (covering a large area of metal layer on the surface of the chip), a light sensor, and an increase in data check bits.
  • the method of metal shielding layer can only be applied to the front side of the chip due to the limitations of existing processes and manufacturing conditions. If the laser attacks from the back of the chip, the gold The shielding layer does not work; at the same time, the method of the photosensor is limited by the chip area limitation, so it always exists at a certain density and cannot spread the entire chip.
  • FIG. 1 is a schematic structural diagram of a conventional security chip. As shown in FIG. 1 , the security chip mainly includes:
  • the security algorithm unit 101 is configured to implement a security algorithm.
  • the security algorithm includes an RSA (Rivest Shamir Adlemen, a public key encryption) algorithm, an AES (Advanced Encryption Standard) algorithm, a hash (HASH) algorithm, and the like. ;
  • the power management unit 103 is configured to provide a stable and reliable power supply for the entire chip, and cooperate with a low power consumption strategy of the system;
  • the safety protection unit 104 generally includes a light sensor, a temperature sensor, a magnetic field sensor, and the like;
  • Microprocessor and bus matrix 105 the core of the whole chip, which is connected with various peripherals through a bus matrix, thereby controlling the operation of the entire system through software running on the processor;
  • a clock and reset management unit 106 for managing the clock and reset network of the entire chip
  • the interface unit 107 generally includes a communication interface conforming to the ISO 7816 protocol or the ISO 14443 protocol;
  • a non-volatile memory and controller 108 thereof generally including a ROM, an EEPROM or a FLASH, and the like and a corresponding memory controller thereof;
  • the dynamic random access memory and its controller 109 are the memory and memory controllers required for the microprocessor to operate.
  • non-volatile memory mainly flash and EEPROM
  • flash and EEPROM always occupies a considerable area, so it is also the easiest target for semi-intrusive security attacks, and security for non-volatile memory. It has also been one of the focuses of security chip design.
  • embodiments of the present invention are expected to provide a security chip and its non-
  • the volatile storage control device and method can realize the protection of non-volatile storage data in the security chip with less hardware and system overhead.
  • Embodiments of the present invention provide a nonvolatile storage control apparatus, including: a nonvolatile memory and a storage controller;
  • the nonvolatile memory includes: a first storage area and a check storage area; wherein
  • a first storage area configured to store first write data
  • a verification storage area configured to store a cyclic redundancy check value corresponding to the first write data
  • the memory controller includes: a cyclic redundancy check unit, a check value write unit, a first write unit, a register unit, a comparison unit, and a first read unit;
  • a cyclic redundancy check unit configured to calculate a cyclic redundancy check value corresponding to the data
  • a check value writing unit configured to write a cyclic redundancy check value corresponding to the first write data into the check storage area
  • a first writing unit configured to write first write data to the first storage area
  • a registration unit configured to register a cyclic redundancy check value corresponding to the read data
  • a comparison unit configured to compare the cyclic redundancy check value in the check storage area corresponding to the read data and the cyclic redundancy check value in the register unit corresponding to the read data;
  • the first reading unit is configured to return the read data when the cyclic redundancy check value in the check storage area corresponding to the read data is the same as the cyclic redundancy check value in the register unit corresponding to the read data.
  • the storage controller further includes:
  • the alarm unit is configured to return the alarm information when the cyclic redundancy check value in the check storage area corresponding to the read data and the cyclic redundancy check value in the register unit corresponding to the read data are different.
  • the non-volatile memory further includes: a second storage area, configured to store the second write data;
  • the storage controller further includes:
  • a second writing unit configured to directly write the second write data into the second storage area
  • a second reading unit for directly returning data in the second storage area.
  • the first storage area of the non-volatile memory is not adjacent to the check storage area, or the first storage area is far from the first address of the check storage area.
  • one unit data of the first storage area corresponds to a cyclic redundancy check value of the check storage area.
  • the embodiment of the invention further provides a security chip, which includes any of the above non-volatile storage control devices.
  • the embodiment of the invention further provides a non-volatile storage control method, the method comprising:
  • the cyclic redundancy check unit calculates a cyclic redundancy check value corresponding to the first write data
  • the check value writing unit writes the cyclic redundancy check value corresponding to the first write data into the check storage area
  • the first writing unit writes the first write data into the first storage area
  • the cyclic redundancy check unit calculates a cyclic redundancy check value corresponding to the read data
  • the registration unit registers a cyclic redundancy check value corresponding to the read data
  • the first read unit returns the read data when the cyclic redundancy check value in the check storage area corresponding to the read data is the same as the cyclic redundancy check value in the register unit corresponding to the read data.
  • the method further includes:
  • the alarm unit When the cyclic redundancy check value in the check storage area corresponding to the read data is different from the cyclic redundancy check value in the register unit corresponding to the read data, the alarm unit returns the alarm information.
  • the method further includes:
  • the second write unit When performing a write operation on the second storage area, the second write unit directly writes the second write data into the second storage area;
  • the second read unit When a read operation is performed on the second storage area, the second read unit directly returns data in the second storage area.
  • the calculating the cyclic redundancy check value corresponding to the first write data includes:
  • the cyclic redundancy check value corresponding to each unit data of the first write data is calculated one by one.
  • the security chip and the non-volatile storage control device and method thereof provided by the embodiments of the present invention can perform eigenvalue calculation by using a dedicated cyclic redundancy check circuit for important data in the non-volatile memory, and The eigenvalues are stored separately from the important data, so that when the non-volatile memory of the security chip is attacked, the system can timely discover whether the important data has been tampered with, and then can promptly alarm or take other countermeasures.
  • the cyclic redundancy check circuit is used to calculate the eigenvalue, and the hardware and software implementation complexity is low, and the system performance loss is small.
  • 1 is a schematic structural view of a conventional security chip
  • FIG. 2 is a schematic structural diagram of a structure of a nonvolatile storage control apparatus according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of an implementation process of a non-volatile storage control method according to an embodiment of the present invention.
  • the nonvolatile memory and its controller in the security chip are collectively referred to as a nonvolatile storage control device.
  • the nonvolatile memory in FIG. 1 and its controller 108 may be referred to as Non-volatile storage control device 108.
  • FIG. 2 is a schematic structural diagram of a non-volatile storage control device according to an embodiment of the present invention. As shown in FIG. 2, the device includes: a non-volatile memory 21 and a storage controller 22;
  • the nonvolatile memory 21 includes: a first storage area 211 and a check storage area 212;
  • a first storage area 211 configured to store first write data
  • a verification storage area 212 configured to store a cyclic redundancy check value corresponding to the first write data
  • the memory controller 22 includes: a cyclic redundancy check unit 221, a check value write unit 222, a first write unit 223, a registration unit 224, a comparison unit 225, and a first read unit 226;
  • a cyclic redundancy check unit 221, configured to calculate a cyclic redundancy check value corresponding to the data
  • the check value writing unit 222 is configured to write the cyclic redundancy check value corresponding to the first write data into the check storage area 212;
  • the first writing unit 223 is configured to write the first write data into the first storage area 211;
  • a registering unit 224 configured to register a cyclic redundancy check value corresponding to the read data
  • the comparing unit 225 is configured to compare the cyclic redundancy check value in the check storage area 212 corresponding to the read data and the cyclic redundancy check value in the register unit 224 corresponding to the read data;
  • the first reading unit 226 is configured to return the cyclic redundancy check value in the check storage area 212 corresponding to the read data and the cyclic redundancy check value in the register unit 224 corresponding to the read data. Read the data.
  • the first write data is usually very important data. Once such data is tampered with or lost, the user of the security chip will be damaged, such as a user key, recharge card balance information, and the like. Therefore, such data needs to be specifically protected.
  • the security chip writes such data (first write data) into the nonvolatile memory 21, the first write data should be stored in the first storage area 212.
  • the storage controller 22 includes a cyclic redundancy check unit 221, and can calculate a corresponding cyclic redundancy check value for the first write data, and The check value writing unit 223 writes the cyclic redundancy check value to the check storage area 212.
  • the first write data is written by the first write unit 222 to the first storage area 211.
  • cyclic redundancy check value generator polynomials are: X8+X5+X4+1, X16+X15+X2+1, X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+ X5+X4+X2+1 and so on.
  • polynomial the advantage of cyclic redundancy check is that the hardware implementation is less difficult, takes up less logic resources, and requires less space to store the check value. This is extremely advantageous for some security chips that are sensitive to cost and power consumption, such as smart cards.
  • the storage control The cyclic redundancy check unit 221 of the controller 22 calculates a cyclic redundancy check value corresponding to the read data, and registers the cyclic redundancy check value corresponding to the read data by the register unit 224; then, the comparison unit 225 compares the read value The cyclic redundancy check value in the check storage area 212 corresponding to the data and the cyclic redundancy check value in the registration unit 224 corresponding to the read data; the loop in the check storage area 212 corresponding to the read data When the redundancy check value is the same as the cyclic redundancy check value in the register unit 224 corresponding to the read data, the non-volatile memory 21 is not destroyed, and the first read unit 226 returns the read data to the security chip. .
  • the storage controller 22 further includes:
  • the alarm unit is configured to return to the security chip when the cyclic redundancy check value in the check storage area 212 corresponding to the read data is different from the cyclic redundancy check value in the register unit 224 corresponding to the read data. Alarm information.
  • the returning the alarm information to the security chip may include:
  • the alarm unit sends an alarm signal to the internal microprocessor or chip system control unit of the security chip; the alarm signal can be securely protected and processed by the security chip firmware or the hardware system, such as internal power-off or reset of the chip.
  • some non-essential data may also be stored in the non-volatile memory 21, and such data does not need special protection. Therefore, in the above non-volatile storage control device, as shown in FIG. 2,
  • the volatile memory 21 may further include: a second storage area for storing the second write data; wherein the second write data refers to the type of data that does not need special protection;
  • the storage controller 22 may further include:
  • a second writing unit configured to directly write the second write data into the second storage area
  • a second reading unit for directly returning data in the second storage area.
  • the non-volatile storage control device can adopt different storage control strategies for data stored in the data according to different factors such as data security level and importance, thereby improving flexibility.
  • the regions 212 are preferably not adjacent, for example, such that they are separated by a second storage area; or the first address of the first storage area 211 is spaced a far distance from the first address of the verification storage area 212.
  • one unit data of the first storage area 211 corresponds to one cyclic redundancy check value of the verification storage area 212.
  • an important data may need to be stored in multiple storage units.
  • the storage unit may be 1 byte or 1 page, which is determined according to the read/write bandwidth of the non-volatile memory 21 and the application scenario;
  • Security in some embodiments, calculating a cyclic redundancy check value for each unit data of a first write data for storage, such that an important data will correspond to more than one cyclic redundancy check. value.
  • the non-volatile memory 21 may be a one-time programmable read only memory (OTP ROM), an electrically erasable programmable read only memory (EEPROM) or a flash memory, and the memory controller 22 may be controlled. Circuit implementation.
  • the embodiment of the invention further provides a security chip, which includes any of the above non-volatile storage control devices.
  • the embodiment of the invention further provides a non-volatile storage control method. As shown in FIG. 3, the method includes:
  • Step 301 The cyclic redundancy check unit calculates a cyclic redundancy check value corresponding to the first write data.
  • Step 302 the check value writing unit writes the cyclic redundancy check value corresponding to the first write data into the check storage area;
  • Step 303 the first write unit writes the first write data into the first storage area
  • Step 304 The cyclic redundancy check unit calculates a cyclic redundancy check value corresponding to the read data.
  • Step 305 the register unit registers a cyclic redundancy check value corresponding to the read data
  • Step 306 The comparison unit compares the cyclic redundancy check value in the check storage area corresponding to the read data with the cyclic redundancy check value in the register unit corresponding to the read data;
  • Step 307 When the cyclic redundancy check value in the check storage area corresponding to the read data is the same as the cyclic redundancy check value in the register unit corresponding to the read data, the first read unit returns the read data.
  • the above method further comprises:
  • the alarm unit When the cyclic redundancy check value in the check storage area corresponding to the read data is different from the cyclic redundancy check value in the register unit corresponding to the read data, the alarm unit returns the alarm information.
  • the foregoing method may further include:
  • the second write unit When performing a write operation on the second storage area, the second write unit directly writes the second write data into the second storage area;
  • the second read unit When a read operation is performed on the second storage area, the second read unit directly returns data in the second storage area.
  • the calculating the cyclic redundancy check value corresponding to the first write data includes:
  • the cyclic redundancy check value corresponding to each unit data of the first write data is calculated one by one.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) including computer usable program code.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that A series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing such that instructions executed on a computer or other programmable device are provided for implementing one or more processes and/or block diagrams in the flowchart The steps of a function specified in a box or multiple boxes.

Abstract

本发明公开了一种安全芯片及其非易失性存储控制装置、方法,其中,所述装置包括:非易失性存储器和存储控制器;所述非易失性存储器包括:第一存储区和校验存储区;所述存储控制器包括:循环冗余校验单元、第一写单元、校验值写单元、寄存单元、比对单元和第一读单元;其中,循环冗余校验单元,用于计算数据对应的循环冗余校验值;寄存单元,用于寄存读数据对应的循环冗余校验值;比对单元,用于比对读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值;第一读单元,用于当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值相同时,返回所述读数据;否则,出报警信号。

Description

一种安全芯片及其非易失性存储控制装置、方法 技术领域
本发明涉及安全芯片技术领域,尤其涉及一种安全芯片及其非易失性存储控制装置、方法。
背景技术
安全芯片是指带有数据加密和防安全攻击技术的集成电路芯片,广泛应用于数字签名、身份认证等领域,如常见的公交卡和社保卡等智能卡、网银优盾等都是安全芯片应用的例子。
对于安全芯片的攻击目前一般分为非侵入式攻击、侵入式攻击和半侵入式攻击等三种形式。其中,非侵入式攻击不需要直接接触芯片内部元器件,也不会对芯片造成任何损伤,比如时序攻击和功耗分析即属于此类;侵入式攻击则需要直接接触芯片内部元器件,例如化学腐蚀和激光切割等即属于此类;半侵入式攻击则介于非侵入式和侵入式攻击之间,它也需要打开芯片的封装来访问芯片表面,但不需要与金属表面进行电接触,这样对硅就没有机械损伤,例如常见的激光攻击即属于此类。
包括光注入、电磁操纵、放射线注入等在内的半侵入式攻击,在安全芯片运行的特定时刻特定物理位置,人为引入瞬间可控的干扰信号,改变芯片程序流程、存储器内容,以获取敏感权限操作及密钥等敏感信息,而其中又以激光注入最为常见。由于激光的能量集中,因而很容易使芯片内部数字逻辑产生错误翻转,或者使存储器单元发生瞬时数据错误,从而对芯片的安全性造成危害。目前芯片对抗激光攻击常用的方法主要有使用无源屏蔽层(在芯片表面覆盖大面积金属层)、光传感器和增加数据校验位等。但是金属屏蔽层的方法受现有工艺和制造条件限制只能应用于芯片正面,若激光从芯片背面进行攻击则该金 属屏蔽层不起作用;同时光传感器的方法受限于芯片面积的制约,故总是以一定密度存在而不可能布满整个芯片。
图1为现有的安全芯片的结构示意图,如图1所示,安全芯片主要包括:
安全算法单元101,用于实现安全算法,一般,安全算法包括RSA(Rivest Shamir Adlemen,一种公钥加密)算法,AES(Advanced Encryption Standard,高级对称密码标准)算法,哈希(HASH)算法等;
模拟振荡器102,用于为整个芯片系统提供所需的时钟信号;
电源管理单元103,用于为整个芯片提供稳定可靠的电源,以及配合系统的低功耗策略;
安全防护单元104,通常包括光传感器、温度传感器和磁场传感器等;
微处理器及总线矩阵105,微处理器是整个芯片的核心,它通过总线矩阵和各种外设联系起来,从而通过运行于处理器上的软件来控制整个系统的运行;
时钟及复位管理单元106,用于管理整个芯片的时钟和复位网络;
接口单元107,通常包括符合ISO 7816协议,或ISO 14443协议的通讯接口;
非易失性存储器及其控制器108,通常包括ROM,EEPROM或FLASH等及其对应的存储控制器;
动态随机存储器及其控制器109,即微处理器运行所需要的内存及内存控制器。
通常,在安全芯片中,非易失性存储器(主要指闪存和EEPROM)总是占有相当大的面积,因此也最容易成为半侵入式安全攻击的目标,而针对非易失性存储器的安全防护也一直是安全芯片设计所考虑的重点之一。
发明内容
为解决现有存在的技术问题,本发明实施例期望提供一种安全芯片及其非 易失性存储控制装置、方法,能以较小的硬件和系统开销实现对安全芯片中非易失性存储数据的保护。
本发明实施例的技术方案是这样实现的:
本发明实施例提供一种非易失性存储控制装置,该装置包括:非易失性存储器和存储控制器;
所述非易失性存储器包括:第一存储区和校验存储区;其中
第一存储区,用于存储第一写数据;
校验存储区,用于存储第一写数据对应的循环冗余校验值;
所述存储控制器包括:循环冗余校验单元、校验值写单元、第一写单元、寄存单元、比对单元和第一读单元;其中,
循环冗余校验单元,用于计算数据对应的循环冗余校验值;
校验值写单元,用于将所述第一写数据对应的循环冗余校验值写入所述校验存储区;
第一写单元,用于将第一写数据写入所述第一存储区;
寄存单元,用于寄存读数据对应的循环冗余校验值;
比对单元,用于比对读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值;
第一读单元,用于当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值相同时,返回所述读数据。
上述方案中,所述存储控制器还包括:
报警单元,用于当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值不相同时,返回报警信息。
上述方案中,所述非易失性存储器还包括:第二存储区,用于存储第二写数据;
所述存储控制器还包括:
第二写单元,用于直接将第二写数据写入所述第二存储区;
第二读单元,用于直接返回所述第二存储区中的数据。
上述方案中,所述非易失性存储器的第一存储区与校验存储区不相邻,或第一存储区与校验存储区的首地址相距较远。
上述方案中,所述非易失性存储器中,第一存储区的一个单位数据对应校验存储区的一个循环冗余校验值。
本发明实施例还提供一种安全芯片,该安全芯片中包括上述任意一种非易失性存储控制装置。
本发明实施例还提供一种非易失性存储控制方法,该方法包括:
当对第一存储区执行写操作时,
循环冗余校验单元计算第一写数据对应的循环冗余校验值;
校验值写单元将所述第一写数据对应的循环冗余校验值写入所述校验存储区;
第一写单元将所述第一写数据写入所述第一存储区;
当对所述第一存储区执行读操作时,
循环冗余校验单元计算读数据对应的循环冗余校验值;
寄存单元寄存读数据对应的循环冗余校验值;
比对单元比对读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值;
当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值相同时,第一读单元返回所述读数据。
上述方案中,所述方法还包括:
当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值不相同时,报警单元返回报警信息。
上述方案中,所述方法还包括:
当对第二存储区执行写操作时,第二写单元直接将第二写数据写入所述第二存储区;
当对第二存储区执行读操作时,第二读单元直接返回所述第二存储区中的数据。
上述方案中,所述计算第一写数据对应的循环冗余校验值包括:
对第一写数据的每单位数据逐一计算与之对应的循环冗余校验值。
本发明实施例所提供的安全芯片及其非易失性存储控制装置、方法,通过对非易失性存储器内的重要数据可使用专用的循环冗余校验电路进行特征值运算,并且将该特征值与重要数据分别独立存放,从而在安全芯片的非易失性存储器受到攻击时,系统能及时发现重要数据是否已被篡改,进而可以及时报警或采取其他应对措施。采用循环冗余校验电路计算特征值,软硬件实现复杂度低,系统性能损失小。
附图说明
图1为现有的安全芯片的结构示意图;
图2为本发明实施例提供的非易失性存储控制装置的组成结构示意图;
图3为本发明实施例提供的非易失性存储控制方法的实现流程示意图。
具体实施方式
为了更清楚地说明本发明实施例和技术方案,下面将结合附图及实施例对 本发明的技术方案进行更详细的说明,显然,所描述的实施例是本发明的一部分实施例,而不是全部实施例。基于本发明的实施例,本领域普通技术人员在不付出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例中,将安全芯片中的非易失性存储器及其控制器合称为非易失性存储控制装置,例如图1中的非易失性存储器及其控制器108可被称为非易失性存储控制装置108。
图2为本发明实施例提供的非易失性存储控制装置的结构示意图,如图2所示,所述装置包括:非易失性存储器21和存储控制器22;
所述非易失性存储器21包括:第一存储区211和校验存储区212;其中
第一存储区211,用于存储第一写数据;
校验存储区212,用于存储第一写数据对应的循环冗余校验值;
所述存储控制器22包括:循环冗余校验单元221、校验值写单元222、第一写单元223、寄存单元224、比对单元225和第一读单元226;其中,
循环冗余校验单元221,用于计算数据对应的循环冗余校验值;
校验值写单元222,用于将所述第一写数据对应的循环冗余校验值写入所述校验存储区212;
第一写单元223,用于将第一写数据写入所述第一存储区211;
寄存单元224,用于寄存读数据对应的循环冗余校验值;
比对单元225,用于比对读数据对应的所述校验存储区212中的循环冗余校验值和读数据对应的寄存单元224中的循环冗余校验值;
第一读单元226,用于当读数据对应的所述校验存储区212中的循环冗余校验值和读数据对应的寄存单元224中的循环冗余校验值相同时,返回所述读数据。
具体的,第一写数据通常是十分重要的数据,一旦这类数据被篡改或者丢失,将对安全芯片的用户造成损失,例如用户密钥,充值卡余额信息等。因此这类数据需要做专门保护。安全芯片在将这类数据(第一写数据)写入非易失性存储器21时,应将第一写数据存储于第一存储区212中。为了加强对第一写数据的保护力度,本发明实施例中,存储控制器22包括循环冗余校验单元221,可对第一写入数据计算其对应的循环冗余校验值,并由校验值写单元223将该循环冗余校验值写入校验存储区212。相应的,第一写数据由第一写单元222写入第一存储区211。
这里,用于计算循环冗余校验值的多项式的选择可以不是固定的,安全芯片可根据应用需要来选定。常用且标准的循环冗余校验值生成多项式有:X8+X5+X4+1、X16+X15+X2+1、X32+X26+X23+X22+X16+X12+X11+X10+X8+X7+X5+X4+X2+1等。但无论选用何种多项式,循环冗余校验的好处在于,硬件的实现难度较低,占用逻辑资源较少,同时存储校验值所需要的空间也少。这对于一些对成本和功耗敏感的安全芯片(例如智能卡)是极为有利的。
当安全芯片读取非易失性存储器21中第一存储区211的数据,即读取地址在第一存储区211内时,这里称读取地址对应的数据为“读数据”,则存储控制器22的循环冗余校验单元221计算该读数据对应的循环冗余校验值,并由寄存单元224寄存该读数据对应的循环冗余校验值;接着,比对单元225比对读数据对应的所述校验存储区212中的循环冗余校验值和读数据对应的寄存单元224中的循环冗余校验值;当读数据对应的所述校验存储区212中的循环冗余校验值和读数据对应的寄存单元224中的循环冗余校验值相同时,说明非易失性存储器21未遭到破坏,则第一读单元226向安全芯片返回所述读数据。
优选的,上述控制装置中,所述存储控制器22还包括:
报警单元,用于当读数据对应的所述校验存储区212中的循环冗余校验值和读数据对应的寄存单元224中的循环冗余校验值不相同时,向安全芯片返回 报警信息。
进一步的,所述向安全芯片返回报警信息可以包括:
报警单元向安全芯片内部微处理器或者芯片系统控制单元发送报警信号;可由安全芯片固件或者硬件系统对该报警信号进行安全防护和处理,例如芯片内部断电或者复位等。
在一些实施例中,非易失性存储器21中也可能存储一些不十分重要的数据,这类数据不需要专门保护,因此,上述非易失性存储控制装置中,如图2所示,非易失性存储器21还可以包括:第二存储区,用于存储第二写数据;这里,第二写数据即指不需要特别保护的那类数据;
相应的,所述存储控制器22还可以包括:
第二写单元,用于直接将第二写数据写入所述第二存储区;
第二读单元,用于直接返回所述第二存储区中的数据。
如此,非易失性存储控制装置对于存储在内的数据可根据数据安全等级、重要性等不同因素,而采用不同的存储控制策略,提高了灵活性。
进一步的,为了减少非易失性存储器21的第一存储区211与校验存储区212同时受到攻击的机率,上述控制装置中,非易失性存储器21的第一存储区211与校验存储区212最好不相邻,例如,让它们中间以第二存储区相隔;或着让第一存储区211的首地址与校验存储区212的首地址相距比较远的距离。
进一步的,上述非易失性存储器21中,第一存储区211的一个单位数据对应校验存储区212的一个循环冗余校验值。
具体的,一份重要的数据可能需要多个存储单位来保存,这里,存储单位可以是1byte,也可以是1page,具体根据非易失性存储器21的读/写带宽和应用场景确定;为了提高安全性,在一些实施例中,对一份第一写数据的每个单位数据分别计算一个循环冗余校验值进行存储,如此,一份重要的数据将对应一个以上的循环冗余校验值。
在实际应用中,上述非易失性存储器21可以是一次性可编程只读存储器(OTP ROM)、电可擦可编程只读存储器(EEPROM)或闪存(Flash),存储控制器22可以由控制电路实现。
本发明实施例还提供一种安全芯片,该安全芯片中包括上述任意一种非易失性存储控制装置。
本发明实施例还提供一种非易失性存储控制方法,如图3所示,所述方法包括:
当对第一存储区执行写操作时,
步骤301,循环冗余校验单元计算第一写数据对应的循环冗余校验值;
步骤302,校验值写单元将所述第一写数据对应的循环冗余校验值写入所述校验存储区;
步骤303,第一写单元将所述第一写数据写入所述第一存储区;
当对第一存储区执行读操作时,
步骤304,循环冗余校验单元计算读数据对应的循环冗余校验值;
步骤305,寄存单元寄存读数据对应的循环冗余校验值;
步骤306,比对单元比对读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值;
步骤307,当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值相同时,第一读单元返回所述读数据。
优选的,上述方法还包括:
当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值不相同时,报警单元返回报警信息。
进一步的,上述方法还可以包括:
当对第二存储区执行写操作时,第二写单元直接将第二写数据写入所述第二存储区;
当对第二存储区执行读操作时,第二读单元直接返回所述第二存储区中的数据。
进一步的,上述方法中,所述计算第一写数据对应的循环冗余校验值包括:
对第一写数据的每单位数据逐一计算与之对应的循环冗余校验值。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使 得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。

Claims (10)

  1. 一种非易失性存储控制装置,其特征在于,所述装置包括:非易失性存储器和存储控制器;
    所述非易失性存储器包括:第一存储区和校验存储区;其中
    第一存储区,用于存储第一写数据;
    校验存储区,用于存储第一写数据对应的循环冗余校验值;
    所述存储控制器包括:循环冗余校验单元、校验值写单元、第一写单元、寄存单元、比对单元和第一读单元;其中,
    循环冗余校验单元,用于计算数据对应的循环冗余校验值;
    校验值写单元,用于将所述第一写数据对应的循环冗余校验值写入所述校验存储区;
    第一写单元,用于将第一写数据写入所述第一存储区;
    寄存单元,用于寄存读数据对应的循环冗余校验值;
    比对单元,用于比对读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值;
    第一读单元,用于当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值相同时,返回所述读数据。
  2. 根据权利要求1所述的控制装置,其特征在于,所述存储控制器还包括:
    报警单元,用于当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值不相同时,返回报警信息。
  3. 根据权利要求1所述的控制装置,其特征在于,所述非易失性存储器还包括:第二存储区,用于存储第二写数据;
    所述存储控制器还包括:
    第二写单元,用于直接将第二写数据写入所述第二存储区;
    第二读单元,用于直接返回所述第二存储区中的数据。
  4. 根据权利要求1所述的控制装置,其特征在于,所述非易失性存储器的第一存储区与校验存储区不相邻,或第一存储区与校验存储区的首地址相距较远。
  5. 根据权利要求1所述的控制装置,其特征在于,所述非易失性存储器中,第一存储区的一个单位数据对应校验存储区的一个循环冗余校验值。
  6. 一种安全芯片,其特征在于,所述安全芯片中包括根据权利要求1至5任一项所述的非易失性存储控制装置。
  7. 一种非易失性存储控制方法,其特征在于,所述方法包括:
    当对第一存储区执行写操作时,
    循环冗余校验单元计算第一写数据对应的循环冗余校验值;
    校验值写单元将所述第一写数据对应的循环冗余校验值写入所述校验存储区:
    第一写单元将所述第一写数据写入所述第一存储区;
    当对所述第一存储区执行读操作时,
    循环冗余校验单元计算读数据对应的循环冗余校验值;
    寄存单元寄存读数据对应的循环冗余校验值;
    比对单元比对读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值;
    当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值相同时,第一读单元返回所述读数据。
  8. 根据权利要求7所述的控制方法,其特征在于,所述方法还包括:
    当读数据对应的所述校验存储区中的循环冗余校验值和读数据对应的寄存单元中的循环冗余校验值不相同时,报警单元返回报警信息。
  9. 根据权利要求7所述的控制方法,其特征在于,所述方法还包括:
    当对第二存储区执行写操作时,第二写单元直接将第二写数据写入所述第二存储区;
    当对第二存储区执行读操作时,第二读单元直接返回所述第二存储区中的数据。
  10. 根据权利要求7所述的控制方法,其特征在于,所述计算第一写数据对应的循环冗余校验值包括:
    对第一写数据的每单位数据逐一计算与之对应的循环冗余校验值。
PCT/CN2016/102839 2015-12-07 2016-10-21 一种安全芯片及其非易失性存储控制装置、方法 WO2017097042A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510894144.0A CN106845289A (zh) 2015-12-07 2015-12-07 一种安全芯片及其非易失性存储控制装置、方法
CN201510894144.0 2015-12-07

Publications (1)

Publication Number Publication Date
WO2017097042A1 true WO2017097042A1 (zh) 2017-06-15

Family

ID=59012668

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102839 WO2017097042A1 (zh) 2015-12-07 2016-10-21 一种安全芯片及其非易失性存储控制装置、方法

Country Status (3)

Country Link
CN (1) CN106845289A (zh)
TW (1) TWI619019B (zh)
WO (1) WO2017097042A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947590A (zh) * 2019-03-27 2019-06-28 奇瑞商用车(安徽)有限公司 一种汽车电子系统中数据冗余校验的方法
CN110276213A (zh) * 2019-06-24 2019-09-24 恒宝股份有限公司 一种智能卡及其敏感结果的存储和校验方法
DE102021132005A1 (de) 2021-12-06 2023-06-07 Trumpf Laser Gmbh Steuerungsverfahren und Steuerungseinrichtung für eine Laserbearbeitungsmaschine

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107451494B (zh) * 2017-06-30 2020-05-22 杭州旗捷科技有限公司 一种芯片改写设备的数据保护方法、电子设备及存储介质
WO2020019267A1 (zh) * 2018-07-26 2020-01-30 华为技术有限公司 一种数据处理方法及装置
CN111274186B (zh) * 2020-01-19 2022-06-24 北京中微芯成微电子科技有限公司 一种提高中央处理器执行效率的单片机
CN112464499B (zh) * 2020-12-24 2023-05-26 芯天下技术股份有限公司 非易失芯片擦写数据检查方法、装置、存储介质和终端
CN115398862A (zh) * 2021-03-09 2022-11-25 华为技术有限公司 攻击检测方法和装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN200990146Y (zh) * 2006-06-09 2007-12-12 刘明豪 多路径识别装置
CN102890657A (zh) * 2012-10-10 2013-01-23 深圳市航盛电子股份有限公司 一种减少eeprom的数据读写出错的方法
CN103034562A (zh) * 2011-07-14 2013-04-10 Lsi公司 闪存介质控制器中的元数据处理
CN103809147A (zh) * 2012-11-12 2014-05-21 苏州工业园区新宏博通讯科技有限公司 一种交流电表故障自诊断方法

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI384367B (zh) * 2008-12-31 2013-02-01 Askey Computer Corp 韌體更新系統及方法
US8726104B2 (en) * 2011-07-28 2014-05-13 Sandisk Technologies Inc. Non-volatile memory and method with accelerated post-write read using combined verification of multiple pages
KR101213119B1 (ko) * 2011-12-16 2012-12-18 플러스기술주식회사 부정 컨텐츠 차단 방법 및 시스템
CN103365737B (zh) * 2012-04-06 2016-09-14 国民技术股份有限公司 数据读写方法、读写装置及数据存储系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN200990146Y (zh) * 2006-06-09 2007-12-12 刘明豪 多路径识别装置
CN103034562A (zh) * 2011-07-14 2013-04-10 Lsi公司 闪存介质控制器中的元数据处理
CN102890657A (zh) * 2012-10-10 2013-01-23 深圳市航盛电子股份有限公司 一种减少eeprom的数据读写出错的方法
CN103809147A (zh) * 2012-11-12 2014-05-21 苏州工业园区新宏博通讯科技有限公司 一种交流电表故障自诊断方法

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109947590A (zh) * 2019-03-27 2019-06-28 奇瑞商用车(安徽)有限公司 一种汽车电子系统中数据冗余校验的方法
CN110276213A (zh) * 2019-06-24 2019-09-24 恒宝股份有限公司 一种智能卡及其敏感结果的存储和校验方法
CN110276213B (zh) * 2019-06-24 2021-03-16 恒宝股份有限公司 一种智能卡及其敏感结果的存储和校验方法
DE102021132005A1 (de) 2021-12-06 2023-06-07 Trumpf Laser Gmbh Steuerungsverfahren und Steuerungseinrichtung für eine Laserbearbeitungsmaschine

Also Published As

Publication number Publication date
TWI619019B (zh) 2018-03-21
TW201721442A (zh) 2017-06-16
CN106845289A (zh) 2017-06-13

Similar Documents

Publication Publication Date Title
WO2017097042A1 (zh) 一种安全芯片及其非易失性存储控制装置、方法
US11562075B2 (en) Secure booting method, apparatus, device for embedded program, and storage medium
US9953166B2 (en) Method for securely booting target processor in target system using a secure root of trust to verify a returned message authentication code recreated by the target processor
US10733291B1 (en) Bi-directional communication protocol based device security
US20220224550A1 (en) Verification of identity using a secret key
KR20210132216A (ko) 동작 동안 긴급 차량의 아이덴티티 검증
KR20210131444A (ko) 물리적 복제 방지 기능을 사용한 컴퓨팅 디바이스에 대한 신원 생성
US20170289193A1 (en) Secure smart terminal and an information processing method
US20170288874A1 (en) Cryptographic protection for trusted operating systems
TW201543265A (zh) 用以確保存取保護計畫之裝置及方法
US20200065528A1 (en) Storage device and program
US20140310535A1 (en) Electronic Device with Flash Memory Component
EP3757838B1 (en) Warm boot attack mitigations for non-volatile memory modules
JP2018169694A (ja) 故障利用攻撃に対しての耐タンパー性を持たせたセキュリティデバイス
US11533172B2 (en) Apparatus and method for securely managing keys
US11269986B2 (en) Method for authenticating a program and corresponding integrated circuit
US10009339B2 (en) System, apparatus and method for securely protecting a processor in transit
US20140289874A1 (en) Integrated circuit (ic) chip and method of verifying data thereof
JP6396119B2 (ja) Icモジュール、icカード、及びicカードの製造方法
CN103336919A (zh) 实现仪表加密验证控制功能的系统和方法
JP5724387B2 (ja) 携帯装置及び動的データの格納位置変更方法
CN111357003A (zh) 预操作系统环境中的数据保护
CN107766914B (zh) 用于电子标签有限次操作的安全防护方法
JP6610002B2 (ja) 演算装置、演算方法、及び演算処理プログラム
EP3314810A1 (en) Secured credential aggregator

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16872236

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16872236

Country of ref document: EP

Kind code of ref document: A1