DE102004016412A1 - Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism - Google Patents

Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism Download PDF

Info

Publication number
DE102004016412A1
DE102004016412A1 DE200410016412 DE102004016412A DE102004016412A1 DE 102004016412 A1 DE102004016412 A1 DE 102004016412A1 DE 200410016412 DE200410016412 DE 200410016412 DE 102004016412 A DE102004016412 A DE 102004016412A DE 102004016412 A1 DE102004016412 A1 DE 102004016412A1
Authority
DE
Germany
Prior art keywords
calculation
calculated
look
value
main loop
Prior art date
Legal status (The legal status 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 status listed.)
Withdrawn
Application number
DE200410016412
Other languages
German (de)
Inventor
Rainer Dr. Blümel
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CV CRYPTOVISION GmbH
Original Assignee
CV CRYPTOVISION GmbH
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 CV CRYPTOVISION GmbH filed Critical CV CRYPTOVISION GmbH
Priority to DE200410016412 priority Critical patent/DE102004016412A1/en
Publication of DE102004016412A1 publication Critical patent/DE102004016412A1/en
Withdrawn legal-status Critical Current

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/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/722Modular multiplication

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • General Engineering & Computer Science (AREA)
  • Complex Calculations (AREA)

Abstract

Method for modular multiplication of long numbers of fixed bit-length spread across several bytes, whereby calculation of mixed terms is undertaken using bracket multiplication based on reduction to a prime element and use of a successive look ahead mechanism so that the bytes for the calculation are available at the correct time and with sufficient accuracy. The invention also relates to a corresponding device for method implementation.

Description

Für kryptographische Berechnungen, insbesondere für asymmetrische kryptographische Verfahren wie RSA, ECC (Kryptographie auf Basis elliptischer Kurven) und HECC (Kryptographie auf Basis hyperelliptischer Kurven), sind umfangreiche Berechnungen in einem endlichen Körper notwendig. Die Elemente im endlichen Körper werden dabei im Computer typischerweise als Bitfeld gespeichert, häufig gruppiert in Datenwörter einer zum Beispiel durch die Hardware vorgegebenen Länge (z.B. 8 oder 32 Bit). Die wesentlichen notwendigen Berechnungen sind modulare Multiplikationen der Werte, welche durch das Bitfeld repräsentiert wird. In der Praxis werden solche Berechnungen sowohl durch Umsetzungen geeigneter Verfahren in Software auf Universal-Mikroprozessoren als auch durch entsprechende, speziell für diesen Einsatzzweck optimierte Vorrichtungen wie kryptographische Koprozessoren durchgeführt [ DE 697 03 085 , DE 102 19 158 ]. Für übliche Anwendungen ist der Rechenaufwand für solche Multiplikationen entscheidend.For cryptographic computations, in particular for asymmetric cryptographic methods such as RSA, ECC (Elliptic Curve Cryptography) and HECC (Hyper Elliptic Curve Cryptography), extensive calculations in a finite field are necessary. The elements in the finite field are typically stored in the computer as a bit field, often grouped into data words of a length predetermined by the hardware, for example, 8 or 32 bits. The essential calculations required are modular multiplications of the values represented by the bit field. In practice, such calculations are carried out both by implementing suitable methods in software on general-purpose microprocessors and by means of suitable devices, such as cryptographic coprocessors, which have been optimized especially for this purpose [ DE 697 03 085 . DE 102 19 158 ]. For common applications, the computational cost of such multiplications is crucial.

Die Erfindung betrifft ein Verfahren zur Beschleunigung der modularen Multiplikation zweier Werte sowie eine Vorrichtung zur Durchführung dieses Verfahrens. Dieses Verfahren und entsprechende Vorrichtungen weisen in einer spezifischen Ausgestaltung insbesondere eine Resistenz gegen Seitenkanalangriffe auf, die für den praktischen Einsatz in kryptographischen Anwendungen von wesentlicher Bedeutung ist.The The invention relates to a method for accelerating the modular Multiplication of two values and a device for performing this Process. This method and corresponding devices have in a specific embodiment in particular a resistance against side channel attacks, which are for practical use in cryptographic applications is essential.

Die typischen Bitlängen der Werte für Berechnungen bei asymmetrischen kryptographischen Verfahren schwanken von der Größenordnung her meist in etwa zwischen 100 Bit und 2000 Bit. Für die modularen Multiplikationen können dabei entweder die Berechnungen in Multiplikation und Reduktion aufgespalten werden, oder man führt beide Operationen ineinander geschachtelt durch. In jedem Fall wird die Reduktion auf eine Multiplikation sowie einigen zusätzlichen Operationen zurückgeführt. Lediglich bei besonders strukturierten Primelementen als Modulus besteht die Reduktion nicht im Wesentlichen aus einer Multiplikation.The typical bit lengths the values for Calculations in asymmetric cryptographic methods vary of the order of magnitude mostly between 100 and 2000 bits. For the modular multiplications can doing either the calculations in multiplication and reduction be split or you lead both operations nested in one another. In any case, will the reduction to a multiplication as well as some additional ones Returned operations. Only in the case of particularly structured prime elements as modulus, the Reduction not essentially from a multiplication.

Im folgenden wird davon ausgegangen, dass die Werte durch Datenwörter repräsentiert werden. Ein 192 Bit langer Wert besteht dann zum Beispiel aus 6 Datenwörtern mit je 32 Bit oder auch aus 24 Datenwörtern mit je 8 Bit. Alle Berechnungen werden dann typischerweise auf Operationen zwischen Datenwörtern zurückgeführt.in the The following assumes that the values are represented by data words become. For example, a 192-bit value is 6 data words each with 32 bits or even 24 data words with 8 bits each. All calculations are then typically returned to operations between data words.

Im weiteren Text werden die zu multiplizierenden Werte allgemein als Langzahlen bezeichnet. Es handelt sich dabei immer um mathematische Elemente eines geeigneten endlichen Körpers, welche durch eine entsprechende Bitdarstellung repräsentiert wird. Wie allgemein üblich werden alle Operationen im mathematischen Körper durch entsprechende Berechnungen zwischen Datenwörtern realisiert.in the In further text, the values to be multiplied are generally considered Long numbers. These are always mathematical Elements of a suitable finite body, which by a corresponding Bit representation represents becomes. As usual All operations in the mathematical body are performed by appropriate calculations between data words realized.

Bestehen beide Multiplikanden aus jeweils n Datenwörtern, so beträgt der Rechenaufwand für eine Multiplikation bei den meisten etablierten Verfahren n2 Multiplikationen zwischen Datenwörtern. Für sehr große Langzahlen gibt es zwar Verfahren mit deutlich besseren asymptotischen Verhalten, jedoch haben sie einen recht großen zusätzlichen Berechnungsaufwand (Overhead) und werden daher für Multiplikationen bis zu einigen tausend Bit nur selten verwendet. Die einzige Ausnahme hiervon ist die Karatsuba-Multiplikation [Knuth1997].If both multiplicands each consist of n data words, the computational effort for a multiplication in most established methods is n 2 multiplications between data words. For very large numbers, although there are methods with much better asymptotic behavior, but they have quite a large additional computational effort (overhead) and are therefore rarely used for multiplications up to several thousand bits. The only exception to this is the Karatsuba multiplication [Knuth1997].

Das bei Bitlängen von etwa 100 bis 2000 Bit am häufigsten eingesetzte Verfahren für modulare Multiplikation ist die Montgomery-Multiplikation. Bei diesem Verfahren greifen Multiplikation und Reduktion eng ineinander, was die Anzahl der notwendigen Zugriffe auf Datenwörter klein hält. Zusätzlich ist die Montgomery-Multiplikation mit einem relativ geringen Verwaltungs-Overhead realisierbar. Ein Nachteil ist, dass theoretisch mögliche Vereinfachungen bei der Quadrierung zweier Langzahlen nicht ausgenutzt werden.The at bit lengths from about 100 to 2000 bits most often used methods for modular multiplication is the Montgomery multiplication. In this Methods interlock multiplication and reduction closely, which keeps the number of necessary accesses to data words small. In addition is Montgomery multiplication with a relatively low overhead of administration realizable. A disadvantage is that theoretically possible simplifications not be exploited in the squaring of two long numbers.

Eine Alternative ist die Standardmethode [Menezes1997] und eine anschließende Reduktion, etwa nach Barrett [Menezes1997]. Der Rechenaufwand entspricht recht genau dem der Montgomery-Multiplikation, die Montgomery-Multiplikation ist jedoch in den meisten Fällen einfacher zu realisieren.A Alternative is the standard method [Menezes1997] and a subsequent reduction, for example, according to Barrett [Menezes1997]. The computational effort is right just like the Montgomery multiplication, the Montgomery multiplication is, however, in most cases easier to realize.

Eine weitere Alternative besteht darin, eine Karatsuba-Multiplikation mit einer anschließenden Reduktion zu kombinieren. Die Karatsuba-Multipikation ist ein rekursives Verfahren; der asymptotische Aufwand beträgt etwa n1,58. Im Wesentlichen beruht das Verfahren darauf, die Multiplikation zweier aus 2 Datenwörtern bestehender Zahlen durch 3 Multiplikationen zwischen Datenwörtern zu realisieren. Bedeutendste Nachteile der Karatsuba-Multiplikation sind ein erhöhter Verwaltungsaufwand und eine Festlegung der Bitlängen derart, dass die Anzahl der Datenwörter eine Zweierpotenz sein muss.Another alternative is to combine a Karatsuba multiplication with a subsequent reduction. Karatsuba Multipoint is a recursive method; the asymptotic effort is about n 1.58 . Essentially, the method relies on realizing the multiplication of two numbers consisting of two data words by three multiplications between data words. The most significant disadvantages of the Karatsuba multiplication are an increased administrative effort and a determination of the bit lengths such that the number of data words must be a power of two.

Neben der Karatsuba-Multiplikation gibt es das sogenannte Multi-Segment-Karatsuba-Verfahren [Ernst2002]. Der Vorteil ist, dass man die Anzahl der Datenwörter nicht eine Zweierpotenz sein muss, also die Bitlängen nicht immer gleich verdoppelt werden müssen. Dafür ist das asymptotische Verhalten geringfügig schlechter. Für relativ kurze Bitlängen kann man beim Multi-Segment-Karatsuba-Verfahren auf die rekursive Struktur verzichten. Dann hat man zwar – im Vergleich zur Standardmethode – asymptotisch keinen Gewinn mehr, spart aber trotzdem fast die Hälfte der benötigten Multiplikationen.Next Karatsuba multiplication involves the so-called multi-segment Karatsuba method [Ernst2002]. The advantage is that the number of data words is not a power of two must be, so the bit lengths do not always have to be doubled. That's the asymptotic behavior slightly worse. For relative short bit lengths One can use the multi-segment Karatsuba method on the recursive structure without. Then you have though - im Comparison to the standard method - asymptotic no more profit, but still saves almost half of the required Multiplications.

Sowohl bei der Karatsuba-Multiplikation als auch beim Multi-Segment-Karatsuba-Verfahren können die Vorteile nur bei der eigentlichen Multiplikation und nicht bei der Reduktion genutzt werden. Des weiteren ist ein effizientes Zusammenspiel von Multiplikation und Reduktion, etwa um die Anzahl der notwendigen Zugriffe auf die verwendeten Datenwörter zu verringern, kaum möglich.Either in the Karatsuba multiplication as well as the multi-segment Karatsuba method can they Advantages only with the actual multiplication and not with the Reduction can be used. Furthermore, it is an efficient interaction of multiplication and reduction, about the number of necessary ones Reduce access to the data words used, hardly possible.

Als typische Beispiele für Verfahren und entsprechende Vorrichtungen zur Multiplikation von aus Datenwörtern aufgebauten Langzahlen gibt es also einerseits die Montgomery-Multiplikation, die relativ schlecht mit den Bitlänge der Langzahlen skaliert, bei der aber Multiplikationsschritte und Reduktionsschritte effektiv ineinandergreifen, andererseits die Karatsuba-Multiplikation, die wesentlich besser mit der Bitlänge der Langzahlen skaliert, bei der aber die Reduktion erst nach der Multiplikation stattfinden kann, und die einen relativ hohen Berechnungs-Overhead aufweist.When typical examples of Method and corresponding devices for multiplication of from data words Thus, on the one hand, there is the Montgomery multiplication, the relatively bad with the bit length the long numbers scaled, but in which multiplication steps and Effectively interlock reduction steps, on the other hand the Karatsuba multiplication, which is much better with the bit length of the Long numbers scale, but with the reduction only after multiplication can take place, and the a relatively high calculation overhead having.

Es stellt sich also die Aufgabe, wie man ein Verfahren beziehungsweise eine entsprechende Vorrichtung zur Multiplikation von aus Datenwörtern zusammengesetzten Langzahlen finden kann, mit der sich die Anzahl der benötigten Datenwort-Multiplikationen verringern kann, ohne den gewonnen Vorteil durch einen Verwaltungs-Overhead wieder zu verlieren. Es ist also wesentlich, dass das Verfahren als Ganzes deutlich effizienter realisierbar ist als die bisher eingesetzten Techniken. Dazu kommt wegen des möglichen Einsatzgebietes im Bereich der Kryptographie eine möglichst geringe Gefährdung durch Seitenkanalangriffe.It So, the task of how to set up a procedure, respectively a corresponding device for multiplying composed of data words Long numbers can be found with which the number of required data word multiplications can reduce, without the advantage gained by a management overhead to lose again. So it's essential that the procedure as a whole can be implemented much more efficiently than before used techniques. In addition comes because of the possible field of application in The area of cryptography one possible low risk through side channel attacks.

Diese Aufgabe wird durch die Erfindung gemäß der Patentansprüche 1 bis 12 gelöst.These The object is achieved by the invention according to the claims 1 to 12 solved.

Patentanspruch 1 beschreibt die Grundzüge des Verfahrens und der entsprechenden Vorrichtung. Bereits bei der Karatsuba-Multiplikation und beim Multi-Segment-Karatsuba-Verfahren ist es üblich, gemäß der Formel (xi + xj)(yi + yj)-(xiyi + xjyj) = (xjyi) + (xiyj) zwei Multiplikationen zu einer zusammenzufassen (da die Multiplikationen xiyj und xjyj nicht zusätzlich durchgeführt werden müssen) Eine Multiplikation von zwei Werten mit je 2 Datenwörtern lässt sich hiernach mit 3 anstatt den üblichen 4 Multiplikationen zwischen Datenwörten realisieren.Claim 1 describes the principles of the method and the corresponding device. Already in the Karatsuba multiplication and in the multi-segment Karatsuba method it is usual, according to the formula (x i + x j ) (y i + y j ) - (x i y i + x j y j ) = ( x j y i ) + (x i y j ) to combine two multiplications into one (since the multiplications x i y j and x j y j do not have to be carried out additionally) A multiplication of two values with two data words each can be explained later as 3 instead of implementing the usual 4 multiplications between data words.

Das erfindungsgemäße Verfahren berechnet nun die Multiplikation zweier Langzahlen, indem es ebenfalls bevorzugt für die gemischten Terme zwei Multiplikationen zu einer Multiplikation zusammenfasst. Überraschenderweise ist es aber möglich, dies in vorteilhafter Weise mit integrierten Reduktionsschritten zu verbinden, indem bereits während der Multiplikation näherungsweise die Werte zi für die Reduktion bestimmt werden. Die Zusammenfassung der Multiplikanden wird dabei nicht nur für die eigentliche Multiplikation, sondern auch für die Reduktion vorgenommen. Im Vergleich zur Standardmethode kommt man somit mit n(n+1)/2 Multiplikationen zwischen Datenwörtern statt n2 Datenwortmultiplikationen pro Multiplikation zwischen zwei Werten aus; man spart also fast die Hälfte der üblicherweise notwendigen Berechnungen. Allerdings muss der Datenwort-Multiplizierer – je nach Ausgestaltung – für Datenwörter mit etwas größerer Bitlänge geeignet sein.The method according to the invention now calculates the multiplication of two long numbers by also preferably combining two multiplications into one multiplication for the mixed terms. Surprisingly, however, it is possible to combine this advantageously with integrated reduction steps by already approximately determining the values z i for the reduction during the multiplication. The summary of the multiplicand is done not only for the actual multiplication, but also for the reduction. Thus, in comparison to the standard method, we obtain n (n + 1) / 2 multiplications between data words instead of n 2 data word multiplies per multiplication between two values; So you save almost half of the usually necessary calculations. However, the data word multiplier, depending on the configuration, must be suitable for data words with a slightly larger bit length.

Formelmäßig erhält man bei dem neuen Verfahren für die Multiplikation (ohne Reduktion) zweier Werte X ={xi|i=0, ..., n-1} und Y={yi|i=1, ..., n-1} mit je n Datenwörtern der Länge b folgende Darstellung:

Figure 00030001
In terms of formula, in the new method for multiplication (without reduction) two values X = {x i | i = 0,..., N-1} and Y = {y i | i = 1,..., N -1} with n data words of length b the following representation:
Figure 00030001

Das so erhaltene Produkt muss noch modular reduziert werden. Dies bedeutet, dass bei gegebenem Primelement P ein weiterer Wert Z bestimmt wird und damit XY – PZ berechnet wird; der Wert Z wird nach erfolgter Reduktion nicht weiter benötigt. Fasst man diese beiden Multiplikationen zusammen, so kann man dies formelmäßig folgendermaßen beschreiben:

Figure 00030002
The product thus obtained must still be modularly reduced. This means that given Prime element P a further value Z is determined and thus XY - PZ is calculated; the value Z is no longer needed after the reduction. If one summarizes these two multiplications, one can describe this in the following way:
Figure 00030002

Um gemäß dieser Formel XY korrekt zu reduzieren, müsste man zu Beginn der Berechnungen den eindeutigen Wert Z kennen, für den 0 <= XY – PZ < P gilt. Um dies zu umgehen, gibt es zwei verschiedene Wege:

  • • Man kann, ohne dass dies eine Änderung der Formel nach sich zieht, die Datenwortlänge der zi vergrößern. Dies führt praktisch dazu, dass man einen kleinen Fehler bei zi in der nächsten Runde, also mit zi-1, korrigieren kann.
  • • Man kann den möglichen Fehler bei der Bestimmung von zi so klein halten, dass bei dem Zwischenwert schlimmstenfalls eine Korrektur von +/-P, verschoben um ein oder mehrere Datenwörter, notwendig ist.
To correctly reduce XY according to this formula, one would have to know the unique value Z at the beginning of the calculations, for which 0 <= XY - PZ <P. To get around this, there are two different ways:
  • It is possible to increase the data word length of the z i without this entailing a change in the formula. In practice, this leads to correcting a small error at z i in the next round, ie with z i-1 .
  • • One can keep the possible error in the determination of z i so small that in the worst case, a correction of +/- P, shifted by one or more data words, is necessary at the intermediate value.

Patentanspruch 2 beschreibt nun eine vorteilhafte Ausgestaltung des Verfahren beziehungsweise einer entsprechenden Vorrichtung nach Anspruch 1, mit dem bei nur unwesentlichen Performance-Einbußen eine im wesentlichen aus XY – PZ bestehende Berechnung zur modularen Multiplikation von XY durchgeführt wird. Das Verfahren besteht aus einer Initialisierung, dem n-2-maligen Durchlaufen einer Hauptschleife und einer Abschluss-Schleife sowie einer Technik zur rekursiven Bestimmung von Datenwörtern zi, im Folgenden als Look-Ahead-Mechanismus bezeichnet. Die einzelnen Schritte des Verfahrens:
In einem Vorab-Schritt wird ein Speicherfeld A mit typischerweise 2n+1 Datenwörtern mit dem Wert 0 initialisiert:
A = 0.

  • 1. In einem Initialisierungsschritt wird über den erwähnten Look-Ahead-Mechanismus zuerst ein Wert zn-1 berechnet und damit die Berechnungsschritte zum Durchlauf i=n-1 durchgeführt (b sei die Datenwortlänge):
    Figure 00040001
    Man beachte, dass Schritt(e) an beliebiger Stelle durchgeführt werden kann.
  • 2. Eine Hauptschleife wird für mit dem Schleifenparameter i, der die Werte i=n-1, ..., 1 annimmt, durchlaufen. Zu Beginn jedes Schleifendurchlaufs wird durch den Look-Ahead-Mechanismus ein zi berechnet. Abhängig von der konkreten Ausgestaltung des Look-Ahead-Mechanismus muss danach eine eventuelle kleine Ungenauigkeit des vorhergehenden zi+1 ausgebessert werden; dies geschieht im Teilschritt (b):
    Figure 00050001
    Man beachte, dass Schritt (g) an beliebiger Stelle durchgeführt werden kann.
  • 3. Die Abschlussberechnung wird analog zu einem Durchlauf der Hauptschleife mit dem Schleifenparameter i=0 durchgeführt. Je nach konkreter Ausgestaltung muss dass Look-Ahead-Mechanismus für diesen Durchlauf angepasst werden. Außerdem kann es notwendig sein, am Ende noch einmal eine Korrektur der Form +/-P durchzuführen.
    Figure 00050002
Claim 2 now describes an advantageous embodiment of the method or a corresponding device according to claim 1, with which an essentially XY - PZ existing calculation for modular multiplication of XY is performed with only insignificant performance losses. The method consists of an initialization, the iterating through a main loop and a terminating loop, and a technique for the recursive determination of data words z i , referred to below as the look-ahead mechanism. The individual steps of the procedure:
In a preliminary step, a memory array A with typically 2n + 1 data words is initialized with the value 0:
A = 0.
  • 1. In an initialization step, a value z n-1 is first calculated using the look-ahead mechanism mentioned, and thus the calculation steps for the run i = n-1 are carried out (b is the data word length):
    Figure 00040001
    Note that step (e) can be performed anywhere.
  • 2. A main loop is looped through with the loop parameter i, which assumes the values i = n-1,..., 1. At the beginning of each loop it calculates a z i by the look-ahead mechanism. Depending on the specific design of the look-ahead mechanism, a possible small inaccuracy of the preceding z i + 1 must then be corrected; this happens in sub-step (b):
    Figure 00050001
    Note that step (g) can be performed anywhere.
  • 3. The final calculation is carried out analogously to a pass of the main loop with the loop parameter i = 0. Depending on the specific configuration, the look-ahead mechanism must be adapted for this run. In addition, it may be necessary to perform a correction of the form +/- P again at the end.
    Figure 00050002

Die Patentansprüche 3, 4 und 5 beschreiben Variationen des Verfahrens beziehungsweise der entsprechenden Vorrichtung nach Anspruch (2), bei dem verschiedene Berechnungsschritte vertauscht oder zusammengefasst sind.The claims 3, 4 and 5 describe variations of the method respectively the corresponding device according to claim (2), in which different Calculation steps are reversed or summarized.

Patentanspruch 6 beschreibt eine vorteilhafte Ausgestaltung der Erfindung, in der die zi im selben Speicherbereich gespeichert werden, der auch zur Berechnung und Speicherung von A vorgesehen ist.Claim 6 describes an advantageous embodiment of the invention, in which the z i are stored in the same memory area, which is also provided for the calculation and storage of A.

Die darauffolgenden Patentansprüche beschreiben vorteilhafte Ausgestaltungen für den Look-Ahead-Mechanismus. Grundsätzlich basiert der Look-Ahead-Mechanismus auf zwei Schritten:

  • • Der Vorabberechnung der Terme zum höchsten noch zu berechnenden Datenwort. Zwei wichtige Möglichkeiten hierzu bestehen in der Berechnung von: Ãi,1÷2(i+n-2)b und Ãi,3÷2(i+n-2)b mit: Ãi,1 = A – (xi·yi + pn-1·zn-1 + pi·zn-1)·2(i+n-1)b beziehungsweise
    Figure 00060001
  • • Der Division eines solchen Terms, also Ãi,1÷2(i+n-2)b oder Ãi,3÷2(i+n-2)b, durch das erste oder die ersten beiden Datenwörter von P. Da P in diesem Zusammenhang konstant ist, kann dies mittels einer Vorberechnung auf eine Multiplikation zurück geführt werden, wodurch die Durchführung der Division mit recht geringem Aufwand möglich ist.
The following claims describe advantageous embodiments for the look-ahead mechanism. Basically, the look-ahead mechanism is based on two steps:
  • • The precalculation of the terms for the highest data word yet to be calculated. Two important ways of doing this are to calculate: à i, 1 ÷ 2 (i + n-2) b and à i, 3 ÷ 2 (i + n-2) b with: à i, 1 = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 ) · 2 (I + n-1) b respectively
    Figure 00060001
  • • The division of such a term, ie, à i, 1 ÷ 2 (i + n-2) b or à i, 3 ÷ 2 (i + n-2) b , by the first or the first two data words of P. Da P is constant in this context, this can be done by means of a pre-calculation on a multiplication, whereby the division is possible with relatively little effort.

Die Ergebnisse der Division sind im Wesentlichen die sukzessiv zu berechnenden Datenwörter zi: zi = ⌊Ãi,1÷((pn-1·2b)·2(i+n-2)b)⌋beziehungsweise zi= ⌊Ãi,3÷((pn-1·2b+pn-2)·2(i+n-2)b)⌋ The results of the division are essentially the data words z i to be successively calculated: z i = ⌊⌊ i, 1 ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ respectively z i = ⌊⌊ i, 3 ÷ ((p n-1 · 2 b + p n-2 ) · 2 (I + n-2) b ) ⌋

Die Klammern ⌊...⌋ beschreiben dabei die Abrundung auf die nächste ganze Zahl.The Brackets ⌊ ... ⌋ describe the rounding off to the next integer.

Grundsätzlich gilt, dass die Wahrscheinlichkeit für potentielle Fehler bei den zi um so geringer ist, je mehr Terme beim Look-Ahead-Mechanismus berücksichtigt werden und je mehr von den führenden Datenwörtern von P verwendet werden. Andererseits erhöht dies den Aufwand, der für den Look-Ahead-Mechanismus betrieben werden muss.Basically, the more probabilities of potential errors in the z i, the lower the more terms that are considered in the look-ahead mechanism and the more used by P's leading data words. On the other hand, this increases the effort that must be used for the look-ahead mechanism.

Konkret teilen sich die weiteren Patentansprüche zwei Gruppen auf. Die erste Gruppe bezieht sich darauf, dass zi mit einer Überlänge vorgesehen werden. In diesem Fall besteht der Look-Ahead-Mechanismus typischerweise darin, für die Beiträge zum neu berechneten höchsten Term Ãi,1÷2(i+n-2)b zu verwenden und bei der Division nur das erste Datenwort von P zu berücksichtigen. Es ist zwar technisch nicht notwendig, aber sinnvollerweise realisiert man unter diesen Randbedingungen das neue Verfahren mit Überlangen zi so, dass keine weiteren Korrekturen notwendig sind; die Korrekturen (b) der Hauptschleife und der Abschlussberechnung aus Anspruch (2) können dann entfallenSpecifically, the other claims share two groups. The first group refers to z i being provided with an excess length. In this case, the look-ahead mechanism typically consists of using for the contributions to the newly calculated highest term à i, 1 ÷ 2 (i + n-2) b and taking into account only the first data word of P in the division. Although it is technically not necessary, it makes sense to realize the new method with excess z i under these boundary conditions so that no further corrections are necessary; the corrections (b) of the main loop and the final calculation of claim (2) can then be omitted

Bei der Benutzung von Überlängen gibt es mehrere vorteilhafte Ausgestaltungen.at the use of excess lengths There are several advantageous embodiments.

Patentanspruch 7 beschreibt einen Ansatz, in der die Überlänge gering gehalten wird. Dabei wird in einem ersten Schritt ein temporärer Wert Ãi,1 = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmin)·2(i+n-1)b mit einer konstanten kmin berechnet, und anschließend wird zi gemäß zi = ⌊Ãi,1÷((pn-1·2b)·2(i+n-2)b)⌋berechnet. In diesem Schritt wird also zuerst mit Ãi,1 ein Abschätzwert für das höchste noch ausstehende Datenwort berechnet und anschließend mittels der Division ein Wert für zi bestimmt. Da noch nicht alle Terme für die eigentliche Multiplikation berücksichtigt sind, muss für das zi eine gewisse Ungenauigkeit akzeptiert werden. Durch eine geeignete Wahl von kmin wird dabei sichergestellt, dass zi eher etwas zu klein gewählt wird: Diese Ungenauigkeit muss dann im folgenden Hauptschleifendurchgang ausgeglichen werden. Dazu ist es notwendig, dass für die zi eine Überlänge vorgesehen wird. Diese Überlänge ist umso kleiner, je kleiner kmin gewählt werden kann. Die Division zur Berechnung der zi kann natürlich durch eine Vorberechnung, in welche im Wesentlichen pn-1 eingeht, auf eine Multiplikation zurückgeführt werden.Claim 7 describes an approach in which the excess length is kept low. In this case, in a first step, a temporary value à i, 1 = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k min ) · 2 (I + n-1) b is calculated with a constant k min , and then z i is determined according to z i = ⌊⌊ i, 1 ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ calculated. In this step, therefore , an estimate value for the highest still outstanding data word is first calculated using i i, 1 , and then a value for z i is determined by means of the division. Since not all terms for the actual multiplication are considered, a certain inaccuracy must be accepted for the z i . It is ensured by a suitable choice of k min that z i is chosen to be somewhat too small: this inaccuracy must then be compensated in the following main grinding pass. For this it is necessary that an excess length be provided for the z i . This excess length is the smaller, the smaller k min can be selected. Of course, the division for calculating the z i can be attributed to a multiplication by a precomputation, in which p n-1 is essentially received.

Eine vorteilhafte Ausgestaltung von Anspruch (7) wird in Patentanspruch 8 beschrieben. Diese besteht darin, den Wert kmin aus Anspruch (7) gleich 2·2b, 3·2b oder 4·2b zu wählen.An advantageous embodiment of claim (7) is described in claim 8. This consists in choosing the value k min from claim (7) equal to 2 × 2 b , 3 × 2 b or 4 × 2 b .

Patentanspruch 9 beschreibt eine andere Variante des Verfahrens beziehungsweise einer entsprechenden Vorrichtung, bei der eine größere Überlänge akzeptiert und dem Look-Ahead-Mechanismus ein zulässiges Intervall für das zi vorgegeben werden kann. Durch die zusätzliche Überlänge ist es möglich, die so entstehende Ungenauigkeit bei einem zi durch das darauffolgende zi-1 wieder auszugleichen. Dies bedeutet, dass man in der Formel für den Look-Ahead-Mechanismus ein kmin verwendet, welches größer als notwendig ist. Zu dem so entstandenen zi kann man dann, solange man im zulässigen Intervall bleibt, wahlweise eine kleine Zahl hinzuaddieren, ohne den sonstigen Ablauf des Verfahrens zu ändern. Vorteilhaft wird dieses Vorgehen dadurch, dass man eines der möglichen zi aus dem erlaubten Intervall durch einen Zufallszahlengenerator auswählt, was dazu führt, dass der genaue Berechnungsablauf bei wiederholten Berechnungen mit identischen Operanden immer wieder unterschiedlich verläuft. Ein solches zufälliges Verhalten verursacht zufällige Schwankungen des Stromverbrauchs und bietet eine wirksame Maßnahme gegen Seitenkanalangriffe.Claim 9 describes another variant of the method or a corresponding device in which a larger excess length accepted and the look-ahead mechanism, a permissible interval for the z i can be specified. Due to the additional excess length, it is possible to compensate for the resulting inaccuracy in a z i by the subsequent z i-1 again. This means that in the formula for the look-ahead mechanism, a k min is used which is larger than necessary. Then, as long as one remains within the permissible interval, one can add a small number to the resulting z i without changing the other sequence of the method. This approach is advantageous in that one of the possible z i from the allowed interval by a random number generator selects, which means that the exact calculation process repeatedly runs in repeated calculations with identical operands differently. Such random behavior causes random fluctuations in power consumption and provides an effective countermeasure against side channel attacks.

In Patentanspruch 10 wird eine vorteilhafte Ausgestaltung des Verfahrens beziehungsweise einer entsprechenden Vorrichtung aus Anspruch (9) beschrieben, bei der der Look-Ahead-Mechanismus zwei Werte Ãi,1 (1) und Ãi,1 (2) gemäß Ãi,1 (1) = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmin)·2(i+n-1)b Ãi,1 (2) = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmax)·2(i+n-1)b bestimmt, und mit diesen dann zwei Werte zi (1) und zi (2) gemäß zi (1) = ⌊Ãi,1 (1)÷((pn-1·2b)·2(i+n-2)b)⌋ zi (2) = ⌊Ãi,1 (2)÷((pn-1·2b)·2(i+n-2)b)⌋berechnet, durch die dann ein Intervall für die zufällige Wahl von zi nach Anspruch (9) festgelegt wird.In claim 10, an advantageous embodiment of the method or a corresponding device from claim (9) is described in which the look-ahead mechanism two values à i, 1 (1) and à i, 1 (2) according to à i, 1 (1) = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k min ) · 2 (I + n-1) b à i, 1 (2) = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k Max ) · 2 (I + n-1) b determined, and then with these two values z i (1) and z i (2) according to z i (1) = ⌊⌊ i, 1 (1) ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ z i (2) = ⌊⌊ i, 1 (2) ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ is calculated, then by an interval for the random choice of z i is determined according to claim (9).

Eine weitere vorteilhafte Ausgestaltung von Anspruch (9) findet sich in Patentanspruch 11, bei der der Look-Ahead-Mechanismus einen Wert Ãi,1 (2) gemäß Ãi,1 (2) = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmax)·2(i+n-1)b bestimmt, und mit diesen dann zwei Werte zi (1) und zi (2) gemäß zi (2) = ⌊Ãi,1 (2)÷((pn-1·2b)·2(i+n-2)b)⌋ zi (1) = zi (2)+ ⌊(kmax-kmin)÷2bberechnet.A further advantageous embodiment of claim (9) can be found in claim 11, wherein the look-ahead mechanism a value à i, 1 (2) according to à i, 1 (2) = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k Max ) · 2 (I + n-1) b determined, and then with these two values z i (1) and z i (2) according to z i (2) = ⌊⌊ i, 1 (2) ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ z i (1) = z i (2) + ⌊ (k Max -k min ) ÷ 2 b calculated.

Patentanspruch 12 beschreibt anschließend eine alternative vorteilhafte Ausgestaltung der Erfindung. Ziel ist es dabei, dass die durch den Look-Ahead-Mechanismus bestimmten zi die gleiche Datenwortlänge aufweisen wie die anderen verwendeten Langzahlen. Dies wird erreicht, indem der Look-Ahead-Mechanismus beim ersten Hauptschleifendurchlauf – hierbei ist i = n-2 – einen Wert Ãi,3 gemäß

Figure 00080001
berechnet, und dann damit den Wert zi entsprechend durch zi = ⌊Ãi,3÷((pn-1·2b + pn-2)·2(i+n-2)b)⌋bestimmt, anschließend dann ab dem zweiten Hauptschleifendurchlauf Werte Ãi,3 gemäß
Figure 00080002
berechnet, und dann damit Werte zi entsprechend zi = ⌊Ãi,3÷((pn-1·2b + pn-2)·2(i+n-2)b)⌋bestimmt. Dies bedeutet, dass das Look-Ahead-Mechanismus auf 2 weitere Terme ausgedehnt wird und zusätzlich das zi mit höherer Präzision – in der Division wird auch pn-2 berücksichtigt – bestimmt wird. Da für die zi keine Überlängen mehr vorgesehen sind, kann nun die Notwendigkeit einer möglichen Korrektur – Teilschritt b) in der oben im Text zu Patentanspruch 2 beschrieben Hauptschleife – nicht mehr ausgeschlossen werden. Vorteilhafterweise wird jedoch durch die beschriebene höhere Genauigkeit beim Look-Ahead-Mechanismus die Wahrscheinlichkeit dafür, dass der erwähnte Teilschritt b) tatsächlich durchgeführt werden muss, sehr klein. Der konkrete Wert hängt von der Bitlänge der Datenwörter ab und liegt in der Größenordnung von 2-(b-1)/2. Wie vorher wird die Division üblicherweise wieder mittels einer Vorberechnung auf eine Multiplikation zurückgeführt.Claim 12 then describes an alternative advantageous embodiment of the invention. The goal here is that the z i determined by the look-ahead mechanism have the same data word length as the other long numbers used. This is achieved by the look-ahead mechanism in the first main loop pass - where i = n-2 - a value à i, 3 according to
Figure 00080001
calculated, and then by the value z i accordingly z i = ⌊⌊ i, 3 ÷ ((p n-1 · 2 b + p n-2 ) · 2 (I + n-2) b ) ⌋ determines, then from the second main loop pass values à i, 3 according to
Figure 00080002
calculated, and then with values z i accordingly z i = ⌊⌊ i, 3 ÷ ((p n-1 · 2 b + p n-2 ) · 2 (I + n-2) b ) ⌋ certainly. This means that the look-ahead mechanism is extended to 2 further terms and additionally the z i is determined with higher precision - in the division also p n-2 is taken into account. Since no longer lengths are provided for the z i , the need for a possible correction - sub-step b) in the main loop described above in the text to claim 2 - can no longer be ruled out. Advantageously, however, the described higher accuracy in the look-ahead mechanism, the probability that the said sub-step b) must actually be performed, very small. The concrete value depends on the bit length of the data words and is on the order of 2 - (b-1) / 2 . As before, the division is usually returned to a multiplication by means of a pre-calculation.

Referenzen:References:

  • [ DE 102 19 158 ] „Vorrichtung und Verfahren zum Berechnen eines Ergebnisses einer modularen Multiplikation"; Offenlegungsschrift, DE 102 19 158 A1 (2002)[ DE 102 19 158 ] "Apparatus and method for calculating a result of a modular multiplication"; DE 102 19 158 A1 (2002)
  • [ DE 697 03 085 ] „Koprozessor mit zwei parallel arbeitenden Multiplizierschaltungen", Übersetzung der europäischen Patentschrift, EP 0 853 275 B1 , DE 697 03 085 T2 (1997)[ DE 697 03 085 ] "Coprocessor with two parallel multiplier circuits", translation of the European patent specification, EP 0 853 275 B1 . DE 697 03 085 T2 (1997)
  • [Menezes1997] A.J. Menezes, P.C. van Oorschot, S.A. Vanstone: „Handbook of Applied Cryptography", CRC Press (1997)[Menezes1997] A.J. Menezes, P.C. van Oorschot, S.A. Vanstone: "Handbook of Applied Cryptography ", CRC Press (1997)
  • [Knuth1997] D.E. Knuth, „The Art of Computer Programming, Volume 2: Seminumerical Algorithms", Addison Wesley (1997)[Knuth1997] D.E. Knuth, "The Art of Computer Programming, Volume 2: Seminumerical Algorithms, "Addison Wesley (1997)
  • [Ernst2002] M. Ernst, M. Jung, F. Madlener, S. Huss, R. Blümel: „A Reconfigurable System on Chip Implementation for Elliptic Curve Cryptography over GF(2n)", Proceedings of CHES 2002, LNCS 2523, Springer (2002)[Ernst2002] M. Ernst, M. Young, F. Madlener, S. Huss, R. Blumel: "A Reconfigurable System on Chip Implementation for Elliptic Curve Cryptography over GF (2 n)", Proceedings of CHES 2002, LNCS 2523, Springer (2002)

Claims (12)

Verfahren und Vorrichtung zur modularen Multiplikation zweier in mehreren Datenwörtern fester Bitlänge xi und yi gespeicherten Langzahlen X ={xi|i=0, ..., n-1} und Y={yi|i=0, ..., n-1}, wobei – die Berechnung der gemischten Terme xiyj und xjyi mehrheitlich durch die Berechnung von Multiplikationen der Form (xi + xj)x(yi + yj) ersetzt werden, und – in jedem Hauptschleifendurchlauf Berechnungsschritte für die Reduktion – also die Berechnung eines passenden Z zu einem Primelement P, so dass damit die Berechnung von 0<=XY-ZP<P möglich ist, und Durchführung der Operation durchgeführt werden, wobei bereits Werte zi bestimmt werden, die für eine näherungsweise oder vollständige Teilreduktion notwendig sind, und diese näherungsweise oder vollständige Teilreduktion durchgeführt wird, gekennzeichnet dadurch, dass – die Berechnung der näherungsweisen Reduktion modulo einem Primelement P – also die Berechnung von XY – ZP mit einem geeigneten Wert Z, so dass entweder 0<=XY-ZP<P ist oder XY-ZP um ein einfach strukturiertes Vielfaches von P differiert – so durchgeführt wird, dass bei der Multiplikation die gemischten Terme zipj und zjpi mehrheitlich durch die Berechnung von Multiplikationen der Form (zi + zj)x(pi + pj) ersetzt werden, wobei die Zahlen Z={zi|=0, ..., n-1} und P={pi|i=1, ..., n-1} durch einen Vektor von Datenwörtern repräsentiert werden, und die Bitlängen der zi optional größer sein dürfen als die der anderen Datenwörter, – die Bestimmung der zi sukzessiv durch einen Look-Ahead-Mechanismus geschieht, so dass die Datenwörter zi rechtzeitig und mit ausreichender Genauigkeit für die Berechnung von XY-ZP vorliegen.Method and device for modular multiplication of two long numbers stored in a plurality of data words of fixed bit length x i and y i X = {x i | i = 0,..., N-1} and Y = {y i | i = 0, .. ., n-1}, wherein - the calculation of the mixed terms x i y j and x j y i are replaced in the majority by the calculation of multiplications of the form (x i + x j ) x (y i + y j ), and In each main loop pass calculation steps for the reduction - thus the calculation of a matching Z to a prime element P, so that thus the calculation of 0 <= XY-ZP <P is possible, and performing the operation are performed, wherein already values zi are determined , which are necessary for an approximate or complete partial reduction, and this approximate or complete partial reduction is performed, characterized in that - the calculation of the approximate reduction modulo a prime element P - thus the calculation of XY - ZP with a suitable value Z, so da ss either 0 <= XY-ZP <P or XY-ZP differs by a simply structured multiple of P - is carried out so that in the multiplication of the mixed terms z i p j and z j p i majority by the calculation of multiplications of the form (z i + z j ) x (p i + p j ), where the numbers Z = {z i | = 0,..., n-1} and P = {p i | i = 1 , ..., n-1} are represented by a vector of data words, and the bit lengths of z i may optionally be greater than those of the other data words, - the determination of z i is done successively by a look-ahead mechanism, then that the data words z i are present in time and with sufficient accuracy for the calculation of XY-ZP. Verfahren und Vorrichtung zur modularen Multiplikation zweier in mehreren Datenwörtern fester Bitlänge xi und yi gespeicherten Langzahlen X={xi|i=0, ..., n-1} und Y={yi|0=1, ..., n-1} nach Anspruch 1, wobei das Ergebnis im Bereich A berechnet werden soll, gekennzeichnet dadurch, dass a) zu Beginn eine Initialisierungsphase durchgeführt wird, die den Durchlauf für i=n-1 umfasst, und in dem zu Beginn über einen Look-Ahead-Mechanismus ein Wert zn-1 berechnet wird, b) daraufhin ein Hilfswert r = pn-1·zn-1-xn-1·yn-1 berechnet wird, c) nachfolgend dann die Berechnung der entsprechenden Komponenten von A gemäß
Figure 00110001
durchgeführt wird, d) dann die Operation A = A-r·2(2n-2)b erfolgt, e) sowie in der Initialisierungsphase zn-1 abgespeichert wird; f) anschließend die Hauptschleife beginnt, in der in jedem Iterationsschritt der Schleifenparameter i in absteigender Folge die Werte i = n-2, ..., 1 annimmt, und als erster Schritt über einen Look-Ahead-Mechanismus ein Wert zi berechnet wird, g) nachfolgend in jedem Iterationsschritt der Hauptschleife in Abhängigkeit von der Ergebnissen des Look-Ahead-Mechanismus gegebenenfalls eine Korrekturrechnung gemäß A = A±p·2(i+1)b erfolgt, h) daraufhin in jedem Iterationsschritt der Hauptschleife ein Hilfswert r = pi·zi–xi·yi berechnet wird, i) nachfolgend dann in jedem Iterationsschritt der Hauptschleife die Berechnung der entsprechenden Komponenten von A gemäß
Figure 00110002
durchgeführt wird, j) dann in jedem Iterationsschritt der Hauptschleife die Operation A = A–r·2(2i)b erfolgt, k) nachfolgend in jedem Iterationsschritt der Hauptschleife die Berechnung von
Figure 00110003
durchgeführt wird, l) sowie in jedem Iterationsschritt der Hauptschleife der Wert zi abgespeichert wird; m) anschließend nach Abschluss der Hauptschleife dann die Abschlussberechnung beginnt, in der als erster Schritt über einen Look-Ahead-Mechanismus ein Wert z0 berechnet wird, n) nachfolgend in Abhängigkeit von der Ergebnissen des Look-Ahead-Mechanismus gegebenenfalls eine Korrekturrechnung gemäß A = A±p·2(i+1)b erfolgt, o) daraufhin ein Hilfswert r = p0·z0–x0·y0 berechnet wird, p) dann die Operation A = A–r erfolgt, q) nachfolgend dann die Berechnung der letzten Komponenten von A gemäß
Figure 00110004
durchgeführt wird, r) in Abhängigkeit von den vorherigen Rechenschritten gegebenenfalls eine Korrekturrechnung gemäß A = A±p durchgeführt wird.
Method and device for the modular multiplication of two long numbers X = {x i | i = 0,..., N-1} stored in a plurality of data words of fixed bit length x i and y i and Y = {y i | 0 = 1, .. ., n-1} according to claim 1, wherein the result is to be calculated in the area A, characterized in that a) at the beginning of an initialization phase is carried out, which comprises the run for i = n-1, and in the beginning over a look-ahead mechanism is a value z n is calculated, -1) b then an auxiliary value r = p n-1 · z n-1 -x n-1 · y n-1 is calculated, c) below then the calculation the corresponding components of A according to
Figure 00110001
is carried out, d) then the operation A = Ar · 2 (2n-2) b takes place, e) and z n-1 is stored in the initialization phase; f) then the main loop begins, in which in each iteration step the loop parameter i assumes the values i = n-2,..., 1 in descending order, and as a first step a value z.sub.i is calculated via a look-ahead mechanism g) subsequently in each iteration step of the main loop, depending on the results of the look-ahead mechanism, if appropriate a correction calculation according to A = A ± p * 2 (i + 1) b , h) then an auxiliary value r in each iteration step of the main loop = p i · z i -x i · y i is calculated, i) below then in each iteration of the main loop, the calculation of the corresponding components of A according to
Figure 00110002
j) then the operation A = A-r * 2 (2i) b takes place in each iteration step of the main loop, k) subsequently in each iteration step of the main loop the calculation of
Figure 00110003
l) and in each iteration step of the main loop the value z i is stored; m) then, after completion of the main loop, the final calculation begins, in which a value z 0 is calculated as the first step via a look-ahead mechanism, n) optionally a correction calculation according to A, depending on the results of the look-ahead mechanism = A ± p * 2 (i + 1) b takes place, o) then an auxiliary value r = p 0 * z 0 -x 0 * y 0 is calculated, p) then the operation A = A-r occurs, q) below then the calculation of the last components of A according to
Figure 00110004
is carried out, r) if necessary, a correction calculation according to A = A ± p is performed in dependence on the previous calculation steps.
Verfahren und Vorrichtung nach Anspruch (2), gekennzeichnet dadurch, dass die Berechnungsschritte c) und d) vertauscht oder zusammengefasst sind.Method and device according to claim (2) in that the calculation steps c) and d) are reversed or are summarized. Verfahren und Vorrichtung nach Anspruch (2) oder (3), gekennzeichnet dadurch, dass die Berechnungsschritte i), j) und k) in ihrer Reihenfolge permutiert oder zusammengefasst sind.Method and device according to claim (2) or (3) in that the calculation steps i), j) and k) are in their order permuted or summarized. Verfahren und Vorrichtung nach Anspruch (2), (3) oder (4), gekennzeichnet dadurch, dass die Berechnungsschritte p) und q) vertauscht oder zusammengefasst sind.Method and device according to claim (2), (3) or (4) in that the calculation steps p) and q) are interchanged or are summarized. Verfahren und Vorrichtung nach einem der Ansprüche (1) bis (5), gekennzeichnet dadurch, dass die Speicherung von Z, aufgebaut aus den Einzelwerten zi, im selben Speicherbereich erfolgt, der zur Berechnung und Speicherung von A vorgesehen ist.Method and device according to one of claims (1) to (5), characterized in that the storage of Z, built up of the individual values z i , takes place in the same memory area which is provided for the calculation and storage of A. Verfahren und Vorrichtung zur modularen Multiplikation zweier in mehreren Datenwörtern fester Bitlänge xi und yi gespeicherten Langzahlen X = {xi|i=0, ..., n-1} und Y = {yi|i=0, ..., n-1} nach Anspruch 1,), bei dem für die durch den Look-Ahead-Mechanismus bestimmten zi eine Überlänge zugelassen wird – das heißt, dass für die Speicherung der Datenwörter zi von Z eine etwas größere Bitlänge vorgesehen wird als für die Datenwörter von X, Y und P – dadurch gekennzeichnet, dass der Look-Ahead-Mechanismus derart abläuft, dass in einem ersten Schritt ein temporärer Wert Ãi,1 = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmin)·2(i+n-1)b mit einer konstanten kmin berechnet wird, und dann zi gemäß zi = ⌊Ãi,1÷((pn-1·2b)·2(i+n-2)b)⌋berechnet wird, und anschließend a) zu Beginn eine Initialisierungsphase durchgeführt wird, die den Durchlauf für i=n-1 umfasst, und in dem zu Beginn über einen Look-Ahead-Mechanismus ein Wert zn-1 berechnet wird, b) daraufhin ein Hilfswert r = pn-1·zn-1-xn-1·yn-1 berechnet wird, c) nachfolgend dann die Berechnung der entsprechenden Komponenten von A gemäß
Figure 00130001
durchgeführt wird, d) dann die Operation A = A–r·2(2n-2)b erfolgt, e) sowie in der Initialisierungsphase zn-1 abgespeichert wird; f) anschließend die Hauptschleife beginnt, in der in jedem Iterationsschritt der Schleifenparameter i in absteigender Folge die Werte i=n-2, ..., 1 annimmt, und als erster Schritt über einen Look-Ahead-Mechanismus ein Wert zi berechnet wird, g) daraufhin in jedem Iterationsschritt der Hauptschleife ein Hilfswert r = pi·zi-xi·yi berechnet wird, h) nachfolgend dann in jedem Iterationsschritt der Hauptschleife die Berechnung der entsprechenden Komponenten von A gemäß
Figure 00130002
durchgeführt wird, i) dann in jedem Iterationsschritt der Hauptschleife die Operation A = A–r·2(2i)b erfolgt, j) nachfolgend in jedem Iterationsschritt der Hauptschleife die Berechnung von
Figure 00130003
durchgeführt wird, k) sowie in jedem Iterationsschritt der Hauptschleife der Wert zi abgespeichert wird; l) anschließend nach Abschluss der Hauptschleife dann die Abschlussberechnung beginnt, in der als erster Schritt über einen Look-Ahead-Mechanismus ein Wert z0 berechnet wird, m) daraufhin ein Hilfswert r = p0·z0-x0·Y0 berechnet wird, n) dann die Operation A = A–r erfolgt, o) nachfolgend dann die Berechnung der letzten Komponenten von Agemäß
Figure 00130004
durchgeführt wird, p) in Abhängigkeit von den vorherigen Rechenschritten gegebenenfalls eine oder mehrere Korrekturrechnungen gemäß A = A ±p durchgeführt werden, die gegebenenfalls auch zusammengefasst werden können.
Method and device for modular multiplication of two long numbers stored in a plurality of data words of fixed bit length x i and y i X = {x i | i = 0,..., N-1} and Y = {y i | i = 0, .. ., n-1} according to claim 1,), in which for the determined by the look-ahead mechanism z i an excess length is allowed - that is, for the storage of the data words z i of Z a slightly larger bit length is provided as for the data words of X, Y and P - characterized in that the look-ahead mechanism is such that in a first step, a temporary value à i, 1 = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k min ) · 2 (I + n-1) b is calculated with a constant k min , and then z i according to z i = ⌊⌊ i, 1 ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ is calculated, and then a) at the beginning of an initialization phase is carried out, which comprises the run for i = n-1, and in which a value z n -1 is calculated initially via a look-ahead mechanism, b) then a Auxiliary value r = pn -1 * zn-1 -xn -1 * yn -1 is calculated, c) then the calculation of the corresponding components of A according to
Figure 00130001
is carried out, d) then the operation A = A-r · 2 (2n-2) b takes place, e) and in the initialization phase z n-1 is stored; f) then the main loop begins, in which in each iteration step the loop parameter i assumes the values i = n-2,..., 1 in descending order, and as a first step a value z.sub.i is calculated via a look-ahead mechanism , g) then an auxiliary value r = p i * z i -x i * y i is calculated in each iteration step of the main loop, h) then in each iteration step of the main loop the calculation of the corresponding components of A according to
Figure 00130002
i) then in each iteration step of the main loop the operation A = A-r * 2 (2i) b takes place, j) subsequently in each iteration step of the main loop the calculation of
Figure 00130003
k) and in each iteration step of the main loop the value z i is stored; l) then, after completion of the main loop, the final calculation begins, in which a value z 0 is calculated as the first step via a look-ahead mechanism, then an auxiliary value r = p 0 * z 0 -x 0 * Y 0 is calculated n) then the operation A = A-r, o) then the calculation of the last components of Agem
Figure 00130004
is carried out, p) depending on the previous calculation steps optionally one or more correction calculations are carried out according to A = A ± p, which may possibly also be summarized.
Verfahren nach Anspruch (7), gekennzeichnet dadurch, dass der Wert kmin gleich 2·2b, 3·2b oder 4·2b gewählt wird.Method according to claim (7), characterized in that the value k min is chosen equal to 2 · 2 b , 3 · 2 b or 4 · 2 b . Verfahren und Vorrichtung nach Anspruch (1) bis (6), welches einen Schutz gegen Seitenkanalangriffe aufweist, dadurch gekennzeichnet, dass bei dem der Look-Ahead-Mechanismus dergestalt operiert, dass für die zi ein erlaubtes Intervall bestimmt wird, und anschließend mittels eines Zufallszahlengenerators ein Wert zi innerhalb dieses Intervalls bestimmt und in der weiteren Berechnung genutzt wird.Method and device according to claim (1) to (6), which has protection against side channel attacks, characterized in that the look-ahead mechanism operates such that a permitted interval is determined for the z i , and then by means of a Random number generator z i determined within this interval and used in the further calculation. Verfahren und Vorrichtung nach Anspruch (9), gekennzeichnet dadurch, dass der Look-Ahead-Mechanismus zwei Werte Ãi,1 (1) und Ãi,1 (2) gemäß Ãi,1 (1) = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmin)·2(i+n-1)b Ãi,1 (2) = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmax)·2(i+n-1)b bestimmt, und mit diesen dann zwei Werte zi (1) und zi (2) gemäß zi (1) = ⌊Ãi,1 (1)÷((pn-1·2b)·2(i+n-2)b)⌋ zi (2) = ⌊Ãi,1 (2)÷((pn-1·2b)·2(i+n-2)b)⌋berechnet, durch die dann ein Intervall für die zufällige Wahl von zi nach Anspruch (9) festgelegt wird.Method and device according to claim (9), characterized in that the look-ahead mechanism has two values à i, 1 (1) and à i, 1 (2) according to à i, 1 (1) = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k min ) · 2 (I + n-1) b à i, 1 (2) = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k Max ) · 2 (I + n-1) b determined, and then with these two values z i (1) and z i (2) according to z i (1) = ⌊⌊ i, 1 (1) ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ z i (2) = ⌊⌊ i, 1 (2) ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ is calculated, then by an interval for the random choice of z i is determined according to claim (9). Verfahren und Vorrichtung nach Anspruch (9), gekennzeichnet dadurch, dass der Look-Ahead-Mechanismus einen Wert Ãi,1 (2) gemäß Ãi,1 (2) = A – (xi·yi + pn-1·zn-1 + pi·zn-1 + kmax)·2(i+n-1)b bestimmt, und mit diesen dann zwei Werte zi (1) und zi (2) gemäß zi (2) = ⌊Ãi,1 (2)÷((pn-1·2b)·2(i+n-2)b)⌋ zi (1) = zi (2) +⌊(kmax – kmin)÷2bberechnet.Method and device according to claim (9), characterized in that the look-ahead mechanism has a value à i, 1 (2) according to à i, 1 (2) = A - (x i · y i + p n-1 * z n-1 + p i * z n-1 + k Max ) · 2 (I + n-1) b determined, and then with these two values z i (1) and z i (2) according to z i (2) = ⌊⌊ i, 1 (2) ÷ ((p n-1 · 2 b ) · 2 (I + n-2) b ) ⌋ z i (1) = z i (2) + ⌊ (k Max - k min ) ÷ 2 b calculated. Verfahren und Vorrichtung nach Anspruch (1) bis (6), bei dem die durch den Look-Ahead-Mechanismus bestimmten zi die gleiche Datenwortlänge aufweisen wie die anderen verwendeten Langzahlen, dadurch gekennzeichnet, dass der Look-Ahead-Mechanismus beim ersten Hauptschleifendurchlauf, hierbei ist i = n-2, einen Wert Ãi,3 gemäß
Figure 00150001
berechnet, und dann damit den Wert zi entsprechend durch zi = ⌊Ãi,1÷((pn-1·2b+pn-2)·2(i+n-2)b)⌋bestimmt, und dann ab dem zweiten Hauptschleifendurchlauf Werte Ãi,3 gemäß
Figure 00150002
berechnet, und dann damit Werte zi entsprechend zi = ⌊Ãi,3÷((pn-1·2b+pn-2)·2(i+n-2)b)⌋bestimmt.
Method and device according to claim (1) to (6), in which the z i determined by the look-ahead mechanism have the same data word length as the other used long numbers, characterized in that the look-ahead mechanism during the first main loop pass, where i = n-2, a value à i, 3 according to
Figure 00150001
calculated, and then by the value z i accordingly z i = ⌊⌊ i, 1 ÷ ((p n-1 · 2 b + p n-2 ) · 2 (I + n-2) b ) ⌋ determined, and then from the second main loop pass values à i, 3 according to
Figure 00150002
calculated, and then with values z i accordingly z i = ⌊⌊ i, 3 ÷ ((p n-1 · 2 b + p n-2 ) · 2 (I + n-2) b ) ⌋ certainly.
DE200410016412 2004-03-30 2004-03-30 Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism Withdrawn DE102004016412A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE200410016412 DE102004016412A1 (en) 2004-03-30 2004-03-30 Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE200410016412 DE102004016412A1 (en) 2004-03-30 2004-03-30 Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism

Publications (1)

Publication Number Publication Date
DE102004016412A1 true DE102004016412A1 (en) 2005-10-27

Family

ID=35062184

Family Applications (1)

Application Number Title Priority Date Filing Date
DE200410016412 Withdrawn DE102004016412A1 (en) 2004-03-30 2004-03-30 Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism

Country Status (1)

Country Link
DE (1) DE102004016412A1 (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69703085T2 (en) * 1997-01-09 2001-01-18 St Microelectronics Sa Coprocessor with two multiplier circuits working in parallel
DE10219158A1 (en) * 2002-04-29 2003-11-20 Infineon Technologies Ag Device and method for calculating a result of a modular multiplication

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE69703085T2 (en) * 1997-01-09 2001-01-18 St Microelectronics Sa Coprocessor with two multiplier circuits working in parallel
DE10219158A1 (en) * 2002-04-29 2003-11-20 Infineon Technologies Ag Device and method for calculating a result of a modular multiplication

Similar Documents

Publication Publication Date Title
DE60314584T2 (en) Masking of data decomposed or factored in a residual class system
DE69826963T2 (en) Device for modular inversion for securing information
DE102005028662B4 (en) Method and device for calculating a polynomial multiplication, in particular for elliptic curve cryptography
EP2771782B1 (en) Efficient primality checking
EP1922837B1 (en) Method for securely encrypting or decrypting a message
DE102005041102A1 (en) Method for scalar multiplication of points on an elliptic curve
WO2001088693A2 (en) Cryptographic method and cryptographic device
DE10357661B4 (en) Modular Montgomery multiplier and associated multiplication method
EP1370933B1 (en) Method and device for modular multiplication
DE10219158B4 (en) Device and method for calculating a result of a modular multiplication
EP2641241B1 (en) Method for long-number division or modular reduction
EP1576463B1 (en) Modular multiplication with parallel calculation of look-ahead parameters
DE102006013989A1 (en) Method of reducing a polynomial in a binary finite field
EP1478999B1 (en) Device and method for converting a term
DE10200133B4 (en) Method and device for calculating modulo operations
WO2003034172A2 (en) Method and device for calculating the result of an exponentiation
DE102004016412A1 (en) Multiplication of two very large numbers for cryptographic purposes, whereby a brackets multiplication method is used based on reduction to a prime element and use of a successive look ahead mechanism
EP2587713B1 (en) Efficient modular inversion with prime number test
EP1504337B1 (en) Calculating the modular inverse of a value
DE102008050800A1 (en) Apparatus and method for determining an inverse of a value related to a module
DE10357749B4 (en) Apparatus and method for determining a divisor freedom of a test number with respect to a plurality of primes
DE10357751B4 (en) Apparatus and method for providing a test number
DE10108916C1 (en) Selective division circuit for cryptographic applications has multiplexer outputs coupled to different groups of multiplexer outputs when division is not required and required respectively
DE102004022647B4 (en) Method and device for determining the number of expired clock cycles of a binary random number generator
EP1271304A2 (en) Method for calculating the modular inverses of two numbers

Legal Events

Date Code Title Description
OP8 Request for examination as to paragraph 44 patent law
8122 Nonbinding interest in granting licenses declared
8139 Disposal/non-payment of the annual fee