PROCEDE POUR REPARTIR LA MEMOIRE D'UN CIRCUIT INTEGRE ENTRE PLUSIEURS APPLICATIONS. METHOD FOR DISTRIBUTING THE MEMORY OF AN INTEGRATED CIRCUIT BETWEEN SEVERAL APPLICATIONS.
La présente invention se rapporte aux procédés qui permettent de répartir le contenu de la mémoire d'un circuit intégré entre plusieurs applications, elles-mêmes éventuellement affectées à des utilisateurs différent. Elle s'applique plus particulièrement aux circuits intégrés destinés à être montés dans des cartes à mémoire dites cartes "à puce". Elle est particulièrement utile pour les circuits intégrés qui ne comportent pas de microprocesseur, mais seulement quelques circuits logiques qui permettent d'exploiter le contenu de la mémoire.The present invention relates to methods which make it possible to distribute the content of the memory of an integrated circuit between several applications, themselves possibly assigned to different users. It applies more particularly to integrated circuits intended to be mounted in memory cards called "smart" cards. It is particularly useful for integrated circuits which do not include a microprocessor, but only a few logic circuits which make it possible to exploit the content of the memory.
Il est connu d'interdire l'accès à la mémoire, et en fait l'utilisation, d'un circuit intégré, en inscrivant dans cette mémoire, à une adresse déterminée, un code secret. Tant que l'utilisateur n'a pas présenté ce code secret à l'entrée du circuit, celui-ci reste bloqué, tout au moins partiellement.It is known to prohibit access to the memory, and in fact use it, of an integrated circuit, by writing in this memory, at a determined address, a secret code. As long as the user has not presented this secret code at the entrance of the circuit, it remains blocked, at least partially.
On souhaite par ailleurs pouvoir utiliser un même circuit dans différentes applications, par exemple pour une carte bancaire et téléphonique. Il est alors utile de protéger séparément les accès à ces utilisations, pour éviter par exemple que l'usage téléphonique ne donne accès à l'usage bancaire. Lorsque le circuit intégré est muni d'un microprocesseur, on peut facilement concevoir une solution par logiciel à ce problème. Lorsque par contre il n'est pas muni d'un microprocesseur, il faut trouver une solution simple pour ne pas augmenter la complexité des circuits logiques d'exploitation de la mémoire, au risque d'aboutir à un circuit aussi complexe, mais moins
souple, que celui comportant un microprocesseur.We also want to be able to use the same circuit in different applications, for example for a bank and telephone card. It is therefore useful to protect access to these uses separately, to avoid, for example, that telephone use gives access to banking use. When the integrated circuit is provided with a microprocessor, one can easily conceive a solution by software with this problem. When on the other hand it is not provided with a microprocessor, it is necessary to find a simple solution not to increase the complexity of the logical circuits of memory exploitation, at the risk of leading to a circuit as complex, but less flexible, as that comprising a microprocessor.
Pour sauvegarder cette simplicité, l'invention propose un procédé pour répartir la mémoire d'un circuit intégré entre plusieurs applications, caractérisé en ce que l'on divise la mémoire en plusieurs zones correspondant chacune à une application, et que l'on associe à chaque zone un code destiné à être présenté au circuit par l'utilisateur pour autoriser quand il est reconnu l'accès à la zone à laquelle il est associé. En outre, l'invention s'applique aussi aux circuits intégrés munis d'un microprocesseur en implantant dans le logiciel le procédé de l'invention, ce qui donne à la partie de logiciel correspondante une taille réduite et une efficacité remarquable. D'autres particularités et avantages de l'invention apparaîtront clairement dans la description suivante faite en regard des figures annexées qui représentent :To save this simplicity, the invention proposes a method for distributing the memory of an integrated circuit between several applications, characterized in that the memory is divided into several zones each corresponding to an application, and which is associated with each zone a code intended to be presented to the circuit by the user to authorize when it is recognized the access to the zone with which it is associated. In addition, the invention also applies to integrated circuits fitted with a microprocessor by implementing the method of the invention in the software, which gives the corresponding software part a reduced size and remarkable efficiency. Other features and advantages of the invention will appear clearly in the following description given with reference to the appended figures which represent:
- la figure 1, une représentation schématique du déroulement du procédé selon l'invention ; - la figure 2, la structure d'un code permettant l'accès à une zone ; et- Figure 1, a schematic representation of the progress of the method according to the invention; - Figure 2, the structure of a code allowing access to an area; and
- la figure 3, un schéma partiel d'un circuit intégré selon l'invention.- Figure 3, a partial diagram of an integrated circuit according to the invention.
Selon l'invention, on attribue à chaque application implantée dans la mémoire du circuit un code d'accès, qui peut être un code secret réservé à l'utilisateur autorisé, qui ouvre l'accès à une zone particulière de la mémoire où réside l'application correspondante.According to the invention, each application located in the circuit memory is assigned an access code, which can be a secret code reserved for the authorized user, which opens access to a particular area of the memory where the user resides. 'corresponding application.
Ainsi, comme représenté sur la figure 1, l'utilisateur, qui peut être l'industriel chargé de développer une application particulière, ou le particulier utilisateur final de la carte à puce contenant le circuit intégré, commence dans une étape 101 par entrer un code dans le circuit. Ce code est
décodé dans une étape 102 pour obtenir l'autorisation d'accès à l'une des zones de la mémoire 103, et à partir de ce moment l'utilisateur est libre d'utiliser le contenu de cette zone, soit pour y implanter l'utilisation qu'il a développée, soit pour faire fonctionner celle-ci. L'accès des autres zones est, dans les cas les plus simples et les plus courants, interdit, mais il est éventuellement possible d'autoriser un accès partiel, par exemple pour utiliser un sous-programme contenu dans une autre application.Thus, as shown in FIG. 1, the user, who can be the manufacturer responsible for developing a particular application, or the individual end user of the smart card containing the integrated circuit, begins in a step 101 by entering a code in the circuit. This code is decoded in a step 102 to obtain authorization to access one of the areas of the memory 103, and from this moment the user is free to use the content of this area, that is to install the use it has developed, either to operate it. Access to other areas is, in the simplest and most common cases, prohibited, but it is possible to authorize partial access, for example to use a subroutine contained in another application.
Un perfectionnement intéressant consiste à organiser la logique du circuit, ou le logiciel du microprocesseur, pour que les adresses de début de zone, et les suivantes jusqu'à la fin si elles sont de longueurs identiques, soient les mêmes, vues de l'utilisateur. Bien entendu les adresses physiques seront différentes, mais cela ne se verra pas du côté utilisateur, qui utilisera en fait l'équivalent invisible pour lui d'un adressage relatif. Outre la simplification du travail du développeur de l'application, on augmente la sécurité en empêchant d'accéder à des adresses interdites par une voie détournée, éventuellement possible suite à un bogue de programmation ou de spécification. Si la reconnaissance d'un code particulier et la sélection de la zone mémoire correspondante se font aisément avec un microprocesseur, ces actions nécessitent dans le cas d'une logique câblée un matériel relativement lourd en comparaison de celui strictement nécessaire à la gestion de la mémoire en l'absence de microprocesseur.An interesting improvement consists in organizing the logic of the circuit, or the software of the microprocessor, so that the addresses from the start of the zone, and the following ones until the end if they are of identical lengths, are the same, seen from the user. . Of course the physical addresses will be different, but this will not be seen on the user side, which will in fact use the invisible equivalent for it of relative addressing. In addition to simplifying the work of the application developer, security is increased by preventing access to prohibited addresses by a roundabout route, possibly possible following a programming or specification bug. If the recognition of a particular code and the selection of the corresponding memory area are easily done with a microprocessor, these actions require in the case of wired logic relatively heavy hardware compared to that strictly necessary for memory management in the absence of a microprocessor.
Pour résoudre ce problème, l'invention propose d'utiliser un code formé de 2 morceaux, comme représenté en figure 2. Ce code comportera donc une première partie
201, formée de x bits, désignant le numéro de zone utilisable, et une deuxième partie 202, formée de y bits et comportant le code secret (ou confidentiel) nécessaire pour accéder à la zone désignée par le code. La longueur totale du code à présenter par l'utilisateur sera donc de x + y bits et cette longueur sera de préférence égale à celle d'un mot de la mémoire, pour faciliter la réalisation des circuits logiques du circuit intégré. Le numéro de zone sera de préférence placé en tête du code, en se référant au sens par lequel l'utilisateur l'introduit dans le circuit en mode série, ce qui est le cas le plus fréquent, notamment dans les cartes à puce en raison du faible nombre de contacts disponibles sur le connecteur d'entrée/sortie. De cette manière, dès que le code entre dans le circuit, les x premiers bit sont lus en premier et indiquent quel est le code secret interne mémorisé dans le circuit qu'il faut comparer au code secret externe formé par les y bits de la deuxième partie du code introduit par l'utilisateur. Le pointeur interne du circuit sélectionne alors le code secret mémorisé puis, si la comparaison est positive, il donne accès à la zone de la mémoire désignée par le numéro formant la première partie du code. Bien entendu si la comparaison est négative l'accès sera refusé, sauf éventuellement à une zone délivrant par exemple un message d'erreur.To solve this problem, the invention proposes to use a code formed of 2 pieces, as shown in FIG. 2. This code will therefore include a first part 201, formed by x bits, designating the usable zone number, and a second part 202, formed by y bits and comprising the secret (or confidential) code necessary to access the zone designated by the code. The total length of the code to be presented by the user will therefore be x + y bits and this length will preferably be equal to that of a word from memory, to facilitate the creation of the logic circuits of the integrated circuit. The zone number will preferably be placed at the head of the code, referring to the direction by which the user enters it into the circuit in serial mode, which is the most frequent case, in particular in smart cards due the low number of contacts available on the input / output connector. In this way, as soon as the code enters the circuit, the first x bits are read first and indicate which is the internal secret code stored in the circuit which must be compared to the external secret code formed by the y bits of the second part of the code entered by the user. The internal pointer of the circuit then selects the memorized secret code then, if the comparison is positive, it gives access to the area of the memory designated by the number forming the first part of the code. Of course, if the comparison is negative, access will be refused, except possibly to a zone delivering for example an error message.
Les codes secrets mémorisés seront par exemple contenus dans une table spéciale, mais de préférence on les placera dans la mémoire en tête des zones auxquelles ils donnent accès, ce qui permet là aussi de simplifier les circuits internes du circuit intégré. En effet dans ce cas le pointeur interne, sous la commande du numéro de zone, adresse directement le premier mot de la
mémoire et l'application peut démarrer sans retard dès que le code secret est reconnu. De plus on économise les circuits nécessaires pour former une telle table et ses interfaces avec le reste du circuit intégré. Quand les codes secrets sont contenus dans une table spéciale, cette table permet en les décodant, de conduire à une partie commune d'adressage qui joue un rôle de sélection pour les zones mémoires auxquelles les codes secrets donnent accès. Si, comme indiqué plus haut, la longueur totale du code (secret + n° de zone) est égale à celle d'un mot de la mémoire, on peut soit neutraliser les bits correspondant au numéro, soit y mettre ce numéro lui-même et faire une comparaison totale du mot et du code, en obtenant ainsi une sécurité supplémentaire par redondance de la vérification du numéro de zone.The memorized secret codes will for example be contained in a special table, but preferably they will be placed in the memory at the head of the zones to which they give access, which again makes it possible to simplify the internal circuits of the integrated circuit. In this case, the internal pointer, under the command of the zone number, directly addresses the first word of the memory and the application can start without delay as soon as the secret code is recognized. In addition, the circuits necessary to form such a table and its interfaces with the rest of the integrated circuit are saved. When the secret codes are contained in a special table, this table makes it possible, by decoding them, to lead to a common addressing part which plays a role of selection for the memory areas to which the secret codes give access. If, as indicated above, the total length of the code (secret + zone number) is equal to that of a word in the memory, you can either neutralize the bits corresponding to the number, or put this number itself and make a total comparison of the word and the code, thus obtaining additional security by redundancy of the verification of the zone number.
Dans le cas d'un circuit à microprocesseur la sélection se fait par logiciel. Après extraction des x premiers bits du code présenté, le logiciel aiguille le pointeur interne vers le premier mot de la zone correspondant au numéro indiqué par ces x bits, il provoque la lecteur de ce mot, puis la comparaison des y derniers bits avec le mot ainsi lu, et enfin le démarrage de l'application si la comparaison est positive.In the case of a microprocessor circuit, the selection is made by software. After extraction of the first x bits of the code presented, the software directs the internal pointer to the first word in the zone corresponding to the number indicated by these x bits, it causes the reader of this word, then the comparison of the last y bits with the word thus read, and finally starting the application if the comparison is positive.
Dans le cas d'un circuit sans microprocesseur, on peut utiliser par exemple des circuits logiques comme représenté sur la figure 3, limitée aux circuits spécifiques de l'invention. le code introduit par l'utilisateur arrive par une connexion "entrée code" dans un registre 301 où il est mémorisé.In the case of a circuit without microprocessor, it is possible for example to use logic circuits as shown in FIG. 3, limited to the specific circuits of the invention. the code entered by the user arrives via a "code entry" connection in a register 301 where it is stored.
Les x premiers bits, correspondant au numéro de zone, sont appliqués à une logique de zones 302 où ils
sont décodés pour obtenir un signal qui indique sur une connexion "sélection" la zone concernée. Cette logique mémorise ce signal jusqu'à la fin de l'application.The first x bits, corresponding to the zone number, are applied to a zone logic 302 where they are decoded to obtain a signal which indicates on a "selection" connection the zone concerned. This logic memorizes this signal until the end of the application.
Le signal de sélection ainsi obtenu est appliqué aux organes d'adressage 303 de la mémoire 304 du circuit intégré. Ces organes de sélection reçoivent également par une connexion "entrée adresses" les adresses des mots à lire dans l'application. La première adresse, 0 par convention, est toujours la même, et combinée avec lβ signal de sélection elle permet de lire dans la mémoire le premier mot de la zone désignée, qui contient le code secret interne mémorisé.The selection signal thus obtained is applied to the addressing members 303 of the memory 304 of the integrated circuit. These selection members also receive by an "address input" connection the addresses of the words to be read in the application. The first address, 0 by convention, is always the same, and combined with the β selection signal it allows the first word in the designated area to be read from the memory, which contains the stored internal secret code.
Ce code interne est appliqué, avec le code secret externe provenant du registre 301, à un comparateur 305 qui délivre, si cette comparaison est positive, un signal de validation de lecture qui vient ouvrir une porte 306 qui permet aux mots lus dans la mémoire de sortir vers les autres organes du circuit intégré. Ce signal de validation permet également, le cas échéant, de débloquer tout ou partie de ces autres organes, par exemple pour autoriser l'écriture dans la mémoire.This internal code is applied, with the external secret code coming from the register 301, to a comparator 305 which delivers, if this comparison is positive, a read validation signal which opens a door 306 which allows the words read in the memory to exit to the other organs of the integrated circuit. This validation signal also makes it possible, if necessary, to unlock all or part of these other organs, for example to authorize writing to the memory.
En outre, pendant toute la durée de l'application, le signal "sélection" permet, en combinaison avec le signal d'adresses, de lire le contenu de la zone comme si elle était en tête de la mémoire. Il en est de même bien entendu pour les autres applications.In addition, throughout the duration of the application, the "selection" signal makes it possible, in combination with the address signal, to read the content of the zone as if it were at the head of the memory. It is the same of course for other applications.
Par ailleurs, il n'est pas absolument nécessaire que chaque code confidentiel soit placé au début de sa zone mémoire. En effet, la structure de l'invention est aussi particulièrement intéressante si, après la présentation du code, toutes les zones sont de la même taille. Dans le cas contraire on utilise une organisation dans laquelle les codes secrets sont mémorisés dans une petite zone.
On va décrire maintenant, à l'aide de la figure 4, le circuit logique simple qui permet de se passer de l'existence, dans le circuit intégré, d'un microprocesseur, tout en autorisant, selon l'invention, la mise en oeuvre de plusieurs applications avec la carte à puce. Dans de tels circuits sans microprocesseur l'adressage des mots mémoires est séquentiel. Dans le principe de cet adressage une horloge provoque, au moyen d'un compteur interne à la mémoire, un comptage d'adresse. Puis un signal de validation, émis depuis l'extérieur du circuit, valide l'état du compteur pour désigner l'adresse du mot à atteindre. Dans l'invention on utilise un tel système pour, en plus, mettre en oeuvre la sécurité liée aux différentes applications. Dans l'exemple qu'on va décrire on va admettre pour simplifier que le numéro de la zone où est stocké le code secret est codé sur quatre bits de sorte qu'une partition de la mémoire en seize parties (24) est imposée. Tout autre nombre différent de quatre est cependant possible. Lors de l'application des quatre premières impulsions CLK d'une horloge, les quatre premiers bits du code secret (qui représentent son adresse) sont envoyés par une broche d'entrée IN du circuit intégré sur quatre registres à décalage 401 à 404 reliés en cascade. Avant l'envoi d'un cinquième bit d'horloge, un signal APL délivré par la logique de zone 302, préalablement à zéro, passe à un état un. Il invalide alors la transmission des impulsions d'horloges aux registres 401-404. Ceux-ci restent dans l'état dans lequel ils étaient. Ils délivrent donc pendant toute l'utilisation suivante, en sortie, chacun un signal, respectivement A3 à A0, constituant un bit de poids donné d'une adresse. Cette adresse est décodée dans un prédécodeur de zone 405 possédant seize sorties. Chacune
δ de ces seize sorties aboutit à une entrée d'un décodeur 406 de ligne de mot de la mémoire 407. Cet aboutissement est par ailleurs autorisé par un ensemble de porte ET telle que 408 recevant le signal du prédécodeur 406 et le signal APL.Furthermore, it is not absolutely necessary for each confidential code to be placed at the beginning of its memory area. Indeed, the structure of the invention is also particularly interesting if, after the presentation of the code, all the zones are the same size. Otherwise, an organization is used in which the secret codes are stored in a small area. We will now describe, using FIG. 4, the simple logic circuit which makes it possible to dispense with the existence, in the integrated circuit, of a microprocessor, while authorizing, according to the invention, the setting in work of several applications with the smart card. In such circuits without microprocessor the addressing of the memory words is sequential. In the principle of this addressing a clock causes, by means of a counter internal to the memory, an address counting. Then a validation signal, emitted from outside the circuit, validates the state of the counter to designate the address of the word to be reached. In the invention, such a system is used to, in addition, implement the security linked to the different applications. In the example which we will describe, we will admit for simplicity that the number of the zone where the secret code is stored is coded on four bits so that a partition of the memory into sixteen parts (2 4 ) is imposed. Any other number other than four is however possible. When applying the first four CLK pulses of a clock, the first four bits of the secret code (which represent its address) are sent by an input pin IN of the integrated circuit on four shift registers 401 to 404 connected in cascade. Before sending a fifth clock bit, an APL signal delivered by the zone logic 302, prior to zero, changes to a state one. It then invalidates the transmission of the clock pulses to the registers 401-404. These remain in the state in which they were. They therefore deliver during all of the following use, at the output, each a signal, respectively A3 to A0, constituting a given bit of weight of an address. This address is decoded in a zone predecoder 405 having sixteen outputs. Each δ of these sixteen outputs leads to an input of a word line decoder 406 from memory 407. This outcome is also authorized by an AND gate assembly such as 408 receiving the signal from the predecoder 406 and the signal APL.
Avant le cinquième bit de l'horloge, le décodeur 406 est donc alimenté par les seize signaux du predecodeur 405. Les autres entrées du décodeur 406 restent encore à zéro. Le décodeur 406 est donc configuré pour permettre l'accès au premier mot de la partition adressée (une parmi seize) . Ce mot qui justement contient le code secret est alors lu pour être comparé comme cela a été indiqué ci-dessus.Before the fifth bit of the clock, the decoder 406 is therefore supplied with the sixteen signals from the predecoder 405. The other inputs of the decoder 406 still remain at zero. The decoder 406 is therefore configured to allow access to the first word of the addressed partition (one among sixteen). This word, which precisely contains the secret code, is then read to be compared as indicated above.
Selon une particularité essentielle de l'invention, le code secret, CODE N° 1, CODE N° 2, etc.... occupe donc la place du premier mot physiquement rangé dans la partition adressée de la mémoire. Selon une autre particularité essentielle, la partition utilisable de la mémoire 407, par exemple la partition 409, attachée au premier mot de la zone 410 qui contient le code secret CODE N° 1, est physiquement proche de ce mot 410. Cette proximité physique s'explique par le fait que les mots mémoires de la partition 409 de la mémoire 407 ont des moments d'adresse A0 et A3 qui sont les mêmes que ceux du code secret qui gouverne cette zone 409.According to an essential feature of the invention, the secret code, CODE No. 1, CODE No. 2, etc., therefore occupies the place of the first word physically stored in the addressed partition of the memory. According to another essential feature, the usable partition of the memory 407, for example the partition 409, attached to the first word of the area 410 which contains the secret code CODE N ° 1, is physically close to this word 410. This physical proximity s 'explains by the fact that the memory words of the partition 409 of the memory 407 have moments of address A0 and A3 which are the same as those of the secret code which governs this zone 409.
L'adressage des différents mots mémoires dans la partition 409 est alors effectué de la façon suivante. Une partie de l'adresse est fournie au décodeur 406 par le predecodeur 405 (figé dans cet état pendant toute l'application) . Une autre partie est fournie classiquement par un compteur 411 recevant des signaux CLKV d'horloge validés (pour aboutir au bon mot mémorisé) et relié à un prédécodeur 412. Cette dernière liaison est du même type que celle qui relie les
registres 401-404 au prédécodeur 405. Le prédécodeur 412 transforme le compte du compteur 411 en des signaux d'adresse. Par exemple le compteur peut compter de 0 à 2n et le prédécodeur 412 a donc n connexions et sortie. Ces n connexions aboutissent sur n entrées du décodeur 406. De ces n entrées, n-1 sont utiles pour accéder à tous les mots mémoire de la partition 409. Une fois que cet accès a été effectué on fait compter le compteur 411 jusqu'à n. On aboutit alors à un mot mémoire fictif en sortie du décodeur 406. Le mot mémoire fictif est constitué par une connexion 413 connectée à une entrée de remise à zéro du compteur 411. On peut alors recommencer un autre compte pour accéder de nouveau à une adresse de la partition 409. On ne peut pas accéder à d'autres mots que ceux de cette partition.The addressing of the different memory words in the partition 409 is then carried out as follows. Part of the address is supplied to the decoder 406 by the predecoder 405 (frozen in this state throughout the application). Another part is conventionally supplied by a counter 411 receiving CLKV clock signals validated (to arrive at the correct memorized word) and connected to a predecoder 412. This latter link is of the same type as that which connects the registers 401-404 to the predecoder 405. The predecoder 412 transforms the count of the counter 411 into address signals. For example, the counter can count from 0 to 2 n and the predecoder 412 therefore has n connections and output. These n connections lead to n inputs of the decoder 406. Of these n inputs, n-1 are useful for accessing all the memory words of the partition 409. Once this access has been made, the counter 411 is counted up to not. We then arrive at a fictitious memory word at the output of the decoder 406. The fictitious memory word consists of a connection 413 connected to a reset input of the counter 411. We can then start another account to access an address again of partition 409. You cannot access other words than those of this partition.
En agissant ainsi on obtient un premier résultat par lequel les adressages dans les zones sont identiques vu du coté utilisateur puisque les utilisateurs n'ont que les n moments d'adresse à leur disposition. Autrement dit l'adressage est limité de 1 à 2n_1-, et cet adressage est le même pour toutes les zones. Deuxièmement on obtient une partition sure de la mémoire. Il n'est pas possible en effet avec une application à qui est dévolue une zone d'aller utiliser les informations situées dans une autre zone puisque les quatre premiers bits d'adresse restent figés.
By doing so, a first result is obtained by which the addresses in the zones are identical seen from the user side since the users have only the n moments of address at their disposal. In other words, the addressing is limited from 1 to 2 n_1 -, and this addressing is the same for all the zones. Second, we get a secure memory partition. It is not indeed possible with an application to which a zone is allocated to go to use the information located in another zone since the first four address bits remain frozen.