Verfahren und Schaltung zur Durchführung von Rechenoperationen Method and circuit for performing arithmetic operations
Die Erfindung betrifft ein Verfahren gemäß dem Oberbegriff des Patentanspruches 1. Des Weiteren betrifft die Erfindung eine digitale Schaltung gemäß dem Oberbegriff des Anspruches 10.The invention relates to a method according to the preamble of claim 1. Furthermore, the invention relates to a digital circuit according to the preamble of claim 10.
Aus der Patentschrift DE 102 01 449 C1 sind ein Rechenwerk bzw. ein Verfahren zum Ausführen einer arithmetischen Operation mit zumindest zwei Operanden bekannt, wobei die zumindest zwei Operanden verschlüsselt sind. Das Rechenwerk umfasst eine arithmetisch-logische Einheit mit einem ersten Eingang für den ersten verschlüsselten Operanden, einen zweiten Eingang für den zweiten verschlüsselten Operanden, einen dritten Eingang für einen Verschlüsselungsparameter und einen Ausgang für ein verschlüsseltes Ergebnis der Operation. Die arithmetisch-logische Einheit verknüpft den ersten Eingang, den zweiten Eingang und den dritten Eingang mittels arithmetischer Unteroperationen unter Berücksichtung der Art und Weise der Verschlüsselung der Operanden, sodass an dem Ausgang ein verschlüsseltes Ergebnis erhalten wird, das gleich einem Wert ist, der erhalten werden würde, wenn der erste Operand in unverschlüsseltem Zustand und der zweite Operand in unverschlüsseltem Zustand der arithmetischen Operation unterzogen werden und ein erhaltenes Resultat anschließend verschlüsselt wird, wobei keine Entschlüsselung der Operanden in der arithmetisch- logischen Einheit durchgeführt wird. Durch diesen Aufbau der arithmetisch-logischen Einheit sollten so genannte Seitenkanalattacken auf die arithmetisch-logische Einheit verhindert werden.From the patent DE 102 01 449 C1 an arithmetic unit or a method for carrying out an arithmetic operation with at least two operands are known, wherein the at least two operands are encrypted. The calculator includes an arithmetic logic unit having a first input for the first encrypted operand, a second input for the second encrypted operand, a third input for an encryption parameter, and an output for an encrypted result of the operation. The arithmetic logic unit combines the first input, the second input and the third input by means of arithmetic sub-operations, taking into account the manner in which the operands are encrypted, so that an encrypted result equal to a value obtained is obtained at the output would be if the first operand in the unencrypted state and the second operand in the unencrypted state of the arithmetic operation are subjected to and a result obtained is then encrypted, with no decryption of the operands is performed in the arithmetic logic unit. Due to this structure of the arithmetic-logical unit, so-called side channel attacks on the arithmetic-logical unit should be prevented.
Es ist jedoch aus Mangard, Popp, Gammel, "Side-Channel Leakage of Masked CMOS Gates", Proceedings of the RSA Conference 2005 Cryptographers' Track (CT- RSA 2005, February 14-18, 2005, San Francisco, USA), Lecture Notes in Computer Science (LNCS), Springer Verlag, 2005 bekannt, dass in derartigen Rechenwerken kurzzeitige Störimpulse, so genannte „Glitches", auftreten, welche die Durchführung von Seitenkanalattacken trotzdem ermöglichen. Seitenkanalattacken stellen ein erhebliches Sicherheitsrisiko für Rechenwerke bzw. Rechenverfahren dar bei denen vertrauliche Daten verarbeitet werden.However, it is from Mangard, Popp, Gammel, "Side-Channel Leakage of Masked CMOS Gates," Proceedings of the RSA Conference 2005 Cryptographers' Track (CT-RSA 2005, February 14-18, 2005, San Francisco, USA), Lecture Notes in Computer Science (LNCS), published Springer Verlag, 2005, that in such arithmetic units short-term glitches, so-called "glitches" occur, which still allow the implementation of side channel attacks anyway side channel attacks pose a significant security risk for arithmetic and computing processes in which confidential data are processed.
Als Vorschlag zum Schutz von Rechenwerken bzw. Rechenverfahren sind neben der in der Patentschrift DE 102 01 449 C1 beschriebenen Technik auch so genannte „dual-rail pre-charge" Logikstile, wie die „Sense-Amplifier Based Logic" oder die „Wave Dynamic Digital Logic" bekannt. In Schaltungen basierend auf diesen Logikstilen werden sämtliche Verbindungsleitungen doppelt ausgeführt und in jedem Taktzyklus auf definierte Werte vorgeladen. Seitenkanalattacken auf derartige Schaltungen werden weitgehend vermieden, indem die Verbindungsleitungen jeweils paarweise bezüglich ihrer
elektrischen Eigenschaften ausbalanciert werden. Das Ausbalancieren der Leitungen ist technisch jedoch sehr aufwendig und der Aufwand wird durch die Verwendung immer kleinerer Halbleitertechnologien ständig größer. Ferner sind die Probleme beim Nicht- Maskieren von Zwischenergebnissen als auch die Lösung dieser Probleme durch Maskierung auf unterschiedlichen Logikebenen bis hin zur Maskierung einstufiger Logikelemente wohl bekannt.As a proposal for the protection of arithmetic units or arithmetic methods in addition to the technique described in the patent DE 102 01 449 C1 also so-called "dual-rail pre-charge" logic styles, such as the "Sense Amplifier Based Logic" or the "Wave Dynamic Digital In circuits based on these logic styles, all connection lines are duplicated and precharged to defined values every clock cycle electrical properties are balanced. The balancing of the lines is technically very complex and the effort is constantly increasing by the use of ever smaller semiconductor technologies. Furthermore, the problems of not masking intermediate results as well as the solution of these problems by masking on different logic levels up to the masking of single-level logic elements are well known.
Ziel der Erfindung ist es, ein Verfahren bzw. eine Schaltung zu schaffen, die höchste Sicherheit gegen Seitenkanalattacken bietet und gleichzeitig leicht implementiert werden kann. Diese Ziele werden bei einem Verfahren mit den in Anspruches 1 angeführtenThe aim of the invention is to provide a method or a circuit which offers the highest security against side channel attacks and at the same time can be easily implemented. These objects are achieved in a method with the recited in claim 1
Merkmalen erreicht. Bei einer erfindungsgemäßen Schaltung werden diese Ziele durch die Merkmale des Patentanspruches 10 erreicht.Characteristics achieved. In a circuit according to the invention, these objects are achieved by the features of claim 10.
Die vorliegende Erfindung basiert darauf, dass alle in einem erfindungsgemäßen Verfahren bzw. in einer erfindungsgemäßen Schaltung auftretenden Datenwerte maskiert sind. Unter dem Maskieren eines Datenwerts versteht man eine Rechenoperation bei welcher der Datenwert mit einem oder mehreren Zufallswert(en) so verknüpft wird, dass das Resultat der Rechenoperation, d.h. der maskierte Datenwert, statistisch unabhängig vom ursprünglichen Datenwert ist. In der Praxis wird zum Maskieren eines Datenwerts üblicherweise eine bitweise XOR Verknüpfung von Zufallswerten und des zu maskierenden Datenwerts eingesetzt.The present invention is based on the fact that all data values occurring in a method according to the invention or in a circuit according to the invention are masked. By masking a data value is meant an arithmetic operation in which the data value is associated with one or more random values such that the result of the arithmetic operation, i. the masked data value is statistically independent of the original data value. In practice, a bitwise XOR combination of random values and the data value to be masked is usually used to mask a data value.
Durch das Maskieren aller in einem Verfahren bzw. einer Schaltung auftretenden Datenwerte werden sämtliche auftretenden physikalischen Seitenkanalinformationen weitgehend statistisch unabhängig von den unmaskierten Datenwerten gemacht. Somit wird höchste Sicherheit gegen Seitenkanalattacken gewährleistet. In bisher bekannten Verfahren und Schaltungen, die Maskierung alsBy masking all data values occurring in a method or a circuit, all occurring physical side channel information is made largely statistically independent of the unmasked data values. Thus, the highest security is guaranteed against side channel attacks. In previously known methods and circuits, the masking as
Schutzmaßnahme gegen Seitenkanalattacken einsetzen, werden nicht alle auftretenden Datenwerte ausreichend maskiert um eine hohe Sicherheit gegen Seitenkanalattacken zu gewährleisten. Beispielsweise treten in arithmetisch-logischen Einheiten gemäß der Patentschrift DE 102 01 449 C1 Datenwerte auf, die statistisch abhängig von den entsprechenden unmaskierten Datenwerten sind. Diese Abhängigkeit ermöglicht wiederum die Durchführung von Seitenkanalattacken. Weiters treten in derartigen arithmetisch-logischen Einheiten auch die eingangs erwähnten „Glitches" auf, welche ebenfalls die Anfälligkeit gegenüber Seitenkanalattacken erhöhen.Use protection against side channel attacks, not all occurring data values are sufficiently masked to ensure a high level of security against side channel attacks. For example, data values which are statistically dependent on the corresponding unmasked data values occur in arithmetic-logic units according to the patent DE 102 01 449 C1. This dependency in turn allows the execution of side channel attacks. Furthermore, in such arithmetic-logic units, the "glitches" mentioned at the outset also occur, which likewise increase susceptibility to side-channel attacks.
In der hier vorliegenden Erfindung sind konsequent alle an den Ein- und Ausgängen der Logikelemente auftretenden Datenwerte maskiert. Dies wird einerseits dadurch erreicht, dass „Glitches" in dem Verfahren bzw. in der Schaltung komplett verhindert werden und andererseits dadurch, dass auf der Ebene von einstufigen
Logikelementen und nicht auf der Ebene von arithmetisch-logischen Einheiten maskiert wird. Einstufige Logikelemente sind die kleinstmöglichen Teile einer Schaltung, die einen logischen Ausgangsdatenwert basierend auf Eingangsdatenwerten und einer logischen Funktion berechnen können. Die Erfindung unterscheidet sich nicht nur durch die Anwendung des dual-rail-In the present invention, all data values occurring at the inputs and outputs of the logic elements are consistently masked. On the one hand, this is achieved by completely preventing "glitches" in the process or in the circuit and, on the other hand, by the fact that they are at the level of one-stage Logic elements and not masked at the level of arithmetic logic units. Single-level logic elements are the smallest possible parts of a circuit that can compute a logical output data value based on input data values and a logical function. The invention differs not only by the application of the dual-rail
Prinzips signifikant von den bekannten Maskierungsverfahren von einstufigen Logikelementen. Von besonderem Vorteil ist es, dass die Ausgangswerte aller einstufigen Logikelemente, die in der maskierten Schaltung auftreten, statistisch unabhängig von den unmaskierten Eingangswerten sind. Aus der WO 2003/060672 A1 ist es bekannt, logische Funktionsblöcke, wie zumPrinciple significantly from the known masking methods of single-stage logic elements. It is particularly advantageous that the output values of all single-level logic elements that occur in the masked circuit are statistically independent of the unmasked input values. From WO 2003/060672 A1 it is known logical function blocks, such as
Beispiel UND Gatter, durch maskierte Funktionsblöcke zu ersetzen. Sowohl die Eingänge als auch die Ausgänge dieser maskierten Funktionsblöcke sind maskiert. Was die Zwischenergebnisse in den eingesetzten maskierten Funktionsblöcken betrifft, wird jedoch nur gefordert, dass keine unmaskierten Zwischenergebnisse auftreten. Diese Forderung ist jedoch nicht ausreichend, um einen Schutz gegen Stromverbrauchsattacken zu gewährleisten. Dieser Schutz ist nur gewährleistet, wenn alle Zwischenergebnisse, die an den Ausgängen der einstufigen Logikelemente in den maskierten Funktionsblöcken auftreten, statistisch unabhängig von den unmaskierten Eingangsdaten sind. Mit einer Implementierung eines erfindungsgemäßen Verfahrens bzw. einer erfindungsgemäßen Schaltung sind keine technisch schwer zu realisierenden Anforderungen verbunden. Insbesondere sind keine ausbalancierten Verbindungsleitungen erforderlich. Im Folgenden werden nun die Effekte für die einzelnen Merkmale des Anspruches 1 und die Effekte für die einzelnen Unteransprüche im Detail erörtert.Example AND gate to replace with masked function blocks. Both the inputs and the outputs of these masked function blocks are masked. However, as far as the intermediate results in the masked function blocks used are concerned, it is only required that no unmasked intermediate results occur. However, this requirement is not sufficient to ensure protection against electricity consumption attacks. This protection is only guaranteed if all intermediate results that occur at the outputs of the one-level logic elements in the masked function blocks are statistically independent of the unmasked input data. With an implementation of a method according to the invention or a circuit according to the invention, there are no technical requirements that are difficult to implement. In particular, no balanced connection lines are required. In the following, the effects for the individual features of claim 1 and the effects for the individual subclaims will now be discussed in detail.
Das Maskieren von Datenwerten bietet einen effektiven Schutz gegen Seitenkanalattacken, wenn tatsächlich jeder in einer digitalen Schaltung auftretende Datenwert maskiert ist. Im Allgemeinen treten in einer digitalen Schaltung jedoch „Glitches" auf, welche die Erfüllung dieser Bedingung technisch sehr aufwendig machen. Der Grund hierfür ist, dass es bereits während der Entwicklung einer digitalen Schaltung relativ aufwendig ist festzustellen, welche Datenwerte überhaupt als Folge von „Glitches" in einer digitalen Schaltung auftreten werden. Umso aufwendiger ist es dann noch zusätzlich dafür Sorge zu tragen, dass jeder dieser auftretenden Datenwerte stets ordnungsgemäß maskiert sein wird. Um diesen Aufwand vollständig einzusparen, werden erfindungsgemäßeMasking data values provides effective protection against side channel attacks when, in fact, every data value occurring in a digital circuit is masked. In general, however, "glitches" occur in a digital circuit, which makes the fulfillment of this condition technically very complicated.The reason for this is that it is already relatively complicated to determine which data values as a result of "glitches "will occur in a digital circuit. The more complex it is then additionally to ensure that each of these occurring data values will always be properly masked. To completely save this effort, inventive
Verfahren so ausgeführt bzw. erfindungsgemäße Schaltungen so aufgebaut, dass „Glitches" erst gar nicht auftreten können. Dies wird grundsätzlich dadurch erreicht, dass
das so genannte „dual-rail pre-charge" Konzept verwendet wird. Konkret bedeutet dies, dass alle Datenleitungen im Vergleich zu einer konventionellen CMOS Schaltung verdoppelt werden. Anstatt einer Leitung gibt es somit ein Leitungspaar zur Kodierung eines Datenbits. Weiters kann die digitale Schaltung in zwei sich zeitlich abwechselnde Phasen versetzt werden. Dies sind die so genannte Vorladephase und die so genannte Auswertephase. Typischerweise wird das Umschalten zwischen diesen beiden Phasen durch ein Steuer- bzw. Taktsignal ausgelöst.Processes executed in this way or circuits according to the invention constructed in such a way that "glitches" can not even occur at all In practice, this means that all data lines are doubled compared to a conventional CMOS circuit, so instead of a line, there is a line pair for coding a data bit These are the so-called precharge phase and the so-called evaluation phase Typically, the switching between these two phases is triggered by a control or clock signal.
Während der Vorladephase werden alle Ein- und Ausgänge der einstufigen Logikelemente, welche die digitale Schaltung aufbauen, auf vorgegebene Vorladewerte gesetzt. Mit anderen Worten ausgerückt bedeutet dies, dass die gesamte Schaltung in jeder Vorladephase in jeweils denselben Zustand versetzt wird. In diesem Zustand liegen an allen Ein- und Ausgängen von einstufigen Logikelementen zuvor definierte Vorladewerte an. Wichtig dabei ist zu berücksichtigen, dass alle Eingänge jedes einzelnen Logikelements jeweils auf den gleichen Vorladewert gesetzt werden müssen. Es gibt also kein Logikelement in der digitalen Schaltung an dessen Eingängen in der Vorladephase unterschiedliche Werte anliegen. Dadurch treten, wie später noch genauer ausgeführt wird, keine „Glitches" in der digitalen Schaltung auf.During the precharge phase, all inputs and outputs of the one-level logic elements that make up the digital circuit are set to predetermined precharge values. In other words, disengaged, this means that the entire circuit is set to the same state in each precharge phase. In this state, previously defined preload values are present at all inputs and outputs of single-level logic elements. It is important to note that all inputs of each individual logic element must be set to the same pre-load value. There is therefore no logic element in the digital circuit at whose inputs in the precharge phase different values are applied. As a result, as will be explained in more detail later, no "glitches" occur in the digital circuit.
Während der Auswertephase wird von der digitalen Schaltung eine Rechenoperation ausgeführt. Diese Rechenoperation wird vollständig maskiert und in „dual-rail" Kodierung ausgeführt. Dies bedeutet, dass der digitalen Schaltung neben maskierten Operanden und entsprechenden Maskierungsparametern auch die maskierten Operanden und die Maskierungsparameter in invertierter Form übergeben werden. Basierend auf diesen übergebenen Werten werden ein maskiertes Resultat und ein maskiertes Resultat in invertierter Form berechnet. Diese maskierten Resultate entsprechen jenen Resultaten die erhalten werden würden, wenn die vorgegebene Rechenoperation unmaskiert mit unmaskierten Operanden ausgeführt worden wäre und wenn die Resultate anschließend maskiert worden wären.During the evaluation phase, an arithmetic operation is performed by the digital circuit. This arithmetic operation is completely masked and executed in "dual-rail" encoding, which means that in addition to masked operands and corresponding masking parameters, the masked operands and masking parameters are also passed in inverted form to the digital circuit and masks a masked result in inverted form These masked results correspond to those results that would be obtained if the given arithmetic operation had been performed unmasked with unmasked operands and if the results had subsequently been masked.
Neben der maskierten Ausführung der Rechenvorschrift in „dual-rail" Kodierung, ist ein wesentliches Merkmal von erfindungsgemäßen Verfahren und Schaltungen, dass während der Auswertephase alle Datenwerte an den Ausgängen jedes einzelnen einstufigen Logikelements der digitalen Schaltung gemäß jeweils einem Maskierungsverfahren maskiert sind. Somit treten während der Auswertephase in der digitalen Schaltung ausschließlich Datenwerte auf, die gemäß einem Maskierungsverfahren maskiert sind. Dadurch ist gewährleistet, dass alle in der digitalen Schaltung auftretenden Datenwerte statistisch unabhängig von den entsprechenden unmaskierten Werten in einer konventionellen CMOS Schaltung sind. Dies ist eine
wesentliche Vorraussetzung für die Erreichung einer hohen Sicherheit gegen Seitenkanalattacken.In addition to the masked execution of the calculation rule in "dual-rail" coding, an essential feature of methods and circuits according to the invention is that during the evaluation phase all data values at the outputs of each individual single-level logic element of the digital circuit are masked according to a respective masking method During the evaluation phase in the digital circuit, only data values which are masked according to a masking method are ensured, ensuring that all data values occurring in the digital circuit are statistically independent of the corresponding unmasked values in a conventional CMOS circuit essential prerequisite for achieving a high level of security against side channel attacks.
Die Eigenschaft, dass der Ausgang jedes einzelnen einstufigen Logikelements gemäß einem Maskierungsverfahren maskiert ist, wird dadurch erreicht, dass beim Entwurf einer digitalen Schaltung die Logikfunktionen der einzelnen einstufigen Logikelemente und die Verschaltung dieser Logikelemente basierend auf Wahrheitstabellen entsprechend ausgewählt werden. Bei der Auswahl der Logikfunktionen der einstufigen Grundelemente ist weiters darauf zu achten, dass diese Funktionen positiv oder negativ monoton sind. Die Monotonieeigenschaft der Logikfunktionen und die Voraussetzung, dass während der Vorladephase die Eingänge eines jeden einstufigen Logikelements auf jeweils denselben Vorladewert gesetzt werden und führen dazu, dass beim Übergang der Schaltung von der Vorladephase in die Auswertephase alle Ausgänge eines jeden einstufigen Logikelements maximal einmal ihren Wert ändern. Mit anderen Worten ausgedrückt bedeutet dies, dass beim Übergang von der Vorladephase in die Auswertephase keine „Glitches" auftreten.The characteristic of masking the output of each individual single-level logic element according to a masking method is achieved by selecting the logic functions of the single single-level logic elements and the interconnection of these logic elements based on truth tables in the design of a digital circuit. When selecting the logic functions of the single-level basic elements, it must also be ensured that these functions are positive or negative monotone. The monotonicity of the logic functions and the requirement that during the precharge phase, the inputs of each single-level logic element are set to the same Vorladewert and cause the transition of the circuit from the precharge phase in the evaluation phase all outputs of each single-level logic element change its value at most once , In other words, this means that no glitches occur during the transition from the pre-charge phase to the evaluation phase.
Dasselbe gilt auch für den Übergang der digitalen Schaltung von der Auswertephase zurück in die Vorladephase. Bei diesem Übergang schalten die Ausgänge von genau jenen einstufigen Logikelementen auf ihren definierten Vorladewert zurück, die zuvor beim Übergang in die Auswertephase ihren Wert geändert haben. In erfindungsgemäßen Schaltungen und Verfahren treten somit zu keiner Zeit „Glitches" auf, wenn gleichzeitig auch gewährleistet ist, dass an den Eingängen der digitalen Schaltung keine „Glitches" auftreten. Diese Grundvoraussetzung kann zum Beispiel dadurch erfüllt werden, dass die Eingänge der digitalen Schaltung durch Flip-Flops oder durch eine weitere erfindungsgemäße Schaltung gesetzt werden.The same applies to the transition of the digital circuit from the evaluation phase back to the pre-charge phase. During this transition, the outputs of exactly those one-level logic elements switch back to their defined precharge value, which previously changed their value during the transition into the evaluation phase. In circuits and methods according to the invention, "glitches" do not occur at any time, even if it is also ensured at the same time that no "glitches" occur at the inputs of the digital circuit. This basic requirement can be met, for example, by setting the inputs of the digital circuit by flip-flops or by a further circuit according to the invention.
Das Verhindern von „Glitches" und das Maskieren der Ausgänge aller einstufigen Logikelemente in erfindungsgemäßen Verfahren und Schaltungen führen zu einer sehr hohen Sicherheit gegen Seitenkanalattacken. Die physikalischen Seitenkanalinformation, die durch die Änderung der Datenwerte bei einem Übergang von einer Vorladephase in eine Auswertephase bzw. bei einem Übergang von einer Auswertephase in eineThe prevention of "glitches" and the masking of the outputs of all single-stage logic elements in methods and circuits according to the invention lead to a very high security against side channel attacks The physical side channel information obtained by changing the data values during a transition from a pre-charge phase to an evaluation phase a transition from one evaluation phase into one
Vorladephase auftreten, sind durch die Maskierung weitgehend unabhängig von jenenPrecharge occur, are largely independent of those by the masking
Datenwerten, die in entsprechenden unmaskierten CMOS Schaltungen auftreten würden.Data values that would occur in corresponding unmasked CMOS circuits.
In Unteranspruch 3 wird als Maskierungsverfahren, die bitweise XOR Verknüpfung von zu maskierendem Operanden und den Maskierungsparametern angeführt. Bei Verwendung dieses Maskierungsverfahrens ist gewährleistet, dass während der maskierten Berechnung einer Rechenvorschrift gemäß der Erfindung keine Datenwerte
auftreten, die eine statistische Abhängigkeit zu jenen Werten aufweisen, die in einer entsprechenden unmaskierten CMOS Schaltung auftreten würden.In sub-claim 3 is given as a masking method, the bitwise XOR linking masked operand and the masking parameters. Using this masking method, it is ensured that no data values are available during the masked calculation of a calculation rule according to the invention which have a statistical dependence on those which would occur in a corresponding unmasked CMOS circuit.
In den Unteransprüchen 7 und 8 sind zwei Methoden angeführt, wie zwischen Vorladephase und Auswertephase hin- und her geschaltet werden kann. Bei der Methode, die in Unteranspruch 7 beschrieben ist, wird hierfür ein zusätzliches Steuersignal verwendet. Dies hat den Vorteil, dass alle einstufigen Logikelemente zeitgleich in die Vorladephase versetzt werden können. Daraus resultiert aber anderseits auch der Nachteil, dass zu diesem Zeitpunkt dann ein sehr hoher Stromverbrauch in der Schaltung auftritt. Eine alternative Methode wird in Unteranspruch 8 beschrieben. Bei dieserIn the subclaims 7 and 8, two methods are given, as can be switched back and forth between pre-charge phase and evaluation. In the method described in dependent claim 7, an additional control signal is used for this purpose. This has the advantage that all single-stage logic elements can be put into the pre-charge phase at the same time. On the other hand, this also results in the disadvantage that a very high power consumption then occurs in the circuit at this time. An alternative method is described in subclaim 8. At this
Methode wird die Logikfunktion der einstufigen Logikelemente so gewählt, dass die einstufigen Logikelemente dadurch in die Vorladephase versetzt werden, dass an deren Eingängen Vorladewerte angelegt werden. Es ist für diese Methode somit kein zusätzliches Steuersignal erforderlich und es treten auch nicht so hohe Ströme auf wie bei der Methode gemäß Unteranspruch 7. Ein Nachteil dieser Methode ist jedoch, dass nicht alle Logikelemente gleichzeitig in die Vorladephase versetzt werden können. Es ist somit notwendig, dass die Vorladephase zumindest gleich lange dauert wie die Auswertephase.Method, the logic function of the single-level logic elements is selected so that the single-level logic elements are placed in the pre-charge phase by pre-charging values are applied to their inputs. Thus, no additional control signal is required for this method and it does not occur as high currents as in the method according to dependent claim 7. A disadvantage of this method, however, is that not all logic elements can be placed in the precharge phase at the same time. It is thus necessary that the pre-charge phase lasts at least as long as the evaluation phase.
Wie in Unteranspruch 9 angeführt, ist eine Balancierung von Leitungspaaren bezüglich ihrer elektrischen Eigenschaften nicht notwendig. Dadurch ist eine Implementierung einer erfindungsgemäßen Schaltung bzw. eines erfindungsgemäßen Verfahrens technisch wesentlich einfacher als die Implementierung von Schaltungen basieren auf den „dual-rail pre-charge" Logikstilen „Sense-Amplifier Based Logic" und „Wave Dynamic Digital Logic".As stated in dependent claim 9, a balancing of pairs of lines with respect to their electrical properties is not necessary. As a result, an implementation of a circuit according to the invention or a method according to the invention is technically much simpler than the implementation of circuits based on the "dual-rail pre-charge" logic styles "Sense Amplifier Based Logic" and "Wave Dynamic Digital Logic".
In den Zeichnungen sind Beispiele erfindungsgemäßer digitaler Schaltungen dargestellt. Es zeigen:The drawings show examples of digital circuits according to the invention. Show it:
- Fig. 1 eine schematische Darstellung einer erfindungsgemäßen digitalen Schaltung;FIG. 1 shows a schematic representation of a digital circuit according to the invention; FIG.
- Fig. 2 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation eine logische AND Operation implementiert und wobei als Maskierungsverfahren für die Operanden bzw. das Resultat eine bitweise XOR Verknüpfung mit dem Maskierungsparameter eingesetzt wird;FIG. 2 shows an illustration of a digital circuit according to the invention which implements a logical AND operation as the arithmetic operation and in which a bitwise XOR combination with the masking parameter is used as the masking method for the operands or the result;
- Fig. 3 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation eine logische NAND Operation implementiert und wobei als Maskierungsverfahren für die Operanden bzw. das Resultat eine bitweise XOR Verknüpfung mit dem Maskierungsparameter eingesetzt wird; - Fig. 4 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation eine logische OR Operation implementiert und wobei als
Maskierungsverfahren für die Operanden bzw. das Resultat eine bitweise XOR Verknüpfung mit dem Maskierungsparameter eingesetzt wird;3 shows an illustration of a digital circuit according to the invention which implements a logical NAND operation as arithmetic operation and wherein a bitwise XOR connection with the masking parameter is used as the masking method for the operands or the result; 4 shows an illustration of a digital circuit according to the invention which implements a logical OR operation as arithmetic operation and wherein Masking method for the operands or the result of a bitwise XOR operation is used with the masking parameter;
- Fig. 5 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation eine logische NOR Operation implementiert und wobei als Maskierungsverfahren für die Operanden bzw. das Resultat eine bitweise XOR Verknüpfung mit dem Maskierungsparameter eingesetzt wird;5 shows an illustration of a digital circuit according to the invention which implements a logical NOR operation as an arithmetic operation and wherein a bitwise XOR combination with the masking parameter is used as the masking method for the operands or the result;
- Fig. 6 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation eine logische XOR Operation implementiert und wobei als Maskierungsverfahren für die Operanden bzw. das Resultat eine bitweise XOR Verknüpfung mit dem Maskierungsparameter eingesetzt wird;6 shows an illustration of a digital circuit according to the invention which implements a logical XOR operation as the arithmetic operation and wherein a bitwise XOR connection with the masking parameter is used as the masking method for the operands or the result;
- Fig. 7 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation eine logische XNOR Operation implementiert und wobei als Maskierungsverfahren für die Operanden bzw. das Resultat eine bitweise XOR Verknüpfung mit dem Maskierungsparameter eingesetzt wird; und - Fig. 8 eine Darstellung einer erfindungsgemäßen digitalen Schaltung welche als Rechenoperation einen Wechsel der Maske eines Operanden vornimmt und wobei als Maskierungsverfahren für den Operanden eine bitweise XOR Verknüpfung mit dem jeweiligen Maskierungsparameter eingesetzt wird.7 shows an illustration of a digital circuit according to the invention which implements a logical XNOR operation as the arithmetic operation and wherein a bitwise XOR combination with the masking parameter is used as the masking method for the operands or the result; and FIG. 8 shows an illustration of a digital circuit according to the invention which performs a change of the mask of an operand as an arithmetic operation and wherein a bitwise XOR combination with the respective masking parameter is used as the masking method for the operand.
- Fig. 1 zeigt eine schematische Darstellung einer erfindungsgemäßen digitalen Schaltung 1. Eine erfindungsgemäße digitale Schaltung ist aus einem oder mehreren einstufigen Logikelementen 2 aufgebaut. Unter einstufigen Logikelementen sind die kleinstmöglichsten digitalen Teilschaltungen zu verstehen, die einen logischen Ausgangsdatenwert basierend auf Eingangsdatenwerten und einer logischen Funktion berechnen können. In einer erfindungsgemäßen digitalen Schaltung müssen die verwendeten einstufigen Logikelemente jeweils eine positiv oder negativ monotone, logische Funktion realisieren.FIG. 1 shows a schematic representation of a digital circuit 1 according to the invention. A digital circuit according to the invention is constructed from one or more single-stage logic elements 2. Single-level logic elements are the smallest possible digital subcircuits that can calculate a logical output data value based on input data values and a logical function. In a digital circuit according to the invention, the single-stage logic elements used must each realize a positive or negative monotone, logical function.
Eine erfindungsgemäße digitale Schaltung wird abwechselnd in eine der zwei folgenden Phasen versetzt: in die Vorladephase oder in die Auswertephase. In der Vorladephase werden an die Eingänge 3, 4, 5 und 6 der digitalen Schaltung vorgegebene Vorladewerte angelegt. Durch eine entsprechende Wahl der jeweiligen Logikfunktion der einstufigen Logikelemente, nötigenfalls auch unter Berücksichtigung eines der Schaltung zusätzlich zugeführten Steuersignals, muss sichergestellt werden, dass die Ausgänge der einstufigen Logikelemente und somit auch die Ausgänge 7 und 8 der digitalen Schaltung auf vorgegebene Vorladewerte gesetzt werden. Zusätzlich muss in einer erfindungsgemäßen digitalen Schaltung darauf geachtet werden, dass die einstufigen Logikelemente derart zusammengeschaltet sind, dass während der Vorladephase die Eingänge jeweils eines einstufigen Logikelements auf den gleichen Vorladewert gesetzt
werden. Zusammen mit der oben genannten Forderung, dass einstufige Logikelemente nur monotone Funktionen realisieren dürfen, stellt diese Bedingung bezüglich der Eingangswerte der einstufigen Logikelemente sicher, dass in einer erfindungsgemäßen digitalen Schaltung und somit auch an ihren Ausgängen keine „Glitches" auftreten. Solche „Glitches" rufen, wie eingangs schon beschrieben, eine Anfälligkeit für Seitenkanalattacken hervor.A digital circuit according to the invention is alternately placed in one of the following two phases: in the precharge phase or in the evaluation phase. In the precharge phase, predischarge values are applied to the inputs 3, 4, 5 and 6 of the digital circuit. By an appropriate choice of the respective logic function of the single-stage logic elements, if necessary, taking into account one of the circuit additionally supplied control signal, it must be ensured that the outputs of the single-level logic elements and thus the outputs 7 and 8 of the digital circuit are set to predetermined Vorladewerte. In addition, care must be taken in a digital circuit according to the invention that the single-stage logic elements are interconnected in such a way that the inputs of a single-stage logic element are set to the same pre-charge value during the pre-charge phase become. Together with the above-mentioned requirement that single-stage logic elements only be able to realize monotonous functions, this condition with respect to the input values of the single-stage logic elements ensures that no "glitches" occur in a digital circuit according to the invention and thus also at their outputs , as already described, a susceptibility to side channel attacks.
In der der Vorladephase folgenden Auswertephase werden an die Eingänge 3 und 4 der digitalen Schaltung die gemäß den jeweiligen Maskierungsverfahren und den Maskierungsparametern maskierten Operanden und die invertierten, maskierten Operanden angelegt. Die Maskierungsparameter und die invertierten Maskierungsparameter werden an die Eingänge 5 und 6 angelegt. An den Ausgängen der erfindungsgemäßen Schaltung treten in weiterer Folge die maskierten und die invertierten, maskierten Resultate auf. In der Auswertephase ist darauf zu achten, dass alle in der digitalen Schaltung auftretenden logischen Datenwerte gemäß einem Maskierungsverfahren und den entsprechenden Maskierungsparametern maskiert sind.In the evaluation phase following the precharging phase, the operands 3 and 4 of the digital circuit are applied with the operands masked according to the respective masking methods and the masking parameters and the inverted, masked operands. The masking parameters and the inverted masking parameters are applied to inputs 5 and 6. Subsequently, the masked and the inverted, masked results occur at the outputs of the circuit according to the invention. In the evaluation phase, it must be ensured that all logical data values occurring in the digital circuit are masked in accordance with a masking method and the corresponding masking parameters.
- Fig. 2 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation eine AND Operation ausführt. Im vorliegenden Fall wird als Maskierungsverfahren für die Operanden OP 1 und OP2 an den Eingängen der Schaltung und auch für das Resultat RE an den Ausgängen der Schaltung eine bitweise XOR Verknüpfung mit dem Maskierungsparameter MA eingesetzt. Selbstverständlich könnten auch andere geeignete Maskierungsverfahren (z.B. eine XNOR Verknüpfung) mit einem oder mehreren Maskierungsparameter(n) (z.B. ein Maskierungsparameter für die Operanden, ein Maskierungsparameter für das Resultat) verwendet werden. Die maskierten Operanden bzw. die invertierten, maskierten Operanden an den Eingängen und das maskierte Resultat bzw. das invertierte, maskierte Resultat an den Ausgängen der digitalen Schaltung stehen in dem in den Gleichungen (1) bis (6) beschriebenen Zusammenhang.FIG. 2 shows the implementation of a digital circuit 1 according to the invention which performs an AND operation as arithmetic operation. In the present case, a masking method for the operands OP 1 and OP2 at the inputs of the circuit and also for the result RE at the outputs of the circuit a bitwise XOR operation with the masking parameter MA is used. Of course, other suitable masking techniques (e.g., XNOR linking) with one or more masking parameters (n) (e.g., a masking parameter for the operands, a masking parameter for the result) could also be used. The masked operands or the inverted, masked operands at the inputs and the masked result or the inverted, masked result at the outputs of the digital circuit are in the relationship described in equations (1) to (6).
OP7MA = OP? Θ MA {1)OP7 MA = OP? Θ MA {1)
ÖP/MA = ÖP/ Θ MA (2)ÖP / MA = ÖP / Θ MA (2)
Während der so genannten Auswertephase liegen die maskierten Operanden, die invertierten, maskierten Operanden, der Maskierungsparameter und der invertierteDuring the so-called evaluation phase are the masked operands, the inverted, masked operands, the masking parameter and the inverted
Maskierungsparameter an den Eingängen der digitalen Schaltung an. Die durchzuführende Rechenoperation ist eine AND Operation, welche zum einen maskiert
und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (7) und (8) dargestellt.Masking parameters at the inputs of the digital circuit. The arithmetic operation to be performed is an AND operation, which on the one hand masks and on the other must be inverted and masked. The required results of this arithmetic operation are shown in equations (7) and (8).
Die Durchführung der Rechenoperation muss ausschließlich mit maskierten Datenwerten erfolgen, um gegen Seitenkanalattacken geschützt zu sein. Dazu werden in der Implementierung einstufige Logikelemente verwendet, welche die negativ monotone IMAJ (=invertierte Majorität) Logikfunktion realisieren. Die IMAJ Logikfunktion wird wie folgt definiert:The arithmetic operation must be carried out exclusively with masked data values in order to be protected against side channel attacks. For this purpose, one-level logic elements are used in the implementation, which realize the negative monotonous IMAJ (= inverted majority) logic function. The IMAJ logic function is defined as follows:
IMAJ(A,B,C) = A - B + A - C + B . C (9) Die dazu inverse Logikfunktion wird als Majoritätsfunktion (MAJ) bezeichnet. Der Ausgangswert des IMAJ Logikelements 10 ergibt sich nun zu:IMAJ (A, B, C) = A - B + A - C + B. C (9) The inverse logic function is called the majority function (MAJ). The initial value of the IMAJ logic element 10 now results in:
X10m = IMAJ(OPf MA ,OP2MA , MA) = OPfMA . OP2MA + OP1m - MA + OP2MA - MA = (OPV ® MA) • (OP2 θ MA) + (OPV θ MA) • MA + (OP2 θ MA) • MA =X10 m = IMAJ (OPf MA , OP2 MA , MA) = OPf MA . OP2 MA + OP1 m - MA + OP2 MA - MA = (OPV ® MA) • (OP2 θ MA) + (OPV θ MA) • MA + (OP2 θ MA) • MA =
(OPV • MA + OPV • MA) • (OP2 • MA + OP2 • MA) + (OP1 • MA + OPV • MA) • MA + (OP2 • MA + OP2 • MA) • MA =(OPV • MA + OPV • MA) • (OP2 • MA + OP2 • MA) + (OP1 • MA + OPV • MA) • MA + (OP2 • MA + OP2 • MA) • MA =
OPV • OP2 • MA + OPV • OP2 > MA + OPV • MA + OP2 • MA =OPV • OP2 • MA + OPV • OP2> MA + OPV • MA + OP2 • MA =
OPV • OP2 • MA + (OPV • OP2 + OPV + OP2) • MA =OPV • OP2 • MA + (OPV • OP2 + OPV + OP2) • MA =
OPV • OP2 • MA + OPV • OP2 • MA =OPV • OP2 • MA + OPV • OP2 • MA =
(OPV • OP2) φ MA =(OPV • OP2) φ MA =
OPV • OP2 Φ MA (VO)OPV • OP2 Φ MA (VO)
Es ist ersichtlich, dass dieses Zwischenergebnis ebenso ordnungsgemäß maskiert ist.It can be seen that this intermediate result is also properly masked.
Der Ausgangswert des nachfolgenden NOT Logikelements 11 ist zugleich das maskierte Resultat der erfindungsgemäßen digitalen Schaltung, welches mit dem gewünschten maskierten Resultat laut Gleichung (7) übereinstimmt:The output value of the subsequent NOT logic element 11 is at the same time the masked result of the digital circuit according to the invention, which coincides with the desired masked result according to equation (7):
REMA = MAJ(OPVMA , OP2MA , MA) = X70MA = OP1 - OP2 θ MA = (OPV • OP2) ® MA (V V) Weiters ergibt sich der Ausgangswert des IMAJ Logikelements 12 zu:RE MA = MAJ (OPV MA , OP2 MA , MA) = X70 MA = OP1 - OP2 θ MA = (OPV • OP2) ® MA (VV) Further, the output value of the IMAJ logic element 12 is:
XV2MA = IMAJ(OPVMA , OP2MA , MA) = OPV MA - OP2 ^ + OPV MA • MA + OP2 MA . MA =XV2 MA = IMAJ (OPVMA, OP2 MA , MA) = OPV MA - OP 2 ^ + OPV MA • MA + OP2 MA . MA =
(ÖPV φ MA) • (ÖP2 Φ MA) + (OPV φ MA) • MA + (Ö~P2 Φ MA) • MA =(PT φ MA) • (PT2 φ MA) + (OPV φ MA) • MA + (Ö ~ P2 φ MA) • MA =
(ÖPV • MA + OPV • MA) • (ÖP2 - MA + OP2 • MA) + (OPV - MA + OPV - MA) - MÄ + (ÖP2 • MÄ + OP2 - MA) - MA =(PTO • MA + OPV • MA) • (PT2 - MA + OP2 • MA) + (OPV - MA + OPV - MA) - ME + (PT2 • ME + OP2 - MA) - MA =
OPV • OP2 • MA + OPV • OP2 • MA + OPV • MA + OP2 • MA =OPV • OP2 • MA + OPV • OP2 • MA + OPV • MA + OP2 • MA =
OPV ■ OP2 ■ MA + (OPV ■ OP2 + OPV + OP2) • MA =OPV ■ OP2 ■ MA + (OPV ■ OP2 + OPV + OP2) • MA =
OPV • OP2 • MA + OPV • OP2 • MA =OPV • OP2 • MA + OPV • OP2 • MA =
(OPV - OP2) Θ MA = (OPV • OP2) φ MA (12) Es ist ersichtlich, dass dieses Zwischenergebnis auch ordnungsgemäß maskiert ist. Der
Ausgangswert des nachfolgenden NOT Logikelements 13 ist zugleich das invertierte, maskierte Resultat der erfindungsgemäßen digitalen Schaltung, welches mit dem gewünschten maskierten Resultat laut Gleichung (8) übereinstimmt:(OPV - OP2) Θ MA = (OPV • OP2) φ MA (12) It can be seen that this intermediate result is also properly masked. Of the Output value of the subsequent NOT logic element 13 is at the same time the inverted, masked result of the digital circuit according to the invention, which agrees with the desired masked result according to equation (8):
REMA = MAJ(OP-ZiViA. OP2MA, MA) = X72MA = (OPf • OP2) Θ MA = OPf • OP2 Θ MA (73) Es sei noch einmal darauf hingewiesen, dass alle in der Implementierung der digitalen Schaltung auftretenden Zwischenergebnisse nur in entsprechend maskierter Form auftreten, wodurch Seitenkanalattacken weitgehend verhindert werden. In der sich mit der Auswertephase abwechselnden Vorladephase werden vorgegebene Vorladewerte an die Eingänge der erfindungsgemäßen digitalen Schaltung (Operanden und Maskierungsparameter) angelegt. Dabei ist darauf zu achten, dass die Eingänge je eines einstufigen Logikelements auf denselben Vorladewert gesetzt werden. Dies ist eine der Maßnahmen die notwendig sind, um das Auftreten von „Glitches" zu verhindern. Im vorliegenden Fall betrifft das jeweils die Eingänge der beiden IMAJ Logikelemente 10 und 12. Insbesondere ist diese Bedingung dann erfüllt, wenn alle Eingänge der digitalen Schaltung während der Vorladephase auf denselben Vorladewert gesetzt werden. Für die beiden NOT Logikelemente 11 und 13 ist obige Bedingung immer erfüllt, da sie nur einen Eingang besitzen. Es sei darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen Schaltung der gleiche Vorladewert 0 angelegt wird, sich auch an den Ausgängen der Schaltung der Vorladewert 0 ergibt. Die IMAJ Logikfunktion und die NOT Logikfunktion sind beides negativ monotone Logikfunktionen. Damit ist die Anforderung an eine erfindungsgemäße digitale Schaltung erfüllt, welche besagt, dass nur einstufige Logikelemente mit positiv oder negativ monotoner Funktion verwendet werden dürfen. Zusammen mit der Forderung, dass die Eingänge je eines einstufigen Logikelements während der Vorladephase auf denselben Vorladewert gesetzt werden müssen, stellt diese Bedingung bezüglich der verwendeten Logikfunktionen sicher, dass in der erfindungsgemäßen digitalen Schaltung keine „Glitches" auftreten. Treten nun beim Übergang von der Vorladephase in die Auswertephase bzw. umgekehrt auch an den Eingängen der digitalen Schaltung keine „Glitches" auf, d.h. ein Eingangssignal ändert seinen Wert ausgehend vom aktuellen Wert höchstens einmal, dann treten in der digitalen Schaltung selbst und somit an ihren Ausgängen auch keine „Glitches" auf. Die Resultate an den Ausgängen der Schaltung können somit wiederum als Eingangssignale für andere erfindungsgemäße digitale Schaltungen verwendet werden.REMA = MAJ (OP-ZiViA, OP2MA, MA) = X72 MA = (OPf • OP2) Θ MA = OPf • OP2 Θ MA (73) It should again be noted that all intermediate results occurring in the implementation of the digital circuit are only occur in accordance masked form, which side channel attacks are largely prevented. In the precharge phase alternating with the evaluation phase, predetermined precharge values are applied to the inputs of the digital circuit according to the invention (operands and masking parameters). Care must be taken that the inputs of a single-level logic element are set to the same pre-load value. This is one of the measures necessary to prevent the occurrence of "glitches." In the present case, this applies to the inputs of the two IMAJ logic elements 10 and 12. In particular, this condition is fulfilled when all the inputs of the digital circuit during the For the two NOT logic elements 11 and 13, the above condition is always met, since they have only one input It should be noted that if during the precharge phase the same precharge value 0 is applied to all inputs of the digital circuit At the outputs of the circuit, the precharge value 0 is also obtained The IMAJ logic function and the NOT logic function are both negative monotone logic functions Thus, the requirement for a digital circuit according to the invention is met which states that only single-level logic elements with positive or negative monotonic function may be used together with the For tion that the inputs of each one-stage logic element must be set to the same Vorladewert during the precharge phase, this condition ensures with respect to the logic functions used that no "glitches" occur in the digital circuit according to the invention. If no "glitches" occur at the transition from the precharging phase into the evaluation phase or conversely also at the inputs of the digital circuit, ie an input signal changes its value from the current value at most once, then in the digital circuit itself and thus at its Outputs also no "glitches" on. The results at the outputs of the circuit can thus in turn be used as input signals for other digital circuits according to the invention.
- Fig. 3 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation eine NAND Operation ausführt. Als Maskierungsverfahren für dieFIG. 3 shows the implementation of a digital circuit 1 according to the invention which performs a NAND operation as arithmetic operation. As a masking method for the
Operanden OPf und OP2 an den Eingängen der Schaltung und auch für das Resultat RE an den Ausgängen der Schaltung wird wiederum eine bitweise XOR Verknüpfung mit dem
Maskierungsparameter MA eingesetzt. Die maskierten Operanden bzw. die invertierten, maskierten Operanden an den Eingängen und das maskierte Resultat bzw. das invertierte, maskierte Resultat an den Ausgängen der digitalen Schaltung stehen in dem in den Gleichungen (1) bis (6) beschriebenen Zusammenhang.Operands OPf and OP2 at the inputs of the circuit and also for the result RE at the outputs of the circuit is again a bitwise XOR operation with the Masking parameter MA used. The masked operands or the inverted, masked operands at the inputs and the masked result or the inverted, masked result at the outputs of the digital circuit are in the relationship described in equations (1) to (6).
Die durchzuführende Rechenoperation ist hier eine NAND Operation, welche zum einen maskiert und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (14) und (15) dargestellt.The arithmetic operation to be performed here is a NAND operation, which must be masked on the one hand and inverted and masked on the other hand. The required results of this arithmetic operation are shown in equations (14) and (15).
REMA = OP7 - OP2 ® MA (14)RE MA = OP7 - OP2®MA (14)
REMA = (OP? • OP2) Θ MA (15)REMA = (OP • OP2) Θ MA (15)
Die Implementierung der digitalen Schaltung in Fig. 3 ist beinahe identisch mit der in Fig. 2 gezeigten Schaltung, lediglich die beiden Ausgangssignale für REMA und RE MA sind vertauscht. Das heißt, in der Auswertephase ergibt sich für das maskierte Resultat REMA der digitalen Schaltung in Fig. 3 ein Wert entsprechend Gleichung (13):The implementation of the digital circuit in Fig. 3 is almost identical to the circuit shown in Fig. 2, only the two output signals for RE MA and RE M A are reversed. That is, in the evaluation phase, a value corresponding to equation (13) results for the masked result REMA of the digital circuit in FIG. 3:
REMA = MAJ(OP?MA.OP2MA,MA) = OP7 - OP2 θ MA (16)RE MA = MAJ (OP? MA.OP2MA, MA) = OP7 - OP2? MA (16)
Der Wert stimmt mit dem gewünschten maskierten Resultat laut Gleichung (14) überein. Für das invertierte, maskierte Resultat RE MA der digitalen Schaltung in Fig. 3 ergibt sich ein Wert entsprechend Gleichung (11): REMA = MAJ(OPf MA , OP2MA , MA) = (OPV • OP2) φ MA (17)The value agrees with the desired masked result according to equation (14). . For the inverted, masked result RE MA of the digital circuit in Figure 3 results in a value according to equation (11): REMA = MAJ (OPf MA, OP2 MA, MA) = (OPV • OP2) MA φ (17)
Der Wert stimmt mit dem gewünschten Resultat laut Gleichung (15) überein.The value agrees with the desired result according to equation (15).
Da die digitale Schaltung in Fig. 3 gegenüber der Schaltung in Fig. 2 nur minimal geändert wurde gelten die dortigen Überlegungen bezüglich der Maskierung von Zwischenergebnissen, der Vorladephase, der monotonen Logikfunktionen und der „Glitches" in entsprechender Form auch hier. Es sei auch hier noch darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen Schaltung der gleiche Vorladewert 0 angelegt wird, sich auch an den Ausgängen der Schaltung der Vorladewert 0 ergibt.Since the digital circuit in Fig. 3 has only been minimally changed compared to the circuit in Fig. 2, the considerations there regarding the masking of intermediate results, the precharge phase, the monotonic logic functions and the "glitches" in corresponding form apply here as well It should also be pointed out that if the same precharge value 0 is applied to all inputs of the digital circuit during the precharge phase, the precharge value 0 will also result at the outputs of the circuit.
- Fig. 4 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation eine OR Operation ausführt. Als Maskierungsverfahren für die Operanden OP1 und OP2 an den Eingängen der Schaltung und auch für das Resultat RE an den Ausgängen der Schaltung wird wiederum eine bitweise XOR Verknüpfung mit dem Maskierungsparameter MA eingesetzt. Die maskierten Operanden bzw. die invertierten, maskierten Operanden an den Eingängen und das maskierte Resultat bzw. das invertierte, maskierte Resultat an den Ausgängen der digitalen Schaltung stehen in dem in den Gleichungen (1) bis (6) beschriebenen Zusammenhang.
Während der Auswertephase liegen die maskierten Operanden, die invertierten maskierten Operanden, der Maskierungsparameter und der invertierte Maskierungsparameter an den Eingängen der digitalen Schaltung an. Die durchzuführende Rechenoperation ist eine OR Operation, welche zum einen maskiert und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (18) und (19) dargestellt.FIG. 4 shows the implementation of a digital circuit 1 according to the invention which performs an OR operation as arithmetic operation. As a masking method for the operands OP1 and OP2 at the inputs of the circuit and also for the result RE at the outputs of the circuit, a bitwise XOR combination with the masking parameter MA is again used. The masked operands or the inverted, masked operands at the inputs and the masked result or the inverted, masked result at the outputs of the digital circuit are in the relationship described in equations (1) to (6). During the evaluation phase, the masked operands, the inverted masked operands, the masking parameter and the inverted masking parameter are applied to the inputs of the digital circuit. The arithmetic operation to be performed is an OR operation, which must be masked on the one hand and inverted and masked on the other. The required results of this arithmetic operation are shown in equations (18) and (19).
Die Durchführung der Rechenoperation muss ausschließlich mit maskierten Datenwerten erfolgen, um gegen Seitenkanalattacken geschützt zu sein. Dazu werden in der Implementierung wiederum einstufige Logikelemente verwendet, welche die negativ monotone IMAJ (=invertierte Majorität) Logikfunktion gemäß Gleichung (9) realisieren. Der Ausgangswert des IMAJ Logikelements 30 ergibt sich nun zu:The arithmetic operation must be carried out exclusively with masked data values in order to be protected against side channel attacks. For this purpose, in the implementation once again single-stage logic elements are used, which realize the negative monotonous IMAJ (= inverted majority) logic function according to equation (9). The initial value of the IMAJ logic element 30 now results in:
X30MA = IMAJ(OPWOP2MA'MA> = OP7MA - 0P2MA + 0PW 'MA + OP2MA ' MA = X30 MA = IMAJ ( OP W OP2 MA ' MA > = OP7 MA - 0P2 MA + 0P W' MA + OP2 MA ' MA =
(OPV Θ MA) • (OP2 θ MA) + (OPV Φ MA) • MA + (OP2 Φ MA) • MA =(OPV Θ MA) • (OP2 θ MA) + (OPV Φ MA) • MA + (OP2 Φ MA) • MA =
(OPf - MA + OP? ■ MA) • (OP2 - MÄ + ÖP2 • MA) + (OPV - MA + OP? • MA) - MÄ + (OP2 - MÄ + Ö~P2 - MA) - MA =(OPf - MA + OP? ■ MA) • (OP2 - MA + ÖP2 • MA) + (OPV - MA + OP? • MA) - MA + (OP2 - MA + Ö ~ P2 - MA) - MA =
OPV - OP2 • MA + OPV • OP2 • MA + OPV • MA + OP2 • MA = OPV + OP2 • MA + (OPV • OP2 + OPV + OP2) • MA =OPV - OP2 • MA + OPV • OP2 • MA + OPV • MA + OP2 • MA = OPV + OP2 • MA + (OPV • OP2 + OPV + OP2) • MA =
OPV + OP2 • MA + (OPV + OP2) • MA =OPV + OP2 • MA + (OPV + OP2) • MA =
(OPV + OP2)Θ MA =(OPV + OP2) Θ MA =
OPV + OP2 Φ MA (20)OPV + OP2 Φ MA (20)
Es ist ersichtlich, dass dieses Zwischenergebnis ebenso ordnungsgemäß maskiert ist. Der Ausgangswert des nachfolgenden NOT Logikelements 31 ist zugleich das maskierte Resultat der erfindungsgemäßen digitalen Schaltung, welches mit dem gewünschten maskierten Resultat laut Gleichung (18) übereinstimmt:It can be seen that this intermediate result is also properly masked. The output value of the subsequent NOT logic element 31 is at the same time the masked result of the digital circuit according to the invention, which coincides with the desired masked result according to equation (18):
REMA = MAJ(OPVMA , OP2MA , MA) = X30m = OPV + OP2 θ MA = (OPV + OP2) ® MA (21) Weiters ergibt sich der Ausgangswert des IMAJ Logikelements 32 zu:
X32m = IMAJ(0RMA.0P2MA.MA) = 0Py MA - OP2 ^ + OPV ^ - MA + OP2 ^ - MA = (OPV Θ MA ) • (ÖP2 Θ MA) + (OPV Θ MA) • MA + (Ö~P2 Θ MA ) • MA =RE MA = MAJ (OPV MA , OP2 MA , MA) = X30 m = OPV + OP2 θ MA = (OPV + OP2) ® MA (21) Further, the output value of the IMAJ logic element 32 is: X32 m = IMAJ (0RMA.0P2MA.MA) = 0Py MA - OP 2 ^ + OPV ^ - MA + OP 2 ^ - MA = (OPV Θ MA) • (ÖP2 Θ MA) + (OPV Θ MA) • MA + (Ö ~ P2 Θ MA) • MA =
(OPV • MA + OPf • MA) • (0P2 • MA + 0P2 • MA) + (OPf • MA + OPV ■ MA) ■ MA + (0P2 • MA + 0P2 • MA) • MA = OPV ■ ÖP2 • MA + O PV ■ O P 2 ■ M A + O P 1 • M A + O P 2 ■ M A =(OPV • MA + OPf • MA) • (0P2 • MA + 0P2 • MA) + (OPf • MA + OPV ■ MA) ■ MA + (0P2 • MA + 0P2 • MA) • MA = OPV ■ PT2 • MA + O PV ■ OP 2 ■ MA + OP 1 • MA + OP 2 ■ MA =
OP-/ + 0P2 • MA + (OPV • 0P2 + 0P1 + 0P2) • MA =OP- / + 0P2 • MA + (OPV • 0P2 + 0P1 + 0P2) • MA =
0P1 + 0P2 • MA + (OPV + 0P2) • MA =0P1 + 0P2 • MA + (OPV + 0P2) • MA =
0P1 + 0P2 θ MA =0P1 + 0P2 θ MA =
(OPV + 0P2) θ MA (22)(OPV + 0P2) θ MA (22)
Es ist ersichtlich, dass dieses Zwischenergebnis auch ordnungsgemäß maskiert ist. DerIt can be seen that this intermediate result is also properly masked. Of the
Ausgangswert des nachfolgenden NOT Logikelements 33 ist zugleich das invertierte, maskierte Resultat der erfindungsgemäßen digitalen Schaltung, welches mit dem gewünschten maskierten Resultat laut Gleichung (19) übereinstimmt:Output value of the subsequent NOT logic element 33 is at the same time the inverted, masked result of the digital circuit according to the invention, which coincides with the desired masked result according to equation (19):
REMA = MAJ(OPVMA ■ OP2MA , MA) = X32m = (OPV + 0P2) θ MA = OPV + 0P2 θ MA (23) Es sei noch einmal darauf hingewiesen, dass auch hier alle in der Implementierung der digitalen Schaltung auftretenden Zwischenergebnisse nur in entsprechend maskierter Form auftreten, wodurch Seitenkanalattacken weitgehend verhindert werden. In der sich mit der Auswertephase abwechselnden Vorladephase werden vorgegebene Vorladewerte an die Eingänge der erfindungsgemäßen digitalen Schaltung (Operanden und Maskierungsparameter) angelegt. Dabei ist darauf zu achten, dass die Eingänge je eines einstufigen Logikelements auf denselben Vorladewert gesetzt werden. Dies ist wie bereits beschrieben eine der Maßnahmen die nötig sind, um das Auftreten von „Glitches zu verhindern. Im vorliegenden Fall betrifft das jeweils die Eingänge der beiden IMAJ Logikelemente 30 und 32. Insbesondere ist diese Bedingung dann erfüllt, wenn alle Eingänge der digitalen Schaltung während der Vorladephase auf denselben Vorladewert gesetzt werden. Für die beiden NOT Logikelemente 31 und 33 ist obige Bedingung immer erfüllt, da sie nur einen Eingang besitzen. Es sei auch hier darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen Schaltung der gleiche Vorladewert O angelegt wird, sich auch an den Ausgängen der Schaltung der Vorladewert O ergibt.REMA = MAJ (OPVMA ■ OP2MA, MA) = X32 m = (OPV + 0P2) θ MA = OPV + 0P2 θ MA (23) It should be pointed out once again that all intermediate results occurring in the implementation of the digital circuit are only occur in accordance masked form, which side channel attacks are largely prevented. In the precharge phase alternating with the evaluation phase, predetermined precharge values are applied to the inputs of the digital circuit according to the invention (operands and masking parameters). Care must be taken that the inputs of a single-level logic element are set to the same pre-load value. As already described, this is one of the measures necessary to prevent the occurrence of glitches. In the present case, this applies in each case to the inputs of the two IMAJ logic elements 30 and 32. In particular, this condition is fulfilled when all inputs of the digital circuit are set to the same precharge value during the precharge phase. For the two NOT logic elements 31 and 33, the above condition is always met, since they have only one input. It should also be noted that if the same Vorladewert O is applied during the precharge phase to all inputs of the digital circuit, the Vorladewert O also results at the outputs of the circuit.
Die IMAJ Logikfunktion und die NOT Logikfunktion sind beides negativ monotone Logikfunktionen. Damit ist die Anforderung an eine erfindungsgemäße digitale Schaltung erfüllt, welche besagt, dass nur einstufige Logikelemente mit positiv oder negativ monotoner Funktion verwendet werden dürfen. Zusammen mit der Forderung, dass die Eingänge je eines einstufigen Logikelements während der Vorladephase auf denselben Vorladewert gesetzt werden müssen, stellt diese Bedingung bezüglich der verwendeten Logikfunktionen sicher, dass in der erfindungsgemäßen digitalen Schaltung keine
„Glitches" auftreten. Treten nun beim Übergang von der Vorladephase in die Auswertephase bzw. umgekehrt auch an den Eingängen der digitalen Schaltung keine „Glitches" auf, d.h. ein Eingangssignal ändert seinen Wert ausgehend vom aktuellen Wert höchstens einmal, dann treten in der digitalen Schaltung selbst und somit an ihren Ausgängen auch keine „Glitches" auf. Die Resultate an den Ausgängen der Schaltung können somit wiederum als Eingangssignale für andere erfindungsgemäße digitale Schaltungen verwendet werden.The IMAJ logic function and the NOT logic function are both negative monotone logic functions. Thus, the requirement for a digital circuit according to the invention is fulfilled, which states that only one-level logic elements with positive or negative monotonic function may be used. Together with the requirement that the inputs of each one-stage logic element must be set to the same precharge value during the precharge phase, this condition ensures with respect to the logic functions used that no If there are no "glitches" at the transition from the pre-charge phase to the evaluation phase, or vice versa, also at the inputs of the digital circuit, ie an input signal changes its value from the current value at most once, then in the digital circuit and thus at their outputs also no "glitches." The results at the outputs of the circuit can thus in turn be used as input signals for other digital circuits according to the invention.
- Fig. 5 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation eine NOR Operation ausführt. Als Maskierungsverfahren für die Operanden OP 7 und OP2 an den Eingängen der Schaltung und auch für das Resultat RE an den Ausgängen der Schaltung wird wiederum eine bitweise XOR Verknüpfung mit dem Maskierungsparameter MA eingesetzt. Die maskierten Operanden bzw. die invertierten, maskierten Operanden an den Eingängen und das maskierte Resultat bzw. das invertierte, maskierte Resultat an den Ausgängen der digitalen Schaltung stehen in dem in den Gleichungen (1) bis (6) beschriebenen Zusammenhang.FIG. 5 shows the implementation of a digital circuit 1 according to the invention which performs a NOR operation as arithmetic operation. As a masking method for the operands OP 7 and OP2 at the inputs of the circuit and also for the result RE at the outputs of the circuit, a bitwise XOR operation with the masking parameter MA is again used. The masked operands or the inverted, masked operands at the inputs and the masked result or the inverted, masked result at the outputs of the digital circuit are in the relationship described in equations (1) to (6).
Die durchzuführende Rechenoperation ist hier eine NOR Operation, welche zum einen maskiert und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (24) und (25) dargestellt.The arithmetic operation to be performed here is a NOR operation, which must be masked on the one hand and inverted and masked on the other hand. The required results of this arithmetic operation are shown in equations (24) and (25).
REMA = OPf + OP2 θ MA (24)RE MA = OPf + OP2 θ MA (24)
REMA = (OP1 + OP2) θ MA (25) Die Implementierung der digitalen Schaltung in Fig. 5 ist beinahe identisch mit der inREMA = (OP1 + OP2) θ MA (25) The implementation of the digital circuit in Fig. 5 is almost identical to that in Figs
Fig. 4 gezeigten Schaltung, lediglich die beiden Ausgangssignale für REMA und RE MA sind vertauscht. Das heißt, in der Auswertephase ergibt sich für das maskierte Resultat REMA der digitalen Schaltung in Fig. 5 ein Wert entsprechend Gleichung (23):Fig. 4 circuit shown, only the two output signals for RE M A and RE M A are reversed. That is to say, in the evaluation phase, the masked result RE MA of the digital circuit in FIG. 5 results in a value corresponding to equation (23):
REMA = MAJ(OP7MA , OP2MA - MA) = OP1 + OP2 θ MA (26) Der Wert stimmt mit dem gewünschten maskierten Resultat laut Gleichung (24) überein.RE MA = MAJ (OP7 MA , OP2MA-MA) = OP1 + OP2 θ MA (26) The value agrees with the desired masked result according to equation (24).
Für das invertierte, maskierte Resultat RE MA der digitalen Schaltung in Fig. 5 ergibt sich ein Wert entsprechend Gleichung (21):For the inverted, masked result RE MA of the digital circuit in FIG. 5, a value corresponding to equation (21) results:
REMA = MAJ(OPf MA , OP2MA , MA) = (OP1 + OP2) φ MA (27)REMA = MAJ (OPf MA, OP2 MA, MA) = (OP1 + OP2) MA φ (27)
Der Wert stimmt mit dem gewünschten Resultat laut Gleichung (25) überein. Da die digitale Schaltung in Fig. 5 gegenüber der Schaltung in Fig. 4 nur minimal geändert wurde gelten die dortigen Überlegungen bezüglich der Maskierung von Zwischenergebnissen, der Vorladephase, der monotonen Logikfunktionen und der „Glitches" in entsprechender Form auch hier. Es sei auch hier noch darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen Schaltung der
gleiche Vorladewert 0 angelegt wird, sich auch an den Ausgängen der Schaltung der Vorladewert 0 ergibt.The value agrees with the desired result according to equation (25). Since the digital circuit in Fig. 5 has only been minimally changed compared to the circuit in Fig. 4, the considerations there regarding the masking of intermediate results, the precharge phase, the monotone logic functions and the "glitches" in corresponding form apply here as well It should be noted that if during the precharge phase to all inputs of the digital circuit of the equal precharge value 0 is applied, also results in the outputs of the circuit, the preload 0.
- Fig. 6 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation eine XOR Operation ausführt. Als Maskierungsverfahren für die Operanden OP 7 und OP2 an den Eingängen der Schaltung und auch für das Resultat RE an den Ausgängen der Schaltung wird wiederum eine bitweise XOR Verknüpfung mit dem Maskierungsparameter MA eingesetzt. Die maskierten Operanden bzw. die invertierten, maskierten Operanden an den Eingängen und das maskierte Resultat bzw. das invertierte, maskierte Resultat an den Ausgängen der digitalen Schaltung stehen in dem in den Gleichungen (1) bis (6) beschriebenen Zusammenhang.FIG. 6 shows the implementation of a digital circuit 1 according to the invention which performs an XOR operation as arithmetic operation. As a masking method for the operands OP 7 and OP2 at the inputs of the circuit and also for the result RE at the outputs of the circuit, a bitwise XOR operation with the masking parameter MA is again used. The masked operands or the inverted, masked operands at the inputs and the masked result or the inverted, masked result at the outputs of the digital circuit are in the relationship described in equations (1) to (6).
Während der Auswertephase liegen die maskierten Operanden, die invertierten, maskierten Operanden, der Maskierungsparameter und der invertierte Maskierungsparameter an den Eingängen der digitalen Schaltung an. Die durchzuführende Rechenoperation ist eine XOR Operation, welche zum einen maskiert und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (28) und (29) dargestellt.During the evaluation phase, the masked operands, the inverted masked operands, the masking parameter and the inverted masking parameter are applied to the inputs of the digital circuit. The arithmetic operation to be performed is an XOR operation which has to be masked on the one hand and inverted and masked on the other hand. The required results of this arithmetic operation are shown in equations (28) and (29).
Die Durchführung der Rechenoperation muss ausschließlich mit maskierten Datenwerten erfolgen, um gegen Seitenkanalattacken geschützt zu sein. In der Implementierung werden nun bereits erfindungsgemäße digitale Schaltungen nach Fig. 3 verwendet, welche eine maskierte NAND Operation und eine invertierte, maskierte NAND Operation gemäß Gleichungen (14) und (15) realisieren. Die Ausgangswerte des maskierten NAND-Elements 50 ergeben sich nun zu:The arithmetic operation must be carried out exclusively with masked data values in order to be protected against side channel attacks. In the implementation, digital circuits according to the invention of FIG. 3 are already used, which realize a masked NAND operation and an inverted, masked NAND operation according to equations (14) and (15). The output values of the masked NAND element 50 now result in:
X50m = X50 θ MA = OP1 ■ OP2 ® MA (30)X50 m = X50 θ MA = OP1 ■ OP2®MA (30)
X5Öm = X5Ö ® MA = (OP? • ÖP2) θ MA (31) Es ist ersichtlich, dass diese Zwischenergebnisse ordnungsgemäß maskiert sind. Die Ausgangswerte des maskierten NAND-Elements 51 ergeben sich zu:X5Ö m = X5Ö ® MA = (OP? • ÖP2)? MA (31) It can be seen that these intermediate results are properly masked. The output values of the masked NAND element 51 result in:
X51m = X51 θ MA = OP1 ■ OP2 θ MA (32)X51 m = X51 θ MA = OP1 ■ OP2 θ MA (32)
X5Ϊm = X5Ϊ θ MA = (ÖPΪ • OP2) θ MA (33)X5Ϊ m = X5Ϊ θ MA = (ÖPΪ • OP2) θ MA (33)
Es ist ersichtlich, dass auch diese Zwischenergebnisse ordnungsgemäß maskiert sind. Die Ausgangswerte des nachfolgenden maskierten NAND-Elements 52 sind zugleich die maskierten Resultate der erfindungsgemäßen digitalen Schaltung:
RE -MMAA = X50 ■ X51 ® MA = OP1 • OP2 ■ OP1 ■ OP2 Θ MA =It can be seen that these intermediate results are also properly masked. The output values of the subsequent masked NAND element 52 are at the same time the masked results of the digital circuit according to the invention: RE - M MA A = X50 ■ X51 ® MA = OP1 • OP2 ■ OP1 ■ OP2 Θ MA =
(OP1 ■ OP2 + OP1 • OP2) θ MA = (OP1 ® OP2) θ MA (34)(OP1 ■ OP2 + OP1 • OP2) θ MA = (OP1 ® OP2) θ MA (34)
REMA = (X50 • X51) ® MA = (OPf • OP2 • OPI ■ OP2) © MA =REMA = (X50 • X51) ® MA = (OPf • OP2 • OPI ■ OP2) © MA =
[(OP? + OP2) • (OP1 + Ö~P2)]@ MA = (OP? • ÖP2 + OPf • 0P2) φ MA = OP7 Θ OP2 Φ MA (35)[(OP? + OP2)] (OP1 + Ö ~ P2)] @ MA = (OP? • ÖP2 + OPf? 0P2)? MA = OP7? OP2? MA (35)
Die durch die digitale Schaltung berechneten maskierten Resultate gemäß den Gleichungen (34) und (35) stimmen mit den gewünschten maskierten Resultaten gemäß den Gleichungen (28) und (29) überein. Es sei darauf hingewiesen dass auch hier alle in der Implementierung der digitalen Schaltung auftretenden Zwischenergebnisse, inklusive der Zwischenergebnisse in den maskierten NAND-Elementen 50, 51 und 52, nur in entsprechend maskierter Form auftreten, wodurch Seitenkanalattacken weitgehend verhindert werden. Die Überlegungen zu den erfindungsgemäßen digitalen Schaltungen in Fig. 2 bis Fig. 5 bezüglich der Vorladephase, der monotonen Logikfunktionen und der „Glitches" gelten in entsprechender Form auch hier. Bezüglich der Vorladephase sei noch darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen Schaltung der gleiche Vorladewert 0 angelegt wird sich an den Eingängen aller einstufigen Logikelemente für jeweils ein Logikelement der gleiche Vorladewerte einstellt und dass sich auch an den Ausgängen der Schaltung der Vorladewert 0 ergibt.The masked results calculated by the digital circuit according to equations (34) and (35) are consistent with the desired masked results according to equations (28) and (29). It should be noted that here too all interim results occurring in the implementation of the digital circuit, including the intermediate results in the masked NAND elements 50, 51 and 52, occur only in a correspondingly masked form, whereby side channel attacks are largely prevented. The considerations regarding the digital circuits according to the invention in Fig. 2 to Fig. 5 with respect to the precharge phase, the monotonic logic functions and the "glitches" apply here as well the same precharge value 0 is applied to the digital circuit is set at the inputs of all single-level logic elements for each logic element of the same Vorladewerte and that also results in the outputs of the circuit, the preload value 0.
- Fig. 7 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation eine XNOR Operation ausführt. Als Maskierungsverfahren für die Operanden OP 1 und 0P2 an den Eingängen der Schaltung und auch für das Resultat RE an den Ausgängen der Schaltung wird wiederum eine bitweise XOR Verknüpfung mit dem Maskierungsparameter MA eingesetzt. Die maskierten Operanden bzw. die invertierten, maskierten Operanden an den Eingängen und das maskierte Resultat bzw. das invertierte, maskierte Resultat an den Ausgängen der digitalen Schaltung stehen in dem in den Gleichungen (1) bis (6) beschriebenen Zusammenhang. Die durchzuführende Rechenoperation ist hier eine XNOR Operation, welche zum einen maskiert und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (36) und (37) dargestellt.FIG. 7 shows the implementation of a digital circuit 1 according to the invention which performs an XNOR operation as arithmetic operation. As a masking method for the operands OP 1 and 0P2 at the inputs of the circuit and also for the result RE at the outputs of the circuit, a bitwise XOR operation with the masking parameter MA is again used. The masked operands or the inverted, masked operands at the inputs and the masked result or the inverted, masked result at the outputs of the digital circuit are in the relationship described in equations (1) to (6). The arithmetic operation to be performed here is an XNOR operation, which must be masked on the one hand and inverted and masked on the other hand. The required results of this arithmetic operation are shown in equations (36) and (37).
Die Implementierung der digitalen Schaltung in Fig. 7 ist beinahe identisch mit der in Fig. 6 gezeigten Schaltung, lediglich die beiden Ausgangssignale für REMA und RE MA sind vertauscht. Das heißt, in der Auswertephase ergibt sich für das maskierte Resultat REMA der digitalen Schaltung in Fig. 7 ein Wert entsprechend Gleichung (35):
REMA = OP1 Θ OP2 Θ MA (38)The implementation of the digital circuit in Fig. 7 is almost identical to the circuit shown in Fig. 6, except that the two output signals for RE MA and RE MA are reversed. That is to say, in the evaluation phase, the masked result REMA of the digital circuit in FIG. 7 results in a value according to equation (35): RE MA = OP1 Θ OP2 Θ MA (38)
Der Wert stimmt mit dem gewünschten maskierten Resultat laut Gleichung (36) überein.The value agrees with the desired masked result according to equation (36).
Für das invertierte, maskierte Resultat RE MA der digitalen Schaltung in Fig. 7 ergibt sich ein Wert entsprechend Gleichung (34):
For the inverted, masked result RE M A of the digital circuit in FIG. 7, a value corresponding to equation (34) results:
Der Wert stimmt mit dem gewünschten Resultat laut Gleichung (37) überein. Da die digitale Schaltung in Fig. 7 gegenüber der Schaltung in Fig. 6 nur minimal geändert wurde gelten die dortigen Überlegungen bezüglich der Maskierung von Zwischenergebnissen, der Vorladephase, der monotonen Logikfunktionen und der „Glitches" in entsprechender Form auch hier. Es sei auch hier noch darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen Schaltung der gleiche Vorladewert 0 angelegt wird, sich auch an den Ausgängen der Schaltung der Vorladewert 0 ergibt.The value agrees with the desired result according to equation (37). Since the digital circuit in Fig. 7 has only been minimally changed compared with the circuit in Fig. 6, the considerations there regarding the masking of intermediate results, the precharge phase, the monotone logic functions and the "glitches" in corresponding form apply here as well It should also be pointed out that if the same precharge value 0 is applied to all inputs of the digital circuit during the precharge phase, the precharge value 0 will also result at the outputs of the circuit.
- Fig. 8 zeigt die Implementierung einer erfindungsgemäßen digitalen Schaltung 1 die als Rechenoperation einen Wechsel der Maske eines Operanden vornimmt. AlsFIG. 8 shows the implementation of a digital circuit 1 according to the invention which performs a change of the mask of an operand as arithmetic operation. When
Maskierungsverfahren für den Operanden OP am Eingang bzw. am Ausgang der digitalenMasking method for the operand OP at the input or at the output of the digital
Schaltung wird eine bitweise XOR Verknüpfung mit dem Maskierungsparameter MA7 bzw. MA2 eingesetzt. Der maskierte Operand bzw. der invertierte, maskierte Operand an den Eingängen und der maskierte Operand bzw. der invertierte, maskierte Operand an den Ausgängen der digitalen Schaltung stehen in dem wie in den Gleichungen (40) undCircuit is a bitwise XOR relationship with the masking parameters MA7 or MA2 used. The masked operand and the inverted masked operand at the inputs and the masked operand and the inverted masked operand at the outputs of the digital circuit, respectively, are as in Equations (40) and
(41) beschriebenen Zusammenhang.(41).
OPMA? = OP θ MA1 (40)OP MA? = OP θ MA1 (40)
OPMA2 = OP θ MA2 (41) OP MA 2 = OP θ MA 2 (41)
Während der Auswertephase liegen der maskierte Operand, der invertierte, maskierte Operand, ein Maskierungsparameter der der XOR Verknüpfung von MA-/ und MA2 entspricht und der invertierte Maskierungsparameter an den Eingängen der digitalen Schaltung an. Die durchzuführende Rechenoperation ist ein Wechsel der Maske des Operanden, welche zum einen maskiert und zum anderen invertiert und maskiert erfolgen muss. Die geforderten Resultate dieser Rechenoperation sind in den Gleichungen (42) und (43) dargestellt.During the evaluation phase, the masked operand, the inverted masked operand, a masking parameter corresponding to the XOR combination of MA- and MA2 and the inverted masking parameter are applied to the inputs of the digital circuit. The arithmetic operation to be performed is a change of the mask of the operand, which must be masked on the one hand and inverted and masked on the other hand. The required results of this arithmetic operation are shown in equations (42) and (43).
Die Durchführung der Rechenoperation muss ausschließlich mit maskierten Datenwerten erfolgen, um gegen Seitenkanalattacken geschützt zu sein. In der Implementierung wird unter anderem eine erfindungsgemäße digitale Schaltung nach Fig. 3 verwendet, welche
eine maskierte NAND Operation und eine invertierte, maskierte NAND Operation gemäß Gleichungen (14) und (15) realisiert.The arithmetic operation must be carried out exclusively with masked data values in order to be protected against side channel attacks. In the implementation, inter alia, a digital circuit according to the invention according to FIG. 3 is used, which realized a masked NAND operation and an inverted, masked NAND operation according to equations (14) and (15).
Die Ausgangswerte des NOR Logikelements 70 und des nachfolgenden NOT Logikelements 71 ergeben sich nun zu:The output values of the NOR logic element 70 and the subsequent NOT logic element 71 now result in:
X70MAΪιMA2 = OPMA, + MAV θ MA2 = (OP θ MAV) + (MAV Φ MA2) =X70 MAΪιMA2 = OP MA , + MAV θ MA2 = (OP θ MAV) + (MAV Φ MA2) =
OP • MAV + OP ■ MAV + MAV • MA2 + MAV • MA2 (44)OP • MAV + OP ■ MAV + MAV • MA2 + MAV • MA2 (44)
X71mmA2 = X70mim2 = OP • MAV + OP • MAV + MAV • MA2 + MAV ■ MA2 (45)X71 mmA2 = X70 mim2 = OP • MAV + OP • MAV + MAV • MA2 + MAV ■ MA2 (45)
Die Ausgangswerte des NAND Logikelements 72 und des nachfolgenden NOT Logikelements 73 ergeben sich zu:The output values of the NAND logic element 72 and the subsequent NOT logic element 73 result in:
X72M/UMA2 = OPMAV ■ (MAV θ MA2) = (OP θ MAV) ■ (MAV φ MA2) =X72 M / UMA2 = OPMAV ■ (MAV θ MA2) = (OP θ MAV) ■ (MAV φ MA2) =
(OP • MAV + OP • MAV) • (MAV • MA2 + MAV • MA2) =(OP • MAV + OP • MAV) • (MAV • MA2 + MAV • MA2) =
OP • MÄ7- MA2 + OP - MAV - MAl? (46)OP • MÄ7- MA2 + OP - MAV - MAl? (46)
X73MA?MA2 = X72MA,,MA2 = OP • MAV - MA2 + OP • MAV • MA2 (47)X73 MA? MA2 = X72 MA ,, MA2 = OP • MAV - MA2 + OP • MAV • MA2 (47)
Die Ausgangswerte des NAND Logikelements 74 und des nachfolgenden NOT Logikelements 75 ergeben sich zu:The output values of the NAND logic element 74 and the subsequent NOT logic element 75 result in:
X74MA,ιMA2 = OPMA? • MAV ® MA2 = (OP Φ MAV) • (MAV φ MA2) =X74 MA , ιMA2 = OPMA? • MAV ® MA2 = (OP Φ MAV) • (MAV φ MA2) =
(OP ■ MAV + OP • MAV) • (MAV ■ MA2 + MAV • MA2) =(OP ■ MAV + OP • MAV) • (MAV ■ MA2 + MAV • MA2) =
OP • MAV • MA2 + OP • MAV ■ MA2 (48)OP • MAV • MA2 + OP • MAV ■ MA2 (48)
X75MA7,MA2 = X7ΛIAWA2 = OP ■ MAV • MA2 + OP ■ MAV • MA2 (49)X75 MA7 , MA2 = X7Λ IAWA2 = OP ■ MAV • MA2 + OP ■ MAV • MA2 (49)
Und die Ausgangswerte des NOR Logikelements 76 und des nachfolgenden NOT Logikelements 77 ergeben sich nun zu:And the output values of the NOR logic element 76 and the subsequent NOT logic element 77 now result in:
X76MM ιMA2 = 0PMA, + (MAV Φ MA2) = (OP Φ MAV) + (MAV Φ MA2) =X76 MM ιMA2 = 0P MA , + (MAV Φ MA2) = (OP Φ MAV) + (MAV Φ MA2) =
OP ■ MAV + OP • MAV + MAV • MA2 + MAV • MA2 (50)OP ■ MAV + OP • MAV + MAV • MA2 + MAV • MA2 (50)
X77MAy MA2 = X76MA) MA2 = OP • MAV + OP • MAV + MAV • MA2 + MAV • MA2 (5V) Die Zwischenergebnisse X70MA7,MA2 bis X77MAy,MA2 sind wiederum ordnungsgemäß maskiert, da sie statistisch unabhängig von den entsprechenden unmaskierten Werten sind. Die Ausgangswerte des nachfolgenden maskierten NAND-Elements 78 sind zugleich die maskierten Resultate der erfindungsgemäßen digitalen Schaltung:
OPMA2 = MAJ(X73MA,,MA2, X77MA,,MA2,MAf θ MA2) =X77 MAy MA2 = X76 MA) MA2 = OP MAV + OP MAV + MAV MA2 + MAV MA2 (5V) The intermediate results X70 M A7, MA2 to X77 MA y, MA2 are again properly masked since they are statistically independent of corresponding unmasked values. The output values of the subsequent masked NAND element 78 are at the same time the masked results of the digital circuit according to the invention: OP MA2 = MAJ (X73 MA ,, MA2 , X77 MA ,, MA2 , MAf θ MA2) =
(OP•MAf•MA2+OP•MAf•MA2)•(OP•MAf+OP•MAf+MAf•MA2+MAf•MA2)+ (OP•MAf•MA2+OP•MAf•MÄ2)•(MAf•MÄ2+MAf•MA2)+ (OP-i^+Ö^-MAf+MAf-M^+MÄf-MA2)-(MÄf-MA2+MAf-MA2) = Ö^-MÄTMA2+OP-MAf-JV^+OP-MAf-MA2+ÖP-MAf-MA2 =(OP • MAf • MA2 + OP • MAf • MA2) • (OP • MAf + OP • MAf + MAf • MA2 + MAf • MA2) + (OP • MAf • MA2 + OP • MAf • MÄ2) • (MAf • MÄ2 + MAf • MA2) + (OP-i ^ + Ö ^ -MAf + MAf-M ^ + MAE-MA2) - (MAE-MA2 + MAf-MA2) = Ö ^ -MÄTMA2 + OP-MAf-JV ^ + OP -MAf-MA2 + ÖP-MAf-MA2 =
OP•MA2+OP•MA2 = OPθMA2 (52)OP • MA2 + OP • MA2 = OPθMA2 (52)
OPMA2 = MAJ(X7f MArMA2 , X75MA,iMA2 , MAf θ MA2) =OPMA 2 = MAJ (x7F MArMA2, X75 MA, IMA2, MAf θ MA2) =
(OP -J^ + Ö^- MAf + J^ - Λ^ + MAf - MA2) - (Ö^-i^. MÄ2 + OP - MAf - MA2) +(OP-J ^ + Ö ^ - MAf + J ^ - Λ ^ + MAf - MA2) - (Ö ^ -i ^. MÄ2 + OP - MAf - MA2) +
(OP • MAf + OP • MAf + MAf • MÄ2 + MAf • MA2) • (MAf • MÄ2 + MAf • MA2) +(OP • MAf + OP • MAf + MAf • MA2 + MAf • MA2) • (MAf • MA2 + MAf • MA2) +
(OP ■ MAf • MÄ2 + OP • MAf • MA2) • (MAf • MÄ2 + MAf • MA2) =(OP ■ MAf • MA2 + OP • MAf • MA2) • (MAf • MA2 + MAf • MA2) =
OP -MAf -MA2 + OP - MAf - MA2 + OP - MAf -MA2 + OP -MAf -MA2 =OP -MAf -MA2 + OP - MAf - MA2 + OP - MAf -MA2 + OP -MAf -MA2 =
OP - MA2 + OP - MA2 = OP ® MA2 = OP Θ MA2 (53)OP - MA2 + OP - MA2 = OP ® MA2 = OP Θ MA2 (53)
Die durch die digitale Schaltung berechneten maskierten Resultate gemäß den Gleichungen (52) und (53) stimmen mit den gewünschten maskierten Resultaten gemäß den Gleichungen (42) und (43) überein. Es sei noch einmal darauf hingewiesen dass auch hier alle in der Implementierung der digitalen Schaltung auftretenden Zwischenergebnisse, inklusive der Zwischenergebnisse im maskierten NAND-Element 78, nur in entsprechend maskierter Form auftreten, wodurch Seitenkanalattacken weitgehend verhindert werden. In der sich mit der Auswertephase abwechselnden Vorladephase werden vorgegebene Vorladewerte an die Eingänge der erfindungsgemäßen digitalen Schaltung (Operand und Maskierungsparameter) angelegt. Dabei ist darauf zu achten, dass die Eingänge je eines einstufigen Logikelements auf denselben Vorladewert gesetzt werden. Dies ist wie bereits beschrieben eine der Maßnahmen die nötig sind, um das Auftreten von „Glitches zu verhindern. Im vorliegenden Fall betrifft das jeweils die Eingänge der beiden NOR Logikelemente 70 und 76, die Eingänge der beiden NAND Logikelemente 72 und 74 und die Eingänge des maskierten NAND-Elements 78. Insbesondere ist diese Bedingung dann erfüllt, wenn alle Eingänge der digitalen Schaltung während der Vorladephase auf denselben Vorladewert gesetzt werden. Für die vier NOT Logikelemente 71 , 73, 75 und 77 ist obige Bedingung immer erfüllt, da sie nur einen Eingang besitzen. Es sei auch hier darauf hingewiesen, dass wenn während der Vorladephase an alle Eingänge der digitalen
Schaltung der gleiche Vorladewert 0 angelegt wird, sich auch an den Ausgängen der Schaltung der Vorladewert 0 ergibt.The masked results calculated by the digital circuit according to equations (52) and (53) are consistent with the desired masked results according to equations (42) and (43). It should be pointed out once again that all interim results occurring in the implementation of the digital circuit, including the intermediate results in the masked NAND element 78, only occur in a correspondingly masked form, as a result of which side channel attacks are largely prevented. In the precharge phase alternating with the evaluation phase, predetermined precharge values are applied to the inputs of the digital circuit according to the invention (operand and masking parameter). Care must be taken that the inputs of a single-level logic element are set to the same pre-load value. As already described, this is one of the measures necessary to prevent the occurrence of glitches. In the present case, this concerns the respective inputs of the two NOR logic elements 70 and 76, the inputs of the two NAND logic elements 72 and 74 and the inputs of the masked NAND element 78. In particular, this condition is fulfilled when all inputs of the digital circuit during the Precharge phase to the same precharge value. For the four NOT logic elements 71, 73, 75 and 77, the above condition is always met, since they have only one input. It should also be noted that if during the precharge phase to all inputs of the digital When the same precharge value 0 is applied, the precharge value 0 is also produced at the outputs of the circuit.
Die NOR, die NAND und die NOT Logikfunktion sind negativ monotone Logikfunktionen. Wie in Fig. 3 ersichtlich, gilt dies auch für die Logikfunktionen im NAND Element 78. Damit ist die Anforderung an eine erfindungsgemäße digitale Schaltung erfüllt, welche besagt, dass nur einstufige Logikelemente mit positiv oder negativ monotoner Funktion verwendet werden dürfen. Zusammen mit der Forderung, dass die Eingänge je eines einstufigen Logikelements während der Vorladephase auf denselben Vorladewert gesetzt werden müssen, stellt diese Bedingung bezüglich der verwendeten Logikfunktionen sicher, dass in der erfindungsgemäßen digitalen Schaltung keine „Glitches" auftreten. Treten nun beim Übergang von der Vorladephase in die Auswertephase bzw. umgekehrt auch an den Eingängen der digitalen Schaltung keine „Glitches" auf, d.h. ein Eingangssignal ändert seinen Wert ausgehend vom aktuellen Wert höchstens einmal, dann treten in der digitalen Schaltung selbst und somit an ihren Ausgängen auch keine „Glitches" auf. Die Resultate an den Ausgängen der Schaltung können somit wiederum als Eingangssignale für andere erfindungsgemäße digitale Schaltungen verwendet werden.
The NOR, the NAND and the NOT logic function are negative monotone logic functions. As can be seen in FIG. 3, this also applies to the logic functions in the NAND element 78. This satisfies the requirement for a digital circuit according to the invention, which states that only single-level logic elements with a positive or negative monotonic function may be used. Together with the requirement that the inputs of a single-level logic element each have to be set to the same precharge value during the precharge phase, this condition ensures that no "glitches" occur in the digital circuit according to the invention in the evaluation phase or vice versa also at the inputs of the digital circuit no "glitches", ie An input signal changes its value from the current value at most once, so no "glitches" occur in the digital circuit itself and thus at its outputs, and the results at the outputs of the circuit can again be used as inputs to other digital circuits according to the invention ,