WO2003032150A1 - Improved random variable generator - Google Patents

Improved random variable generator Download PDF

Info

Publication number
WO2003032150A1
WO2003032150A1 PCT/FR2002/003356 FR0203356W WO03032150A1 WO 2003032150 A1 WO2003032150 A1 WO 2003032150A1 FR 0203356 W FR0203356 W FR 0203356W WO 03032150 A1 WO03032150 A1 WO 03032150A1
Authority
WO
WIPO (PCT)
Prior art keywords
processor
instruction
computer according
cache memory
instructions
Prior art date
Application number
PCT/FR2002/003356
Other languages
French (fr)
Inventor
Nicolas Sendrier
André SEZNEC
Original Assignee
Inria Institut National De Recherche En Informatique Et En Automatique
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 Inria Institut National De Recherche En Informatique Et En Automatique filed Critical Inria Institut National De Recherche En Informatique Et En Automatique
Publication of WO2003032150A1 publication Critical patent/WO2003032150A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators
    • G06F7/588Random number generators, i.e. based on natural stochastic processes

Definitions

  • the invention relates to the generation of hazards by computer means, in particular for cryptography.
  • Devices for generating hazards are in the form of computers equipped with a processor, memories and peripherals such as a screen, input devices (keyboard, mouse), a sound card, a graphics card, or else a remote network access card.
  • peripherals such as a screen, input devices (keyboard, mouse), a sound card, a graphics card, or else a remote network access card.
  • the exchanges of the processor with these peripherals, generally via a motherboard and a random access memory, are carried out by means of interrupts.
  • hazard generators include a module comprising instructions for detecting interruptions and for measuring the time between these interruptions.
  • the hazard generator derives a random expression from this time measurement since, in conventional computers, it is rare for a processor to cooperate with the same peripherals, regularly following the same sequence.
  • the present invention improves the situation.
  • a computer comprising: a processor capable of interacting with peripherals by means of interrupts, comprising at least an internal cache memory and a given hardware counter, and
  • hazard generator operating by time measurement on sequences of instructions, linked to interruptions.
  • the hazard generator performs the time measurement, from at least the given hardware counter, on sequences of instructions whose execution time depends at least in part on states internal of the processor, not directly accessible to the user and which are modified by interrupts, the internal states being related inter alia to the presence or absence of data in at least the internal cache memory, this data being sought in at least the internal cache memory when executing at least one sequence of instructions.
  • the internal states of the processor preferentially relate to volatile non-architectural states, such as states:
  • the cycle counter increments its current value at each cycle.
  • the other elements above include memories whose contents can only be read indirectly.
  • non-architectural state is opposed to the term “architectural state” which relates to the content of computer memories (random access memory, read only memory), the content of registers and the program counter (or ordinal counter), which remain accessible and can be manipulated by a set of instructions from an appropriate program.
  • the hazard generator performs the time measurement from the cycle counter that includes the processor.
  • event counters such as fault counters on the covers or fault prediction counters for connection.
  • the hazard generator in the computer of the invention, comprises a module executing instructions to modify at least part of the internal states of the processor by accessing it.
  • the module is an important means for implementing the present invention.
  • the module can be in the form of a computer program product capable of controlling the processor to perform a time measurement whose execution time depends at least in part on internal states of the processor, not directly accessible to the user. and which are modified by interruptions.
  • the module includes an instruction to declare a table of selected memory size at least equal to the capacity of an internal cache memory of the processor, as well as a pointer in the table.
  • the processor comprises a first level cache memory and a second level volatile cache memory, and the memory size of the table is chosen to be greater than the memory capacity of the first cache. level, so as to address the first level cache or the second level cache.
  • the processor comprises a branch prediction table, of volatile content, the abovementioned internal states of the processor further concerning addresses of the prediction table.
  • the module comprises an instruction for testing the value of the pointer, so as to modify the content of the branch prediction table.
  • the test relates to a most significant bit to exercise the branch prediction table.
  • the module comprises at least one instruction for reading a value of the cycle counter, and the random generator is arranged to provide a random expression from a combination of the value read from the pointer and the value of the cycle counter, which makes it possible to add up the generated hazard.
  • the hazard generator is arranged to be put into service permanently, with a low level priority.
  • the module includes an instruction loop comprising an update of the table with the assignment of a value as a function of the random expression, with a view to propagating a hazard in the table.
  • the module is arranged to reiterate the instruction loop a number of times chosen to saturate the instruction cache of the processor.
  • the module advantageously includes an instruction to declare a second table of memory size chosen at least equal to the capacity of the buffer memory, as well as a pointer in the second table.
  • the module comprises an instruction for playing the address translation buffer memory by implementing a sufficient number of pages in the first declared table.
  • FIG. 1 schematically represents a conventional computer, equipped with peripherals
  • FIG. 2 schematically represents the interactions between the processor and the equipment of a central unit UC of the computer of FIG. 1,
  • FIG. 3 represents the operations executed during an interrupt routine which requests the processor ⁇ P
  • FIG. 4 represents the interactions between different registers and memories of the processor, as well as the cycle counter, and
  • FIG. 5 shows a flow diagram of a process for generating a random expression, in a device of one invention.
  • the computer comprises a central processing unit UC, equipped with an LEC reader for, where appropriate, 1-ire — data — on a medium of the CD-ROM, floppy or other type, in particular instruction instruction data. programs.
  • the computer further includes an ECR display screen, as well as several input devices such as a SOU mouse and a CLA keyboard.
  • the computer is equipped with a link to a remote network (COM arrow).
  • the LEC reader, the SOU and CLA input devices, the COM link are peripherals capable of communicating with the processor of the central unit by means of interruptions. They send interrupt requests to the ⁇ P processor and the ⁇ P processor performs tasks in response to these requests.
  • the central processing unit UC comprises, in the example described, a processor ⁇ P capable of cooperating with a working memory MT (a RAM memory, for example), with a motherboard CM and a disk hard DD.
  • the CM motherboard communicates with most peripherals, such as the COM link (L3 output) via a CMO modem card, a card its CS (output L2) and, if necessary, the ECR screen via a graphics card CG (output L1).
  • the gripping devices CLA and SOU are connected by the links L4 and L5.
  • the ⁇ P processor can communicate with peripherals such as input devices, the COM link, the DD hard disk and the CS sound card, by interruptions.
  • a PGM program is executed (arrow EXE). During this execution, a PERI device (or even a system clock) requires a temporary interruption INT of the execution of the current PGM program.
  • the RINT interrupt routine then proceeds as follows:
  • the routine begins first with a SAV1 backup of the registers in progress, in a cache memory CH of the processor and, if necessary in a random access memory RAM of the computer, in the event of exceeding the capacities of the cache memory CH;
  • routine continues with the effective development TRA of the task required by the peripheral, during which only the architectural states (for example the ordinal program counter) are saved;
  • the interruption routine continues with a restoration of the registers RES with respect to the initial state SAV1, then - with a backup SAV2 of the registers and architectural states which have been used during the interruption.
  • the computer includes an interrupt controller which is accessed to measure a time difference between two interrupts. From the time difference between different interruptions, we construct a random expression.
  • these interruptions are required by peripherals generally according to the request of a user.
  • This technique has the disadvantage of being slow since the generation of the random expression depends mainly on the activity of the user.
  • the hazard generated thus depends on external physical conditions, it is rather a "pseudo-hazard", within the meaning of the reference:
  • the present invention proposes to do otherwise.
  • the processor ⁇ P capable of cooperating with a working memory MT, comprises in -1- example described-: -— -
  • a CD data cache memory a second level CN2 cache memory
  • TLB address translation cache memory ("Translation Lookaside Buffer")
  • CC cycle counter - a CC cycle counter
  • the computer is a workstation marketed by the company SUN (Registered trademark) and the processor is of the ULTRASPARC II (Registered trademark) type at 300 MHz clock frequency.
  • the processor is implemented by the SOLARIS operating system (registered trademark).
  • CI, CD, CN2, as well as the PB and TLB tables correspond to memories which include volatile data relating to internal states of the processor.
  • the cycle counter which increments its value on each cycle, corresponds to a volatile internal state of the processor.
  • UF functional units cooperate, on the one hand, with the data cache memory CD, to recover and transmit the data and, on the other hand with a REG register file, regularly updated.
  • the branch predictor PB controls the instruction cache memory CI.
  • a hardware mechanism called a DR decoder translates and renames this instruction data.
  • This translated data is then processed by hardware queues Q, which apply them to the functional units UF of the processor.
  • the second level cache memory CN2 can store simple data, in which case it cooperates with the data cache memory CD, or also instruction data, in which case it cooperates with the instruction cache memory CI.
  • the TLB address translation cache can store the physical addresses of the pages of a process.
  • the processor is of the ULTRASPARC II type: - the first level data cache memory CD comprises 16 kb with direct access (512 cache sectors at 32 bytes);
  • the instruction cache memory is 16 KB, with 32-byte cache blocks;
  • the second level CN2 caches are 1 MB with blocks of 64 bytes;
  • the TLB table includes 64 entries and the requester has found that for one hundred consecutive invocations by the operating system, the minimum cumulative number of block displacements systematically exceeds 4500 for the data and 600 for the instructions;
  • the PB branching predictor has a memory size of 2K 2-bit inputs.
  • FIG. 5 describes, in a preferred embodiment, a processing allowing _generation of random expressions using a computer _ equipped with a processor of the type represented in FIG. 4.
  • Processing begins with the initialization and declaration of a WALK table, in step 10.
  • a WALK table Preferably, the table
  • WALK is of dimensions corresponding to a memory size twice as large as the first level cache memory.
  • an ARRAY table is initialized and declared. It is chosen to have dimensions using a memory size twice as large as the memory that can be translated by the TLB translation cache, in order to exercise all of the TLB entries.
  • the processing continues at 14 by reading a datum from the WALK table, through a pointer value PT.
  • a pointer value PT Preferably, in step 14, the old pointer read previously was also kept in the loop for updating in step 24, as will be seen below.
  • the probability of the presence of the data in the first level cache is 1/2: the time of the reading will be different depending on the presence or not of the data in the cache.
  • step 16 a most significant bit of the value of the pointer PT is tested, with the aim of exceeding the size of the WALK table and rather exercising the branch prediction table PB.
  • the result of test 16 has no influence on the continuation of the treatment and, moreover, is not taken into account for the rest.
  • the test execution time differs depending on whether the test was well predicted or poorly predicted.
  • a l L step 20 it reads the value T of the .mu.P CPU cycle counter.
  • a new value of the pointer PT is assigned, as a function of its old value and of the current value T of the cycle counter, read in step 20.
  • This function of the old value of the pointer PT and of the value T is a combination which, in a preferred embodiment, corresponds to the "or exclusive" function (XOR).
  • XOR exclusive exclusive
  • This modification of the value of the pointer by an "or exclusive" with the cycle counter makes it possible to amplify the hazard.
  • the WALK table is updated by assigning to it the value of the pointer PT newly defined in step 22.
  • the hazard is thus propagated in the WALK table, when the processing has carried out several loops, as we will see later.
  • a random datum RES [i] is output, as a function of the value of the pointer PT established in step 22.
  • step 30 The processing continues with an incrementation (step 30) of the loop index i, which is incremented in step 30, as long as this value does not exceed the number N (step 28).
  • the number N is chosen as a function of the memory size of the instruction cache CI, so as to saturate it when the loop index i reaches the value N.
  • a loop for deducing the random expression also as a function of a pointer value in the ARRAY spreadsheet defined in step 12, is not represented in FIG. 5.
  • the random expression RES [i] can be drawn, both from a reading of a pointer on the WALK table and from a reading of another pointer on the ARRAY table.
  • the "HardTick ()" function provides the number of cycles that have elapsed since the last call (this is therefore a difference between the number of current cycles and the number of cycles read during the previous consultation).
  • the program begins with the declarations:
  • the Walk table is initialized by the short Walk instruction [512 * 1024], so as to give it a memory size of 1 MB, which corresponds to the capacity of the second level cache CN2 and which, in any event, exceeds the capacity of the first level cache.
  • test bit 14 of the pointer pt (4000 in hexadecimal corresponding to 2 14 ).
  • the test on the most significant bit 14 makes it possible to exceed the memory size allocated to the Walk table and thus to exercise the branch predictor PB. If necessary, a current value X is incremented, as a function of the test.
  • line 5 tests the most significant bit 15 of the pointer pt (8000 in hexadecimal corresponding to 2 15 ) to further exercise the branch predictor. The results of these tests, as well as the variable current X, have no importance here.
  • test instructions are followed by a combination operation "or exclusive" (sign " ⁇ " on lines 4 and 7), involving the pointer pt, in order to add the hazard and prevent an observer from d 'access the random expression RESULT [i] (corresponding to the random expression RES [i] in Figure 5) and the value of the pointer pt, as we will see below.
  • the least significant bits (less than 14) of the pointer pt (3fff in hexadecimal corresponding to 2 14 -1) are saved in the pointer PT.
  • the pointer pt reads its new values from the table.
  • the third instruction concerns the pointer PT2 which randomly takes its values at the addresses corresponding to the bits of weight less than 14.
  • the pointer pt takes the value of the "or exclusive" combination of itself with the variable T, with the aim of adding the hazard, as described above.
  • the result of this combination is applied to the Walk table (line 8).
  • this program is intended to be put into service permanently in the computer of the invention, with a relatively low execution priority compared to the other tasks of the processor ⁇ P.
  • the program in the appendix takes over to prepare random expressions ⁇ . It is interrupted when the processor is requested by another application, in particular by interrupts, in which case the content of the addresses of the first level, second level caches, instructions, the TLB buffer, etc., is modified after the interruption, which further increases the hazard generated when the hazard generator program resumes execution thereafter.
  • cycle counter is described only by way of example.
  • event counter such as the clock counter or the like.
  • the declarations and initializations of the tables at the start of processing depend on the capacities of memories such as the first level, second level data cache, the TLB buffer.
  • the declaration of these tables is liable to change as a function of the memories used in the processor of the computer according to the invention.
  • the processing involves all — the internal states—— for the cache memories and the predictors of connections of the current processors.
  • provision may be made to use only part of these internal states to generate random expressions, at least one type of internal state.
  • Other internal states not accessible to the user can also be used (states of different buffers, etc.).
  • the present invention also relates to the software code which it involves, particularly when it is made available on any medium readable on a computer.
  • computer-readable medium covers a storage medium, for example magnetic or optical, as well as a means of transmission, such as a digital or analog signal.

Abstract

The invention concerns generating random variables by computer means, in particular for cryptography. It concerns in particular a computer comprising a processor ( mu P), capable of interacting with peripherals by interruptions and a random number generator, operating by time measurement on events, related to interruptions. The invention is characterized in that the random variable generator measures time on sequences of instructions whereof the duration of execution depends at least partly on internal states (CD, CN2, CI, TLB) of the processor, not directly accessible to the user and which are modified by interruptions.

Description

Générateur d'aléa perfectionnéImproved hazard generator
L'invention concerne la génération d'aléas par des moyens informatiques, notamment pour la cryptographie.The invention relates to the generation of hazards by computer means, in particular for cryptography.
Des dispositifs pour générer des aléas se présentent sous forme d'ordinateurs équipés d'un processeur, de mémoires et de périphériques tels qu'un écran, des organes de saisie (clavier, souris), une carte son, une carte graphique, ou encore une carte d'accès à un réseau distant. Les échanges du processeur avec ces périphériques, généralement via une carte mère et une mémoire vive, s'effectuent par voie d'interrup- tions .Devices for generating hazards are in the form of computers equipped with a processor, memories and peripherals such as a screen, input devices (keyboard, mouse), a sound card, a graphics card, or else a remote network access card. The exchanges of the processor with these peripherals, generally via a motherboard and a random access memory, are carried out by means of interrupts.
Dans des dispositifs connus, des générateurs d'aléas comprennent un module comportant des instructions pour détecter les interruptions et effectuer une mesure de temps entre ces interruptions. Le générateur d'aléa tire de cette mesure de temps une expression aléatoire puisque, dans les ordinateurs conventionnels, il est rare qu'un processeur coopère avec les mêmes périphériques, régulièrement suivant une même séquence.In known devices, hazard generators include a module comprising instructions for detecting interruptions and for measuring the time between these interruptions. The hazard generator derives a random expression from this time measurement since, in conventional computers, it is rare for a processor to cooperate with the same peripherals, regularly following the same sequence.
Même si de tels générateurs d'aléas sont suffisamment fiables pour certaines applications cryptographiques, ils présentent l'inconvénient d'être lents puisque la cadence de génération de l'aléa dépend des opérations effectuées par un utilisateur. De plus, ils ne sont pas complètement inviolables puisque l'aléa provient de phénomènes physiques externes. L'aléa reste déterminable, même s'il faut des moyens très lourds pour le déterminer.Even if such random generators are sufficiently reliable for certain cryptographic applications, they have the disadvantage of being slow since the rate of generation of the hazard depends on the operations carried out by a user. In addition, they are not completely inviolable since the hazard comes from external physical phenomena. The hazard remains determinable, even if it requires very heavy means to determine it.
La présente invention vient améliorer la situation.The present invention improves the situation.
Elle propose à cet effet un ordinateur comprenant : - un processeur, susceptible d' interagir avec des périphériques par voie d'interruptions, comprenant au moins une mémoire cache interne et un compteur matériel donné etTo this end, it offers a computer comprising: a processor capable of interacting with peripherals by means of interrupts, comprising at least an internal cache memory and a given hardware counter, and
- un générateur d'aléa, opérant par mesure de temps sur des séquences d'instructions, liées à des interruptions.- a hazard generator, operating by time measurement on sequences of instructions, linked to interruptions.
Selon une caractéristique de l'invention, le générateur d'aléa effectue la mesure de temps, à partir d'au moins le compteur matériel donné, sur des séquences d'instructions dont la durée d'exécution dépend au moins en partie d'états internes du processeur, non directement accessibles à l'utilisateur et qui sont modifiés par des interruptions, les états internes étant relatifs entre autres à la présence ou l'absence de données dans au moins la mémoire cache interne, ces données étant recherchées dans au moins la mémoire cache interne lors de l'exécution d'au moins une séquence d' instructions .According to a characteristic of the invention, the hazard generator performs the time measurement, from at least the given hardware counter, on sequences of instructions whose execution time depends at least in part on states internal of the processor, not directly accessible to the user and which are modified by interrupts, the internal states being related inter alia to the presence or absence of data in at least the internal cache memory, this data being sought in at least the internal cache memory when executing at least one sequence of instructions.
Les états internes du processeur concernent préférentielle- ment des états volatiles non-architecturaux, tels que les états :The internal states of the processor preferentially relate to volatile non-architectural states, such as states:
- du cache de données de premier niveau,- the first level data cache,
- du cache de second niveau,- the second level cache,
- du cache d'instructions, - de la mémoire tampon d'écriture,- the instruction cache, - the write buffer,
- de la table de prédiction de branchement,- the branch prediction table,
- du compteur de cycle.- the cycle counter.
Typiquement, le compteur de cycles incrémente sa valeur courante à chaque cycle. Les autres éléments ci-avant comprennent des mémoires dont les contenus ne peuvent être lus que de manière indirecte.Typically, the cycle counter increments its current value at each cycle. The other elements above include memories whose contents can only be read indirectly.
Le terme "état non-architectural" s'oppose au terme "état architectural" qui concerne le contenu des mémoires de l'ordinateur (mémoire vive, mémoire morte), le contenu des registres et le compteur de programme (ou compteur ordinal), qui restent accessibles et peuvent être manipulés par un jeu d'instructions d'un programme approprié.The term "non-architectural state" is opposed to the term "architectural state" which relates to the content of computer memories (random access memory, read only memory), the content of registers and the program counter (or ordinal counter), which remain accessible and can be manipulated by a set of instructions from an appropriate program.
Dans une réalisation préférée, le générateur d'aléa effectue la mesure de temps à partir du compteur de cycle que comprend le processeur.In a preferred embodiment, the hazard generator performs the time measurement from the cycle counter that includes the processor.
En variante, d'autres compteurs peuvent être utilisés, notamment des compteurs d'événements tels que des compteurs de défauts sur les caches ou des compteurs de défauts de prédictions de branchement.As a variant, other counters can be used, in particular event counters such as fault counters on the covers or fault prediction counters for connection.
Avantageusement, le générateur d'aléa, dans l'ordinateur de l'invention, comporte un module exécutant des instructions pour modifier une partie au moins des états internes du processeur en y accédant.Advantageously, the hazard generator, in the computer of the invention, comprises a module executing instructions to modify at least part of the internal states of the processor by accessing it.
A ce titre, ce module est un moyen important pour mettre en oeuvre la présente invention. Le module peut se présenter sous la forme d'un produit programme d'ordinateur capable de commander le processeur pour effectuer une mesure de temps dont la durée d'exécution dépend au moins en partie d'états internes du processeur, non directement accessibles à l'utilisateur et qui sont modifiés par des interruptions.As such, this module is an important means for implementing the present invention. The module can be in the form of a computer program product capable of controlling the processor to perform a time measurement whose execution time depends at least in part on internal states of the processor, not directly accessible to the user. and which are modified by interruptions.
Préférentiellement, le module comprend une instruction pour déclarer une table de taille mémoire choisie au moins égale à la capacité d'une mémoire cache interne du processeur, ainsi qu'un pointeur dans la table.Preferably, the module includes an instruction to declare a table of selected memory size at least equal to the capacity of an internal cache memory of the processor, as well as a pointer in the table.
Dans une réalisation, le processeur comprend une mémoire cache de premier niveau et une mémoire cache de second niveau, volatiles, et la taille mémoire de la table est choisie supérieure à la capacité mémoire du cache de premier niveau, de manière à adresser le cache de premier niveau ou le cache de second niveau.In one embodiment, the processor comprises a first level cache memory and a second level volatile cache memory, and the memory size of the table is chosen to be greater than the memory capacity of the first cache. level, so as to address the first level cache or the second level cache.
En complément ou en variante, le processeur comprend une table de prédiction de branchement, de contenu volatile, les états internes précités du processeur concernant en outre des adresses de la table de prédiction. Avantageusement, le module comprend une instruction de test de la valeur du pointeur, de manière à modifier le contenu de la table de prédiction de branchement.In addition or as a variant, the processor comprises a branch prediction table, of volatile content, the abovementioned internal states of the processor further concerning addresses of the prediction table. Advantageously, the module comprises an instruction for testing the value of the pointer, so as to modify the content of the branch prediction table.
Préférentiellement, le test porte sur un bit de poids fort pour exercer la table de prédiction de branchement.Preferably, the test relates to a most significant bit to exercise the branch prediction table.
Avantageusement, le module comprend au moins une instruction de lecture d'une valeur du compteur de cycle, et le générateur d'aléa est agencé pour fournir une expression aléatoire à partir d'une combinaison de la valeur lue du pointeur et de la valeur du compteur de cycle, ce qui permet d'additionner l'aléa généré.Advantageously, the module comprises at least one instruction for reading a value of the cycle counter, and the random generator is arranged to provide a random expression from a combination of the value read from the pointer and the value of the cycle counter, which makes it possible to add up the generated hazard.
Dans une réalisation avantageuse, le générateur d'aléa est agencé pour être mis en service en permanence, avec une priorité de bas niveau.In an advantageous embodiment, the hazard generator is arranged to be put into service permanently, with a low level priority.
Avantageusement, le module comporte une boucle d'instructions comprenant une mise à jour de la table avec l'attribution d'une valeur fonction de l'expression aléatoire, en vue de propager un aléa dans la table. Préférentiellement, le module est agencé pour réitérer la boucle d'instructions un nombre de fois choisi pour saturer le cache d'instructions du processeur.Advantageously, the module includes an instruction loop comprising an update of the table with the assignment of a value as a function of the random expression, with a view to propagating a hazard in the table. Preferably, the module is arranged to reiterate the instruction loop a number of times chosen to saturate the instruction cache of the processor.
Pour adresser la mémoire tampon d'indication d'adresses, volatile, que comprend le processeur dans une réalisation, le module comprend avantageusement une instruction pour déclarer une seconde table de taille mémoire choisie au moins égale à la capacité de la mémoire tampon, ainsi qu'un pointeur dans la seconde table.To address the volatile address indication buffer that the processor includes in one embodiment, the module advantageously includes an instruction to declare a second table of memory size chosen at least equal to the capacity of the buffer memory, as well as a pointer in the second table.
En variante, le module comprend une instruction pour faire jouer la mémoire tampon de traduction d'adresses en mettant en oeuvre un nombre suffisant de pages dans la première table déclarée.As a variant, the module comprises an instruction for playing the address translation buffer memory by implementing a sufficient number of pages in the first declared table.
D ' autres caractéristiques et avantages de 1 ' invention apparaîtront à l'examen de la description détaillée ci-après, et des dessins annexés sur lesquels :Other characteristics and advantages of the invention will appear on examining the detailed description below, and the appended drawings in which:
la figure 1 représente schématiquement un ordinateur conventionnel, équipé de périphériques,FIG. 1 schematically represents a conventional computer, equipped with peripherals,
- la figure 2 représente schématiquement les interactions entre le processeur et les équipements d'une unité centrale UC de l'ordinateur de la figure 1,FIG. 2 schematically represents the interactions between the processor and the equipment of a central unit UC of the computer of FIG. 1,
- la figure 3 représente les opérations exécutées pendant une routine d'interruption qui sollicite le processeur μP,FIG. 3 represents the operations executed during an interrupt routine which requests the processor μP,
- la figure 4 représente les interactions entre différents registres et mémoires du processeur, ainsi que le compteur de cycle, etFIG. 4 represents the interactions between different registers and memories of the processor, as well as the cycle counter, and
- la figure 5 représente un organigramme d'un traitement pour générer une expression aléatoire, dans un dispositif de 1 ' invention.- Figure 5 shows a flow diagram of a process for generating a random expression, in a device of one invention.
En annexe sont retranscrites des instructions de programmes (en langage C) que l'ordinateur de l'invention met en oeuvre, dans une réalisation préférée. Le présent document peut contenir des éléments susceptibles d'une protection par droit d'auteur ou copyright. Le titulaire des droits n'a pas d'objection à la reproduction à l'identique par quiconque de ce document de brevet, tel qu'il apparaît dans les dossiers et/ou publications des offices de brevet. Par contre, il réserve pour le reste l'intégralité de ses droits d'auteur et/ou de copyright.In the appendix are transcribed program instructions (in C language) that the computer of the invention implements, in a preferred embodiment. This document may contain elements that may be protected by copyright. The rights holder has no objection to the identical reproduction by anyone of this patent document, as it appears in the files and / or publications of patent offices. On the other hand, it reserves for the rest all of its author's rights and / or copyright.
La description ci-après, les dessins et l'annexe contiennent, pour l'essentiel, des éléments de caractère certain. Ils pourront donc non seulement servir à mieux faire comprendreThe description below, the drawings and the annex essentially contain elements of a certain nature. They can therefore not only serve to better understand
—la-description, mais - aussi—contribuer à la définition de l'invention, le cas échéant.—Description, but - also — contribute to the definition of the invention, if necessary.
On se réfère tout d'abord à la figure 1 pour décrire un ordinateur équipé de périphériques. L'ordinateur comprend une unité centrale UC, munie d'un lecteur LEC pour, le cas échéant, 1-ire—des—données sur -un— support du type CD-ROM, disquette ou autre, notamment des données d'instructions de programmes. L'ordinateur comprend en outre un écran d'affichage ECR, ainsi que plusieurs organes de saisie tels qu'une souris SOU et un clavier CLA. Dans l'exemple représenté, l'ordinateur est équipé d'une liaison à un réseau distant (flèche COM). Le lecteur LEC, les organes de saisie SOU et CLA, la liaison COM sont des périphériques capables de dialoguer avec le processeur de l'unité centrale par voie d'interruptions. Ils émettent par des liaisons au processeur μP des requêtes d'interruption et le processeur μP, effectue les tâches en réponse à ces requêtes.We first refer to Figure 1 to describe a computer equipped with peripherals. The computer comprises a central processing unit UC, equipped with an LEC reader for, where appropriate, 1-ire — data — on a medium of the CD-ROM, floppy or other type, in particular instruction instruction data. programs. The computer further includes an ECR display screen, as well as several input devices such as a SOU mouse and a CLA keyboard. In the example shown, the computer is equipped with a link to a remote network (COM arrow). The LEC reader, the SOU and CLA input devices, the COM link are peripherals capable of communicating with the processor of the central unit by means of interruptions. They send interrupt requests to the μP processor and the μP processor performs tasks in response to these requests.
En se référant à la figure 2, l'unité centrale UC comprend, dans l'exemple décrit, un processeur μP capable de coopérer avec une mémoire de travail MT (une mémoire RAM, par exemple), avec une carte mère CM et un disque dur DD. La carte mère CM dialogue avec la plupart des périphériques, tels que la liaison COM (sortie L3) via une carte modem CMO, une carte son CS (sortie L2) et, le cas échéant, l'écran ECR via une carte graphique CG (sortie Ll). Les organes de saisie CLA et SOU sont reliés par les liaisons L4 et L5. Le processeur μP peut dialoguer avec les périphériques tels que les organes de saisie, la liaison COM, le disque dur DD et la carte son CS, par des interruptions .Referring to FIG. 2, the central processing unit UC comprises, in the example described, a processor μP capable of cooperating with a working memory MT (a RAM memory, for example), with a motherboard CM and a disk hard DD. The CM motherboard communicates with most peripherals, such as the COM link (L3 output) via a CMO modem card, a card its CS (output L2) and, if necessary, the ECR screen via a graphics card CG (output L1). The gripping devices CLA and SOU are connected by the links L4 and L5. The μP processor can communicate with peripherals such as input devices, the COM link, the DD hard disk and the CS sound card, by interruptions.
En se référant à la figure 3, un programme PGM est exécuté (flèche EXE). Pendant cette exécution, un périphérique PERI (ou encore une horloge système), requiert une interruption provisoire INT de 1 ' exécution du programme PGM en cours .Referring to Figure 3, a PGM program is executed (arrow EXE). During this execution, a PERI device (or even a system clock) requires a temporary interruption INT of the execution of the current PGM program.
La routine d ' interruption RINT se déroule alors comme suit :The RINT interrupt routine then proceeds as follows:
- la routine commence d'abord par une sauvegarde SAV1 des registres en cours, dans une mémoire cache CH du processeur et, le cas échéant dans une mémoire vive RAM de l'ordinateur, en cas de dépassement des capacités de la mémoire cache CH ;- the routine begins first with a SAV1 backup of the registers in progress, in a cache memory CH of the processor and, if necessary in a random access memory RAM of the computer, in the event of exceeding the capacities of the cache memory CH;
- la routine, se poursuit par l'élaboration effective TRA de la tache requise par le périphérique, au cours de laquelle seuls les états architecturaux (par exemple le compteur ordinal de programmes) sont sauvegardés ;- the routine, continues with the effective development TRA of the task required by the peripheral, during which only the architectural states (for example the ordinal program counter) are saved;
- et, lorsque la tâche est effectuée, la routine d'interruption se poursuit par une restauration des registres RES par rapport à 1 ' état initial SAVl , puis - par une sauvegarde SAV2 des registres et des états architecturaux qui ont été utilisés pendant l'interruption.- and, when the task is carried out, the interruption routine continues with a restoration of the registers RES with respect to the initial state SAV1, then - with a backup SAV2 of the registers and architectural states which have been used during the interruption.
A la fin de la routine d'interruption RINT, on retourne (flèche RT) à l'exécution du programme PGM.At the end of the RINT interrupt routine, we return (arrow RT) to the execution of the PGM program.
Dans les techniques de génération d ' aléas connues et vérifiant la norme RFC 1750 ( IETF, RFC 1750 : Randomness recommandations for security, 1994 ) , l ' ordinateur comprend un contrôleur d ' interruption auquel on accède pour mesurer un écart temporel entre deux interruptions . A partir de l ' écart temporel entre différentes interruptions , on construit une expression aléatoire. Cependant, en service, ces interruptions sont requises par des périphériques généralement en fonction de la demande d'un utilisateur. Cette technique présente le désavantage d'être lente puisque la génération de l'expression aléatoire dépend principalement de l'activité de l'utilisateur. De plus, comme l'aléa généré dépend ainsi de conditions physiques externes, il s'agit plutôt d'un "pseudoaléa", au sens de la référence :In known random generation techniques and verifying the RFC 1750 standard (IETF, RFC 1750: Randomness recommendations for security, 1994), the computer includes an interrupt controller which is accessed to measure a time difference between two interrupts. From the time difference between different interruptions, we construct a random expression. However, in service, these interruptions are required by peripherals generally according to the request of a user. This technique has the disadvantage of being slow since the generation of the random expression depends mainly on the activity of the user. In addition, as the hazard generated thus depends on external physical conditions, it is rather a "pseudo-hazard", within the meaning of the reference:
Oded Goldreich, Modem Cryptography Probabilistic Proofs and P-se dorandomness . Number- 17 in Algorithme and Combinatorics. Spri-nger, 1999. -- - -- - _Oded Goldreich, Modem Cryptography Probabilistic Proofs and P-se dorandomness. Number- 17 in Algorithm and Combinatorics. Spri-nger, 1999. - - - - _
La présente invention propose de procéder autrement.The present invention proposes to do otherwise.
En se référant à la figure 4, le processeur μP, capable de coopérer avec une mémoire de travail MT, comprend dans -1- exemple décrit-: -— —Referring to FIG. 4, the processor μP, capable of cooperating with a working memory MT, comprises in -1- example described-: -— -
- une mémoire cache de données CD, - une mémoire cache de second niveau CN2,a CD data cache memory, a second level CN2 cache memory,
- une mémoire cache d'instructions CI,- a CI instruction cache memory,
- un prédicteur de branchement PB,- a PB branch predictor,
- une mémoire cache de traduction d'adresses TLB ("Translation Lookaside Buffer"), et - un compteur de cycle CC.- a TLB address translation cache memory ("Translation Lookaside Buffer"), and - a CC cycle counter.
Dans l'exemple, l'ordinateur est une station de travail commercialisé par la société SUN (Marque déposée) et le processeur est du type ULTRASPARC II (Marque déposée) à 300 MHz de fréquence d'horloge. Le processeur est mis en oeuvre par le système d'exploitation SOLARIS (Marque déposée).In the example, the computer is a workstation marketed by the company SUN (Registered trademark) and the processor is of the ULTRASPARC II (Registered trademark) type at 300 MHz clock frequency. The processor is implemented by the SOLARIS operating system (registered trademark).
Dans le schéma représenté sur la figure 4, les mémoires volatiles et/ou les états internes volatiles du processeur sont représentés par des traits pleins. Ainsi, les mémoiresIn the diagram shown in FIG. 4, the volatile memories and / or the volatile internal states of the processor are represented by solid lines. So the memories
CI, CD, CN2, ainsi que les tables PB et TLB correspondent à des mémoires qui comprennent des données volatiles relatives à des états internes du processeur. Le compteur de cycle, qui incrémente sa valeur à chaque cycle, correspond à un état interne volatile du processeur.CI, CD, CN2, as well as the PB and TLB tables correspond to memories which include volatile data relating to internal states of the processor. The cycle counter, which increments its value on each cycle, corresponds to a volatile internal state of the processor.
Des unités fonctionnelles UF coopèrent, d'une part, avec la mémoire cache de données CD, pour récupérer et transmettre les données et, d'autre part avec un fichier de registre REG, régulièrement mis à jour.UF functional units cooperate, on the one hand, with the data cache memory CD, to recover and transmit the data and, on the other hand with a REG register file, regularly updated.
Le prédicteur de branchement PB pilote la mémoire cache d'instructions CI. Pour utiliser ces données d'instructions, un mécanisme matériel appelé décodeur DR traduit et renomme ces données d'instructions. Ces données traduites sont ensuite traitées par des files d'attentes matérielles Q, lesquelles les appliquent aux unités fonctionnelles UF du processeur.The branch predictor PB controls the instruction cache memory CI. To use this instruction data, a hardware mechanism called a DR decoder translates and renames this instruction data. This translated data is then processed by hardware queues Q, which apply them to the functional units UF of the processor.
La mémoire cache de second niveau CN2 peut stocker des données simples, auquel cas elle coopère avec la mémoire cache de données CD, ou encore des données d'instructions, auquel cas elle coopère avec la mémoire cache d'instructions CI.The second level cache memory CN2 can store simple data, in which case it cooperates with the data cache memory CD, or also instruction data, in which case it cooperates with the instruction cache memory CI.
La mémoire cache de traduction d'adresses TLB peut stocker les adresses physiques des pages d'un processus.The TLB address translation cache can store the physical addresses of the pages of a process.
Dans l'exemple décrit où le processeur est de type ULTRASPARC II: - la mémoire cache de données de premier niveau CD comprend 16 ko à accès direct (512 secteurs cache à 32 octets) ;In the example described where the processor is of the ULTRASPARC II type: - the first level data cache memory CD comprises 16 kb with direct access (512 cache sectors at 32 bytes);
- la mémoire cache d'instructions est de 16 ko, avec des blocs caches de 32 octets ;- the instruction cache memory is 16 KB, with 32-byte cache blocks;
- les caches de second niveau CN2 sont de 1 Mo avec des blocs de 64 octets ; - la table TLB comprend 64 entrées et le demandeur a constaté que pour cent invocations consécutives par le système d'exploitation, le nombre minimum cumulé de déplacements de blocs excède systématiquement 4500 pour les données et 600 pour les instructions ;- the second level CN2 caches are 1 MB with blocks of 64 bytes; - the TLB table includes 64 entries and the requester has found that for one hundred consecutive invocations by the operating system, the minimum cumulative number of block displacements systematically exceeds 4500 for the data and 600 for the instructions;
- le prédicteur de branchement PB a une taille mémoire de 2K entrées de 2 bits.- the PB branching predictor has a memory size of 2K 2-bit inputs.
On se réfère maintenant à la figure 5 pour décrire, dans un mode de réalisation préféré, un traitement permettant de _générejr_ des__expressions aléatoires en utilisant un ordinateur _équipé d'un processeur du type représenté sur la figure 4.Reference is now made to FIG. 5 to describe, in a preferred embodiment, a processing allowing _generation of random expressions using a computer _ equipped with a processor of the type represented in FIG. 4.
Le traitement commence par l'initialisation et la déclaration d'une table WALK, à l'étape 10. Préférentiellement, la tableProcessing begins with the initialization and declaration of a WALK table, in step 10. Preferably, the table
WALK est de dimensions correspondant à une taille mémoire deux fois plus grande que la mémoire cache de premier niveau.WALK is of dimensions corresponding to a memory size twice as large as the first level cache memory.
Le cas échéant, à l'étape 12, une table ARRAY est initialisée et déclarée. Elle est choisie de dimensions mettant en oeuvre une taille mémoire deux fois plus grande que la mémoire pouvant être traduite par le cache de traduction TLB, en vue d'exercer la totalité des entrées du TLB.If necessary, in step 12, an ARRAY table is initialized and declared. It is chosen to have dimensions using a memory size twice as large as the memory that can be translated by the TLB translation cache, in order to exercise all of the TLB entries.
Le traitement se poursuit en 14 par la lecture d'une donnée de la table WALK, à travers une valeur de pointeur PT. Préférentiellement, à l'étape 14, on conserve en outre l'ancien pointeur lu précédemment dans la boucle pour la mise à jour à l'étape 24, comme on le verra plus loin.The processing continues at 14 by reading a datum from the WALK table, through a pointer value PT. Preferably, in step 14, the old pointer read previously was also kept in the loop for updating in step 24, as will be seen below.
Ainsi, en lisant la valeur d'un pointeur dans la table WALK, on met en oeuvre :Thus, by reading the value of a pointer in the WALK table, we implement:
- soit la mémoire cache de données CD de premier niveau ;- either the first level CD data cache memory;
- soit la mémoire cache de second niveau CN2 quand la donnée est absente au premier niveau ; - soit la mémoire principale quand la donnée est absente au premier et au deuxième niveau.- either the second level cache memory CN2 when the data is absent at the first level; - or the main memory when the data is absent on the first and second level.
Comme les dimensions de la table WALK sont deux fois plus grandes, en taille de mémoire, que la mémoire cache de premier niveau CD, la probabilité de présence de la donnée dans le cache de premier niveau est de 1/2 : le temps de la lecture sera différent suivant la présence ou non de la donnée dans le cache.As the dimensions of the WALK table are twice as large, in memory size, as the first level cache memory CD, the probability of the presence of the data in the first level cache is 1/2: the time of the reading will be different depending on the presence or not of the data in the cache.
A l'étape 16, un bit de poids fort de la valeur du pointeur PT est testé, dans le but de dépasser la taille de la table WALK et d'exercer plutôt la table de prédiction de branchement PB. Ici, le résultat du test 16 n'a aucune influence sur la suite du traitement et, d'ailleurs, n'est pas pris en compte pour la suite. Cependant, la durée d'exécution du test diffère selon que le test a été bien prédit ou mal prédit.In step 16, a most significant bit of the value of the pointer PT is tested, with the aim of exceeding the size of the WALK table and rather exercising the branch prediction table PB. Here, the result of test 16 has no influence on the continuation of the treatment and, moreover, is not taken into account for the rest. However, the test execution time differs depending on whether the test was well predicted or poorly predicted.
A lLétape 20, on lit la valeur T du compteur de cycles du processeur μP.A l L step 20, it reads the value T of the .mu.P CPU cycle counter.
A l'étape 22, une nouvelle valeur du pointeur PT est attribuée, en fonction de son ancienne valeur et de la valeur courante T du compteur de cycles, lue à l'étape 20. Cette fonction de 1 ' ancienne valeur du pointeur PT et de la valeur T est une combinaison qui, dans une réalisation préférée, correspond à la fonction "ou exclusif" (XOR) . Cette modification de la valeur du pointeur par un "ou exclusif" avec le compteur de cycles permet d'amplifier l'aléa. Ainsi, un utilisateur qui tenterait d'accéder à la valeur de PT pour reprendre le traitement et obtenir l'expression aléatoire générée ne retrouverait pas les mêmes valeurs puisqu'elles dépendent du compteur de cycles, ce qui renforce avantageusement la sécurité de l'aléa généré. A l'étape 24, la table WALK est mise à jour en y attribuant la valeur du pointeur PT nouvellement définie à l'étape 22. Avantageusement, on propage ainsi l'aléa dans la table WALK, lorsque le traitement aura effectué plusieurs boucles, comme on le verra plus loin.In step 22, a new value of the pointer PT is assigned, as a function of its old value and of the current value T of the cycle counter, read in step 20. This function of the old value of the pointer PT and of the value T is a combination which, in a preferred embodiment, corresponds to the "or exclusive" function (XOR). This modification of the value of the pointer by an "or exclusive" with the cycle counter makes it possible to amplify the hazard. Thus, a user who would try to access the value of PT to resume processing and obtain the random expression generated would not find the same values since they depend on the cycle counter, which advantageously reinforces the security of the hazard. generated. In step 24, the WALK table is updated by assigning to it the value of the pointer PT newly defined in step 22. Advantageously, the hazard is thus propagated in the WALK table, when the processing has carried out several loops, as we will see later.
A l'étape 26, on sort une donnée aléatoire RES[i], en fonction de la valeur du pointeur PT établie à l'étape 22.At step 26, a random datum RES [i] is output, as a function of the value of the pointer PT established in step 22.
Le traitement se poursuit par une incrémentation (étape 30) de l'indice de boucle i, laquelle est incrémentée à l'étape 30, tant que cette valeur ne dépasse pas le nombre N (étape 28). Avantageusement, le nombre N est choisi en fonction de la taille mémoire du cache d'instructions CI, de manière à le saturer lorsque l'indice de boucle i atteint la valeur N.The processing continues with an incrementation (step 30) of the loop index i, which is incremented in step 30, as long as this value does not exceed the number N (step 28). Advantageously, the number N is chosen as a function of the memory size of the instruction cache CI, so as to saturate it when the loop index i reaches the value N.
Ainsi, à chaque boucle d'indice i, on lit en 14 la valeur précédente du pointeur PT, établie à l'étape 22 pour l'indice de boucle précédent et, d'une part, on propage l'aléa progressivement à chaque étape 24, pour tous les indices de boucle, et, d'autre part, on récupère les expressions aléatoires successives RES[i] à l'étape 26.Thus, at each loop of index i, we read at 14 the previous value of the pointer PT, established in step 22 for the previous loop index and, on the one hand, the hazard is propagated gradually at each step 24, for all the loop indices, and, on the other hand, the successive random expressions RES [i] are recovered in step 26.
Finalement, lorsque la valeur de l'indice de boucle i atteint la valeur N, on récupère une expression aléatoire Ω, à l'étape 32, en fonction des différents aléas RES[1], RES[2], .. , RES[N] .Finally, when the value of the loop index i reaches the value N, a random expression Ω is recovered, in step 32, as a function of the different hazards RES [1], RES [2], .., RES [ NOT] .
Une boucle pour déduire l'expression aléatoire, aussi en fonction d'une valeur de pointeur dans le tableur ARRAY défini à l'étape 12, n'est pas représentée à la figure 5. Bien entendu, l'expression aléatoire RES[i] peut être tirée, à la fois d'une lecture d'un pointeur sur la table WALK et d'une lecture d'un autre pointeur sur la table ARRAY. On se réfère maintenant au traitement retranscrit en annexe, correspondant à des instructions pour un programme informatique, en langage C.A loop for deducing the random expression, also as a function of a pointer value in the ARRAY spreadsheet defined in step 12, is not represented in FIG. 5. Of course, the random expression RES [i] can be drawn, both from a reading of a pointer on the WALK table and from a reading of another pointer on the ARRAY table. We now refer to the processing transcribed in the appendix, corresponding to instructions for a computer program, in C language.
Le code est compilé en utilisant le compilateur du système d'exploitation SOLARIS de la société SUN (Marques déposées), avec les options cc-x05-FAST-XARCH = vδPLUS.The code is compiled using the SOLARIS operating system compiler from the company SUN (Trademarks), with the options cc-x05-FAST-XARCH = v =PLUS.
La fonction "HardTick()" fournit le nombre de cycles écoulés depuis le dernier appel (il s'agit donc d'une différence entre le nombre de cycles actuels et le nombre de cycles lus lors de la consultation précédente).The "HardTick ()" function provides the number of cycles that have elapsed since the last call (this is therefore a difference between the number of current cycles and the number of cycles read during the previous consultation).
Le signe correspond à la fonction "ou exclusif" (XOR) .The sign corresponds to the "or exclusive" (XOR) function.
Le programme commence par les déclarations :The program begins with the declarations:
- de la table Walk,- from the Walk table,
- des pointeurs pt, PT et PT2,- pointers PT, PT and PT2,
- de l'indice de boucle i qui est un entier, et - d'une boucle (instruction "loop" de la ligne 1).- of the loop index i which is an integer, and - of a loop ("loop" instruction of line 1).
La table Walk est initialisée par l'instruction short Walk [512*1024], de manière à lui attribuer une taille mémoire de 1 Mo, ce qui correspond à la capacité du cache de second niveau CN2 et qui, en tout état de cause, dépasse la capacité du cache de premier niveau.The Walk table is initialized by the short Walk instruction [512 * 1024], so as to give it a memory size of 1 MB, which corresponds to the capacity of the second level cache CN2 and which, in any event, exceeds the capacity of the first level cache.
A la ligne 2, on teste le bit 14 du pointeur pt (4000 en hexadécimal correspondant à 214) . Le test sur le bit de poids fort 14 permet de dépasser la taille mémoire allouée à la table Walk et d'exercer ainsi le prédicteur de branchement PB. On incrémente, le cas échéant, une valeur courante X, en fonction du test. De façon analogue, la ligne 5 teste le bit de poids fort 15 du pointeur pt (8000 en hexadécimal corres- pondant à 215) pour exercer encore le prédicteur de branchement. Les résultats de ces tests, ainsi que la variable courante X, n'ont aucune importance ici. En fait, ces instructions de test sont suivies d'une opération de combinaison "ou exclusif" (signe "Λ" aux lignes 4 et 7), faisant intervenir le pointeur pt, en vue d'additionner l'aléa et empêcher un observateur d'accéder à l'expression aléatoire RESULT[i] (correspondant à l'expression aléatoire RES[i] de la figure 5) et à la valeur du pointeur pt, comme on le verra plus loin.On line 2, test bit 14 of the pointer pt (4000 in hexadecimal corresponding to 2 14 ). The test on the most significant bit 14 makes it possible to exceed the memory size allocated to the Walk table and thus to exercise the branch predictor PB. If necessary, a current value X is incremented, as a function of the test. Similarly, line 5 tests the most significant bit 15 of the pointer pt (8000 in hexadecimal corresponding to 2 15 ) to further exercise the branch predictor. The results of these tests, as well as the variable current X, have no importance here. In fact, these test instructions are followed by a combination operation "or exclusive" (sign " Λ " on lines 4 and 7), involving the pointer pt, in order to add the hazard and prevent an observer from d 'access the random expression RESULT [i] (corresponding to the random expression RES [i] in Figure 5) and the value of the pointer pt, as we will see below.
A la ligne 3, les bits de poids faible (inférieur à 14) du pointeur pt (3fff en hexadécimal correspondant à 214-1) sont sauvegardés dans le pointeur PT. A la seconde instruction de la ligne 3, le pointeur pt lit ses nouvelles valeurs dans la table. La troisième instruction concerne le pointeur PT2 qui prend aléatoirement ses valeurs aux adresses correspondant aux bits de poids inférieur à 14.On line 3, the least significant bits (less than 14) of the pointer pt (3fff in hexadecimal corresponding to 2 14 -1) are saved in the pointer PT. At the second instruction in line 3, the pointer pt reads its new values from the table. The third instruction concerns the pointer PT2 which randomly takes its values at the addresses corresponding to the bits of weight less than 14.
Ici, l'opération sur le pointeur PT2 de" la ligne 3 a principalement pour but la combinaison "ou exclusif" avec le pointeur pt de la ligne 4 qui suit, de laquelle est tirée l'expression aléatoire RESULT[i].Here, the operation on the pointer PT2 of " line 3 mainly aims at combining" or exclusive "with the pointer pt of line 4 which follows, from which the random expression RESULT [i] is taken.
A la ligne 6, on tire du compteur de cycles du processeur (fonction "HardTick( ) ") la valeur courante du compteur de cycles, puis on combine cette valeur par "ou exclusif" et décalage circulaire avec une variable T.In line 6, we extract from the processor cycle counter ("HardTick ()" function) the current value of the cycle counter, then we combine this value with "or exclusive" and circular offset with a variable T.
A la ligne 7 , le pointeur pt prend la valeur de la combinaison "ou exclusif" de lui-même avec la variable T, dans le but d'additionner l'aléa, comme décrit ci-avant. Le résultat de cette combinaison est appliqué à la table Walk (ligne 8). En modifiant ainsi la table Walk à la volée, on propage l'aléa dans la table.In line 7, the pointer pt takes the value of the "or exclusive" combination of itself with the variable T, with the aim of adding the hazard, as described above. The result of this combination is applied to the Walk table (line 8). By thus modifying the Walk table on the fly, the hazard is propagated in the table.
On incrémente ensuite le compteur de boucle i (ligne 9). Dans l'exemple décrit, 132 autres copies des lignes 2 à 9 du corps de boucle sont présentes, de manière à ce que le volume d'instructions de la boucle (compilée) soit sensiblement égale (de préférence, par valeur inférieure) à la taille du cache d'instruction CI.Then increment the loop counter i (line 9). In the example described, 132 other copies of lines 2 to 9 of the body are present, so that the instruction volume of the (compiled) loop is substantially equal (preferably, by lower value) to the size of the CI instruction cache.
Dans l'exemple de l'annexe, on remarquera que la table ARRAY de la figure 5 n'a pas été déclarée. On procède autrement ici pour exercer le tampon TLB. A la ligne 11, on fait jouer tout le tampon TLB en mettant en oeuvre les 128 pages dans la table Walk.In the example in the appendix, it will be noted that the ARRAY table in Figure 5 has not been declared. We proceed differently here to exercise the TLB buffer. On line 11, we play all the TLB buffer by implementing the 128 pages in the Walk table.
Avantageusement, ce programme est destiné à être mis en service en permanence dans l'ordinateur de l'invention, avec une priorité d'exécution relativement basse par rapport aux autres tâches du processeur μP. Ainsi, à chaque disponibilité du processeur μP, le programme de l'annexe prend la main pour préparer des expressions aléatoires Ω. Il s'interrompt lorsque le processeur est sollicité par une autre application, notamment par voie d'interruptions, auquel cas le contenu des adresses des caches de premier niveau, de second niveau, d'instructions, du tampon TLB, etc, est modifié après l'interruption, ce qui augmente encore l'aléa généré lorsque le programme générateur d'aléas reprend son exécution ensuite.Advantageously, this program is intended to be put into service permanently in the computer of the invention, with a relatively low execution priority compared to the other tasks of the processor μP. Thus, each time the μP processor is available, the program in the appendix takes over to prepare random expressions Ω. It is interrupted when the processor is requested by another application, in particular by interrupts, in which case the content of the addresses of the first level, second level caches, instructions, the TLB buffer, etc., is modified after the interruption, which further increases the hazard generated when the hazard generator program resumes execution thereafter.
Bien entendu, la présente invention ne se limite pas à la forme de réalisation décrite ci-avant à titre d'exemple ; elle s'étend à d'autres variantes.Of course, the present invention is not limited to the embodiment described above by way of example; it extends to other variants.
Ainsi, on comprendra que l'utilisation du compteur de cycles, ci-avant, n'est décrite qu'à titre d'exemple. Dans une variante, on peut utiliser un compteur d'événements, tel que le compteur d'horloge ou autre.Thus, it will be understood that the use of the cycle counter, above, is described only by way of example. Alternatively, one can use an event counter, such as the clock counter or the like.
Dans le programme retranscrit en annexe, on ne déclare pas une table ARRAY pour exercer le tampon TLB. Bien entendu, cette variante peut être prévue, comme dans le traitement représenté sur la figure 5.In the program transcribed in the appendix, an ARRAY table is not declared to exercise the TLB buffer. Of course, this variant can be provided, as in the processing shown in FIG. 5.
Les déclarations et initialisations des tables en début de traitement sont fonction des capacités des mémoires telles que le cache de données de premier niveau, de second niveau, le tampon TLB. La déclaration de ces tables est susceptible d'évoluer en fonction des mémoires utilisées dans le processeur de l'ordinateur selon l'invention.The declarations and initializations of the tables at the start of processing depend on the capacities of memories such as the first level, second level data cache, the TLB buffer. The declaration of these tables is liable to change as a function of the memories used in the processor of the computer according to the invention.
Enfin, dans ce qui précède, le traitement fait intervenir tous—les états internes-— our les mémoires caches et les prédicteurs de branchements des processeurs actuels. Dans des variantes simplifiées, il peut être prévu de n'utiliser qu'une partie de ces états internes pour générer des expressions aléatoires, au moins un type d'états internes. D'autres états internes non accessibles à l'utilisateur peuvent être aussi exploités (états de différents tampons, etc.).Finally, in the foregoing, the processing involves all — the internal states—— for the cache memories and the predictors of connections of the current processors. In simplified variants, provision may be made to use only part of these internal states to generate random expressions, at least one type of internal state. Other internal states not accessible to the user can also be used (states of different buffers, etc.).
La présente invention vise également le code logiciel qu'elle fait intervenir, tout particulièrement lorsqu'il est mis à disposition sur tout support lisible sur un ordinateur. L'expression "support lisible par ordinateur" couvre un support de stockage, par exemple magnétique ou optique, aussi bien qu'un moyen de transmission, tel qu'un signal numérique ou analogique. The present invention also relates to the software code which it involves, particularly when it is made available on any medium readable on a computer. The term "computer-readable medium" covers a storage medium, for example magnetic or optical, as well as a means of transmission, such as a digital or analog signal.
ANNEXEANNEX
short Walk [512 * 1024]; register short pt, PT, pT2; register integer i;short Walk [512 * 1024]; register short pt, PT, pT2; register integer i;
1 loop{1 loop {
2 if (pt & 0x4000) X++;2 if (pt & 0x4000) X ++;
3 PT=pt & 0x3fff;pt=Walk[PT];PT2=Walk[PT2 & 0x3fff];3 PT = pt &0x3fff; pt = Walk [PT]; PT2 = Walk [PT2 &0x3fff];
4 RESULT[i]=PT2Λpt; 5 if (pt & 0x8000) X++;4 RESULT [i] = PT2 Λ pt; 5 if (pt & 0x8000) X ++;
6 T = ( (T«l)ΛHardTick() )Λ(T»15) ;6 T = ((T "l) Λ HardTick ()) Λ (T"15);
7 pt = ptΛT;7 pt = pt Λ T;
8 Walk[PT] = pt;8 Walk [PT] = pt;
9 i++; 10 ** même séquence répétée 132 fois **9 i ++; 10 ** same sequence repeated 132 times **
11 X += Walk[(PT & 127) « 12];11 X + = Walk [(PT & 127) “12];
12 } 12}

Claims

Revendications claims
1. Ordinateur comprenant :1. Computer including:
- un processeur (μP), susceptible d' interagir avec des périphériques par voie d'interruptions, comprenant au moins une mémoire cache interne et un compteur matériel donné et- a processor (μP), capable of interacting with peripherals by means of interrupts, comprising at least one internal cache memory and a given hardware counter, and
- un générateur d'aléa, opérant par mesure de temps (T) sur des séquences d'instructions, liées à des interruptions, caractérisé en ce que le générateur d'aléa effectue la mesure de temps, à partir d'au moins le compteur matériel donné, sur des séquences d'instructions dont la durée d-' exéc.ution_ dépende au_ moins en ..partie d'états internes (CD,CN2,CI,TLB,PB,T) du processeur, non directement accessibles a l'utilisateur et qui sont modifiés par des interrup- tions, les états internes étant relatifs entre autres à la présence ou l'absence de données dans au moins la mémoire cache interne, ces données étant recherchées dans au moins la ^mémoire cache interne .lors de l'exécution d'au moins une séquence d'instructions.- a hazard generator, operating by time measurement (T) on sequences of instructions, linked to interruptions, characterized in that the hazard generator performs the time measurement, from at least the counter given hardware, on sequences of instructions whose execution time depends at least on .. part of internal states (CD, CN2, CI, TLB, PB, T) of the processor, not directly accessible to the user and which are modified by interruptions, the internal states are related inter alia to the presence or absence of data in at least the internal cache memory, this data being retrieved from the at least ^ internal cache memory. when executing at least one sequence of instructions.
2. Ordinateur, selon la revendication 1, caractérisé en ce que le générateur d'aléa effectue la mesure de temps (T) à partir au moins d'un compteur de cycle que comprend le processeur.2. Computer according to claim 1, characterized in that the hazard generator performs the time measurement (T) from at least one cycle counter that includes the processor.
3. Ordinateur selon l'une des revendications 1 et 2, dans lequel les états internes du processeur incluent des adresses mémoire pour au moins la mémoire cache interne, volatile, du processeur (CD,CN2,CI,TLB) , caractérisé en ce que le généra- teur d'aléa comporte un module comprenant—des -instructions susceptibles de modifier le contenu de la mémoire cache interne en y accédant.3. Computer according to one of claims 1 and 2, in which the internal states of the processor include memory addresses for at least the internal, volatile cache memory of the processor (CD, CN2, CI, TLB), characterized in that the hazard generator comprises a module comprising —instructions capable of modifying the content of the internal cache memory by accessing it.
4. Ordinateur selon la revendication 3, caractérisé en ce que le module comprend une instruction pour déclarer une table4. Computer according to claim 3, characterized in that the module comprises an instruction to declare a table
(Walk) de taille mémoire choisie au moins égale à la capacité de la mémoire cache interne du processeur, ainsi qu'au moins un pointeur (pt;PT) pour adresser la table.(Walk) of selected memory size at least equal to the capacity of the internal cache memory of the processor, as well as at least one pointer (pt; PT) to address the table.
5. Ordinateur selon la revendication 4, dans lequel le processeur comprend un cache de premier niveau (CD) et un cache de second niveau (CN2), caractérisé en ce que la taille mémoire de la table (Walk) est choisie supérieure à la capacité mémoire du cache de premier niveau (CD), de manière que la table ne puisse pas être contenue dans le cache de premier niveau.5. Computer according to claim 4, in which the processor comprises a first level cache (CD) and a second level cache (CN2), characterized in that the memory size of the table (Walk) is chosen to be greater than the capacity first level cache memory (CD), so that the table cannot be contained in the first level cache.
6. Ordinateur selon l'une des revendications 4 et 5, caractérisé en ce que le module comprend au moins une instruction de lecture de la valeur du pointeur (pt), et en ce que le générateur d'aléa est agencé pour fournir une expression aléatoire (RES[i]) à partir de la valeur lue (pt) .6. Computer according to one of claims 4 and 5, characterized in that the module comprises at least one instruction for reading the value of the pointer (pt), and in that the random generator is arranged to provide an expression random (RES [i]) from the value read (pt).
7. Ordinateur selon la revendication 6, prise en combinaison avec la revendication 2, caractérisé en ce que le module comprend au moins une instruction de lecture d'une valeur du compteur de cycle (T), et en ce que le générateur d'aléa est agencé pour fournir une expression aléatoire (RES[i]) a partir d'une combinaison (XOR) de la valeur lue du pointeur (pt) et de la valeur du compteur de cycle (T).7. Computer according to claim 6, taken in combination with claim 2, characterized in that the module comprises at least one instruction for reading a value of the cycle counter (T), and in that the random generator is arranged to provide a random expression (RES [i]) from a combination (XOR) of the value read from the pointer (pt) and the value of the cycle counter (T).
8. Ordinateur selon l'une des revendications précédentes, dans lequel le processeur comprend une table de prédiction de branchement (PB), de contenu volatile, caractérisé en ce que le générateur d'aléa comporte un module comprenant des instructions pour modifier le contenu de la table- de-prédiction en y accédant.8. Computer according to one of the preceding claims, in which the processor comprises a branch prediction table (PB), of volatile content, characterized in that the hazard generator comprises a module comprising instructions for modifying the content of the prediction table by accessing it.
9. Ordinateur selon la revendication 8, prise en combinaison avec la revendication 6, caractérisé en ce que le module comprend en outre une instruction de test de la valeur du pointeur (pt), de manière a modifier le contenu de la table de prédiction de branchement.9. Computer according to claim 8, taken in combination with claim 6, characterized in that the module further comprises an instruction for testing the value of pointer (pt), so as to modify the content of the branch prediction table.
10. Ordinateur selon l'une des revendications précédentes, caractérisé en ce que le générateur d'aléa est agencé pour être mis en service en permanence, avec une priorité de bas niveau.10. Computer according to one of the preceding claims, characterized in that the hazard generator is arranged to be put into service permanently, with a low level priority.
11. Ordinateur selon la revendication 10, prise en combinai- son avec l'une des revendications 6 et 7, caractérisé en ce que le module comporte une boucle d'instructions comprenant une. mise à jour de la table avec l'attribution d'une valeur fonction de l'expression aléatoire (PT2Λpt ; ptΛT), en vue de propager un aléa dans la table.11. Computer according to claim 10, taken in combination with one of claims 6 and 7, characterized in that the module comprises an instruction loop comprising one . updating the table with the assignment of a value based on the random expression (PT2 Λ pt; pt Λ T), in order to propagate a hazard in the table.
12. Ordinateur selon l'une des revendications précédentes, dans lequel le processeur comprend en outre un cache d'instructions (CI), de contenu volatile, tandis que les états internes du processeur concernent en outre le contenu du cache d'instructions, caractérisé en ce que le générateur d'aléa comporte un module comprenant des instructions pour modifier le contenu du cache d'instructions en y accédant.12. Computer according to one of the preceding claims, in which the processor further comprises an instruction cache (CI), of volatile content, while the internal states of the processor further relate to the content of the instruction cache, characterized in that the hazard generator comprises a module comprising instructions for modifying the content of the instruction cache by accessing it.
13. Ordinateur selon la revendication 12, prise en combinai- son avec la revendication 11, caractérisé en ce que le module est agencé pour que la taille de la boucle d'instructions soit sensiblement égale à la taille du cache d'instructions.13. The computer as claimed in claim 12, taken in combination with claim 11, characterized in that the module is arranged so that the size of the instruction loop is substantially equal to the size of the instruction cache.
14. Ordinateur selon l'une des revendications précédentes, -caractérisé en ce que le-module- comprend---une -instruction pour déclarer une table (ARRAY) de taille mémoire choisie au moins égale à la capacité de la mémoire cache de traduction d'adresse (TLB), ainsi qu'un pointeur dans la table.14. Computer according to one of the preceding claims, -characterized in that the-module- includes --- an -instruction to declare a table (ARRAY) of selected memory size at least equal to the capacity of the translation cache memory address (TLB), as well as a pointer to the table.
15. Produit programme d'ordinateur, caractérisé en ce qu'il comporte des données d'instructions capables de commander le processeur pour effectuer une mesure de temps, a partir d'un compteur matériel donné, sur des séquences d'instructions dont la durée d'exécution dépend au moins en partie d'états internes du processeur, non directement accessibles à l'utilisateur et qui sont modifiés par des interruptions, et de générer des aléas à partir de ladite mesure, les états internes étant relatifs entre autres à la présence ou l'absence de données dans au moins une mémoire cache interne lors de l'exécution d'au moins une séquence d'instructions. 15. Computer program product, characterized in that it includes instruction data capable of controlling the processor for performing a time measurement, from a given hardware counter, on sequences of instructions whose execution time depends at least in part on internal states of the processor, which are not directly accessible to the user and which are modified by interrupts, and generate random events from said measurement, the internal states being related inter alia to the presence or absence of data in at least one internal cache memory during the execution of at least one sequence of instructions.
PCT/FR2002/003356 2001-10-11 2002-10-02 Improved random variable generator WO2003032150A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
FR01/13117 2001-10-11
FR0113117A FR2830952B1 (en) 2001-10-11 2001-10-11 IMPROVED ALEA GENERATOR

Publications (1)

Publication Number Publication Date
WO2003032150A1 true WO2003032150A1 (en) 2003-04-17

Family

ID=8868183

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/FR2002/003356 WO2003032150A1 (en) 2001-10-11 2002-10-02 Improved random variable generator

Country Status (2)

Country Link
FR (1) FR2830952B1 (en)
WO (1) WO2003032150A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905377A (en) * 2021-02-10 2021-06-04 山东英信计算机技术有限公司 Method, system and medium for avoiding BMC breakdown

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6076097A (en) * 1997-12-11 2000-06-13 At&T Corp. System and method for generating random numbers
EP1081591A2 (en) * 1999-09-01 2001-03-07 International Business Machines Corporation Random number generator
WO2001073542A1 (en) * 2000-03-29 2001-10-04 Feng Shui. Inc. Random number generation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6076097A (en) * 1997-12-11 2000-06-13 At&T Corp. System and method for generating random numbers
EP1081591A2 (en) * 1999-09-01 2001-03-07 International Business Machines Corporation Random number generator
WO2001073542A1 (en) * 2000-03-29 2001-10-04 Feng Shui. Inc. Random number generation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
DAVIS D ET AL: "CRYPTOGRAPHIC RANDOMNES FROM AIR TURBULENCE IN DISK DRIVES", ADVANCES IN CRYPTOLOGY (CRYPTO). SANTA BARBARA, AUG. 21 - 25, 1994, PROCEEDINGS OF THE ANNUAL INTERNATIONAL CRYPTOLOGY CONFERENCE (CRYPTO), BERLIN, SPRINGER, DE, vol. CONF. 14, 21 August 1994 (1994-08-21), pages 114 - 120, XP000467657, ISBN: 3-540-58333-5 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112905377A (en) * 2021-02-10 2021-06-04 山东英信计算机技术有限公司 Method, system and medium for avoiding BMC breakdown

Also Published As

Publication number Publication date
FR2830952A1 (en) 2003-04-18
FR2830952B1 (en) 2004-03-12

Similar Documents

Publication Publication Date Title
US11740992B2 (en) Deriving component statistics for a stream enabled application
Small et al. A Comparison of OS Extension Technologies.
EP2470989B1 (en) Entropy pools for virtual machines
US7841010B2 (en) Software or other information integrity verification using variable block length and selection
JP4651947B2 (en) System and method for providing a flexible and durable hardware ID based on time and weight
US9575864B2 (en) Function-level dynamic instrumentation
US20090024801A1 (en) Method and system to detect a cached web page
CN107016027A (en) The method and apparatus for realizing business information fast search
US20150205949A1 (en) Runtime application integrity protection
Courville et al. Understanding storage I/O behaviors of mobile applications
US6553426B2 (en) Method apparatus for implementing multiple return sites
US7287159B2 (en) Detection and identification methods for software
US20080148065A1 (en) Direct Memory Access for Compliance Checking
CN111126619B (en) Machine learning method and device
WO2003032150A1 (en) Improved random variable generator
CN108540569B (en) Software installation package replacement method and device and computer storage medium
US11775304B2 (en) Methods and apparatus to insert profiling instructions into a graphics processing unit kernel
JP4930982B2 (en) Download system
US6529603B1 (en) Method and apparatus to reduce the risk of observation of a secret value used by an instruction sequence
AU2013295686B2 (en) Lock free streaming of executable code data
FR2914448A1 (en) Secured execution computer environment protecting system for very high security digital apparatus i.e. payment terminal, has transcoder detecting whether descriptor returned by memory associates virtual address at physical address of ROM
JP2022080545A (en) Service management apparatus, service management method, and service management program
CN114327520A (en) Program uninstalling residual information cleaning method and device, electronic device and storage medium
CN116186733A (en) Data processing method, system, computing device and readable storage medium
Merry et al. Measuring the Startup Time of a Java Virtual Machine.

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

AL Designated countries for regional patents

Kind code of ref document: A1

Designated state(s): AT BE BG CH CY CZ DE DK EE ES FR GB GR IE IT LU MC NL PT SE SK TR

121 Ep: the epo has been informed by wipo that ep was designated in this application
DFPE Request for preliminary examination filed prior to expiration of 19th month from priority date (pct application filed before 20040101)
122 Ep: pct application non-entry in european phase