Abstract:
A method for recording at least one information block in a first volatile memory external to a circuit, a first digital signature being calculated based on information and data internal to the circuit and a second digital signature being calculated based on first signatures of a group of information blocks and on a digital quantity internal to the circuit and assigned to said group. A method for checking the content of an information block recorded by this recording method.

Description:
BACKGROUND OF THE INVENTION  
       [0001]    1. Field of the Invention 
         [0002]    The present invention generally relates to electronic circuits and, more specifically, to microprocessors exploiting an external memory. “External memory” means a memory connected to the processor by communication buses accessible for a measurement of the electric signals, for example, by a possible person attempting to fraud. 
         [0003]    The present invention more specifically applies to the checking of the integrity (the absence of modification between the writing and the reading thereof) of information contained in an external volatile memory for processing by a microprocessor. 
         [0004]    2. Discussion of the Related Art 
         [0005]    A solution to check the integrity of the content of a memory read by a microprocessor is known as the CRC (Cyclic Redundancy Check) and comprises storing, with the content of a block in the memory, a value representative of this content. This value is then checked on reading to detect possible errors in the content of the memory block. Such a solution may be efficient to detect incidental errors but is not efficient against a possible hacking. Indeed, it is enough for the hacker to know the CRC value calculation mode to be able to force the system with erroneous data, accompanied with a CRC value which will have been calculated by the hacker himself and which will be admitted by the system. 
         [0006]    Another solution comprises ciphering the entire memory content by means of a ciphering algorithm executed by the microprocessor. On reading, the data extracted from the memory are then deciphered by the microprocessor. Such a solution does not prevent the introduction of erroneous data, for example, in a fraud attempt by fault injection into the program execution, since the data or instructions will anyway be deciphered by the processor. 
         [0007]    A third solution is based on the calculation of a signature with a key (MAC—Message Authentication Code) or with no key (hash function), and comprises calculating the result of a cryptographic algorithm. US patent application n 0  2006/0253708 describes an example of a solution with a key. This solution provides good results but requires storing a large number of data (one per memory line) on the microprocessor side. Such storage spaces are not always available. 
         [0008]    U.S. Pat. No. 6,247,151 discloses a method for verifying the integrity of data stored in a memory, two signatures respectively taking into account a data and a copy of it in another memory area are generated. 
       SUMMARY OF THE INVENTION  
       [0009]    The present invention aims at overcoming all or part of the disadvantages of known methods and devices for controlling the integrity of a memory external to a microprocessor. 
         [0010]    An object more specifically is a storage-space-saving solution on the microprocessor side. 
         [0011]    Another object is a solution compatible with usual algorithms of message authentication code (MAC) calculation or the like. 
         [0012]    Another object is a solution adapted to an external memory of RAM type. 
         [0013]    To achieve all or part of these objects as well as others, an embodiment of the present invention provides a method for recording at least one information block in a first volatile memory external to a circuit, in which: 
         [0014]    a first digital signature is calculated based on information and data internal to the circuit; and 
         [0015]    a second digital signature is calculated based on first signatures of a group of information blocks and on a digital quantity internal to the circuit and assigned to said group. 
         [0016]    According to an embodiment, the second signature is stored internally to the microprocessor. 
         [0017]    According to an embodiment, the first signature is stored in the external memory. 
         [0018]    According to an embodiment, the digital quantity changes for each group. 
         [0019]    According to an embodiment, the second signature uses no key. 
         [0020]    The present invention also provides a method for checking the content of at least one block of information read from a volatile memory external a circuit, in which: 
         [0021]    a first signature stored in the external memory on recording of said block is compared with a first current signature; and 
         [0022]    a second signature stored internally to the circuit is compared with a second current signature, said signatures being calculated in accordance with the recording method. 
         [0023]    According to an embodiment, an integrity of the data block is validated only in case of an identity of the first current and stored signatures, and of the second current and stored signals. 
         [0024]    The present invention also provides a controller of the intensity of information stored in a non-volatile memory external to a circuit containing the controller. 
         [0025]    The present invention also provides a microprocessor comprising signature calculation means for the storage of an information bloc in a volatile memory external to this microprocessor. 
         [0026]    The foregoing and other objects, features, and advantages of the present invention will be discussed in detail in the following non-limiting description of specific embodiments in connection with the accompanying drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS  
         [0027]      FIG. 1  shows an architecture of a microprocessor and of an external memory of the type to which the present invention applies as an example; 
           [0028]      FIG. 2  is a block diagram of elements of an embodiment of a controller of the write integrity of data in a memory external to a microprocessor; 
           [0029]      FIG. 3  illustrates steps of an integrity control method on writing into a memory; 
           [0030]      FIG. 4  is a block diagram of an embodiment of a controller of the read integrity of data in a memory external to a microprocessor; and 
           [0031]      FIG. 5  illustrates the steps of an integrity control method on reading of data from a memory. 
       
    
    
     DETAILED DESCRIPTION  
       [0032]    The same elements have been designated with the same reference numerals in the different drawings. 
         [0033]    For clarity, only those steps and elements useful to the understanding of the present invention have been shown in the drawings and will be described. In particular, the details constitutive of the microprocessor have not been discussed, the present invention being compatible with any conventional microprocessor. Similarly, the mechanisms for addressing and exploiting information read from or written into an external memory by a microprocessor have not been detailed, the present invention being here again compatible with usual mechanisms. 
         [0034]      FIG. 1  is a block diagram of an architecture of the type to which the present invention applies as an example. An integrated system (SoC—System on Chip), for example, a microprocessor  1  comprises, among others, a central processing unit  11  (CPU) and, in the field of application of the present invention, a function  12  (CHECK) for checking the integrity of data read by the microprocessor from a memory  13  (MEM) outside (EXT) of circuit  1 . Unit  11  communicates with memory  13  (and with other elements, not shown) over several buses  14  among which an address bus  141 , a data bus  142 , and a control bus, not shown. Memory  13  preferably is a RAM, called a working memory, in which are stored data enabling the microprocessor to execute a program. These may be written and read variables or program instructions transiting through the work memory from a ROM (not shown) for execution thereof. It is considered that central unit  11  and integrity controller  12  are in a secure area of the microprocessor, that is, the data transiting through this area (or remaining therein) need not be checked as to their integrity. However, memory  13  is considered in a non-secure or open environment, which justifies checking whether the data which are read therefrom are effectively identical to those which have been written into it. In practice, memory  13  is most often contained in a different circuit than microprocessor  1 , but it may also be in the same circuit by being external to an area considered as secure. 
         [0035]    A difference between the written and read data may result from a fraud attempt by a possible hacker or an incidental malfunction. In both cases, it is useful for the microprocessor to be able to detect that the data that it is about to process do not correspond to those which have been previously stored. 
         [0036]    According to an embodiment, the data contained in work memory  13  are, by block, associated with a first integrity control authentication code or signature (MAC) stored outside of microprocessor  1  (for example, in external memory  13 ). A second authentication or integrity control code (MAC′), stored internally to the microprocessor, is a function, not of the data, but of the external authentication codes MAC of a group of memory blocks. The need for storage inside of the microprocessor is thus decreased without adversely affecting the security. After, a memory line will be taken as an example as a granularity, that is, the size of a block on which the externally-stored signature is calculated corresponds to the size of a line. In the drawings, the internal portions (secure, of the system) and the external portions (non secure) have been separated by dotted lines to better illustrate the elements and steps needed on both sides. 
         [0037]      FIG. 2  illustrates an embodiment of an integrity controller equipping an integrated system (System on Chip—SoC), for example, a microprocessor, to control the integrity of data temporarily stored in external memory  13 .  FIG. 2  illustrates the elements implied on writing of a data line Li of address i in memory plane  131  (ARRAY). 
         [0038]      FIG. 3  is a simplified flowchart illustrating the operation of the integrity controller of  FIG. 2  in a write operation. 
         [0039]    Integrity controller  12  comprises a function  121  for calculating a message authentication code (MAC) or more generally any integrity code of signature type. This block receives, for example, a key K specific to the integrated circuit. As a variation, it may be a session key of a program or more generally any known code of circuit  1 . When a data line L i  is provided by unit  11  (block  30 ,  FIG. 3 ) for storage in memory  13  (block  31 , STORE L i ), calculation function  121  is applied to data L i  (block  32 , MAC i =MAC(L i )) to be stored. For simplification, the case of a physical address i carried by bus  141  is considered, be this address directly provided by central unit  11  or be it a converted virtual address. 
         [0040]    First signature MAC i  associated with data line L i  and provided by function  121  is stored (block  33 , STORE MAC i ) in an area of memory plane  131  with all the signatures associated with a group G j  of memory lines. The size of the group is conditioned by the size of a block (a line j) of signatures. The signatures calculated for the successive lines L i  of group G j  are temporarily stored in a register  122  (MAC REG) of circuit  12 . If the granularity of the writing into the memory is finer than that of a signature group, it is however possible to perform the writings successively without waiting for the calculation of all the signatures in the group. 
         [0041]    Internally to system  1 , a reference word REF j  associated with group G j  of lines is used by a generator  123  of a signature (MAC′) associated with the group. Generator  123  calculates (block  34 , MAC′ j =MAC′({MAC i }, REF j )) a signature of a group of message authentication codes MAC i  by associating reference REF therewith. This calculation needs not take into account any secret key since code MAC′ remains internal to system  1 . Code MAC′ is, for example, stored (block  35 , STORE REF j , MAC′ j ) with reference REF j  used for its calculation, in volatile storage elements  124  (INTMEM), internal to the microprocessor (for example, a RAM, registers, etc.). Reference word REF j  is, for example, a random number drawn on each writing of a line into the memory. As a variation, word REF is the value of a counter incremented for each new information to be stored. 
         [0042]      FIG. 4  illustrates an embodiment of an integrity controller showing the elements used on reading of data from memory  13  to control that these data have not been modified since their storage. 
         [0043]      FIG. 5  illustrates, in a simplified flowchart, the operation of the read mechanism of  FIG. 4 . 
         [0044]    When an address i of a data line L i  in memory  13  is provided by central unit  11  on address bus  141  ( FIG. 4 ), the memory, via its controller, provides ( FIG. 5 , block  41 , L i , {MAC i }) not only data line L i  to the processor but also line j of signatures {MAC i } of all lines L i  of group G j . Such signatures MAC i  are stored in register  122  to be exploited by integrity controller  12 . A first current signature CMAC of data line L i  is calculated (block  42 , CMAC(L j )) by function  121 . Based on the reference of block j, identifiable by the integrity controller, signature MAC′ j  of the block is read from internal memory  124  and a current signature CMAC′ is calculated (block  44 ) based on first signatures {MAC i } extracted from line j of the memory and from reference word REF j . In parallel or successively, signature CMAC is compared (block  43 , MAC i =CMAC?) with signature MAC i  read from line j (comparator  126 ) and signature CMAC′ is compared (block  45 , MAC′ j =CMAC′?) with signature MAC′ j  (comparator  125 ). The integrity controller provides a validation signal (OK/NOK), for example, to central unit  11 , the state of which only corresponds to a validation if the states provided by comparators  125  and  126  both demonstrate a signature identity (for example, by a logic AND-type gate  127 ). The actions taken by the microprocessor after the validation signal are usual (for example, a blocking in the case of a lack of validation and/or an authorization to continue the program in case of a validation, etc.). 
         [0045]    An advantage is that the function of calculation of second signature MAC′ may be simple since all its elements remain internal to the secure system. 
         [0046]    This especially enables fast read checking in the memory. Such a mechanism is in particular faster than mechanisms known as the “Merkel tree” which comprise performing successive signature calculations based on the previous signatures. Such mechanisms require a very large number of calculations. 
         [0047]    Another advantage of the provided mechanism is that a single number (for example, random) is required per signature group. 
         [0048]    As a specific example of embodiment, signature MAC′ is calculated from a diffusion or hash function (HASH), for example, an XOR-type combination of signatures MAC i  of group j and reference REF j . Specific embodiments of the present invention have been described. Various alterations and modifications will occur to those skilled in the art. In particular, the adaptation and the selection of the sizes of codes MAC or MAC′ depends on the size of the manipulated data and on the size of the data storable in the memory. Further, the selection of the calculation function to be used and of the signature size depends on the desired security and, preferably, on the functions available on the processor side. Further, the provided solution may be combined with other integrity control solutions. 
         [0049]    Such alterations, modifications, and improvements are intended to be part of this disclosure, and are intended to be within the spirit and the scope of the present invention. Accordingly, the foregoing description is by way of example only and is not intended to be limiting. The present invention is limited only as defined in the following claims and the equivalents thereto.