DE10219164B4 - Device and method for calculating an integer quotient - Google Patents

Device and method for calculating an integer quotient Download PDF

Info

Publication number
DE10219164B4
DE10219164B4 DE2002119164 DE10219164A DE10219164B4 DE 10219164 B4 DE10219164 B4 DE 10219164B4 DE 2002119164 DE2002119164 DE 2002119164 DE 10219164 A DE10219164 A DE 10219164A DE 10219164 B4 DE10219164 B4 DE 10219164B4
Authority
DE
Germany
Prior art keywords
module
reduction
multiplier
processing
bits
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.)
Expired - Fee Related
Application number
DE2002119164
Other languages
German (de)
Other versions
DE10219164A1 (en
Inventor
Wieland Dipl.-Math. Dr. Fischer
Jean-Pierre Dipl-.Inf. Dr. Seifert
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.)
Infineon Technologies AG
Original Assignee
Infineon Technologies AG
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 Infineon Technologies AG filed Critical Infineon Technologies AG
Priority to DE2002119164 priority Critical patent/DE10219164B4/en
Priority to AU2003224137A priority patent/AU2003224137A1/en
Priority to PCT/EP2003/004427 priority patent/WO2003093970A2/en
Priority to TW92109930A priority patent/TW200400442A/en
Publication of DE10219164A1 publication Critical patent/DE10219164A1/en
Application granted granted Critical
Publication of DE10219164B4 publication Critical patent/DE10219164B4/en
Anticipated expiration legal-status Critical
Expired - Fee Related 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

Abstract

Vorrichtung zum Berechnen eines ganzzahligen Quotienten eines Terms (T) bezüglich eines Moduls (N), wobei der Term ein Produkt aus einem binären Multiplikator (M) und einem Multiplikanden (C) aufweist, mit folgenden Merkmalen:
einer Verarbeitungseinrichtung (10) zum Verarbeiten von Bits des Multiplikators (N) in mehreren Verarbeitungsschritten, wobei die Verarbeitungseinrichtung (10) ausgebildet ist, um in einem Verarbeitungsschritt ein bezüglich des Moduls reduziertes Zwischenergebnis (Z) zu berechnen, das von dem einen oder den mehreren Bits des binären Multiplikators abhängt, die in dem einen Verarbeitungsschritt betrachtet werden;
einer Einrichtung (12) zum Protokollieren von Reduktionsinformationen in dem einen Verarbeitungsschritt und zum Protokollieren von Ordnungsinformationen über durch eine oder mehrere durch den einen Verarbeitungsschritt betroffene Stellen des ganzzahligen Quotienten; und
einer Auswertungseinrichtung (14) zum Auswerten der Reduktionsinformationen und der Ordnungsinformationen aus den Verarbeitungsschritten, um den ganzzahligen Quotienten (Q) zu erhalten.
Device for calculating an integer quotient of a term (T) with respect to a module (N), the term having a product of a binary multiplier (M) and a multiplicand (C), with the following features:
a processing device (10) for processing bits of the multiplier (N) in a plurality of processing steps, the processing device (10) being designed to calculate, in one processing step, an intermediate result (Z) which is reduced in terms of the module and which of the one or more Binary multiplier bits that are considered in the one processing step;
means (12) for logging reduction information in the one processing step and for logging ordering information about one or more digits of the integer quotient affected by the one processing step; and
an evaluation device (14) for evaluating the reduction information and the order information from the processing steps in order to obtain the integer quotient (Q).

Figure 00000001
Figure 00000001

Description

Die vorliegende Erfindung bezieht sich auf Rechenalgorithmen und insbesondere auf Rechenalgorithmen, die für kryptographische Anwendungen benötigt werden.The The present invention relates to computing algorithms and in particular on computational algorithms for cryptographic applications needed become.

Insbesondere in der Public-Key-Kryptographie, jedoch auch in anderen Kryptographiegebieten, wachsen die Schlüssellängen stetig. Dies ist darin begründet, daß auch die Sicherheitsanforderungen an solche kryptographische Algorithmen immer mehr zunehmen. Anhand des RSA-Verfahrens als Vertreter eines asymmetrischen Kryptographiekonzepts, also eines Public-Key-Verfahrens, nimmt die Sicherheit gegenüber sogenannten Brute-Force-Angriffen mit der verwendeten Schlüssellänge zu. Brute-Force-Angriffe sind Angriffe auf einen kryptographischen Algorithmus, bei dem durch Durchprobieren sämtlicher Möglichkeiten auf einen Schlüssel geschlossen werden soll. Es ist unmittelbar einsichtig, daß mit zunehmender Schlüssellänge die Zeit, die theoretisch für einen Brute-Force-Angriff benötigt wird, um alle Möglichkeiten durchzuprobieren, stark ansteigt.In particular in public key cryptography, but also in other areas of cryptography the key lengths steadily. This is because that too the security requirements for such cryptographic algorithms increase more and more. Using the RSA procedure as a representative of a asymmetric cryptography concept, i.e. a public key process security towards so-called brute force attacks the key length used. Brute-force attacks are attacks on a cryptographic algorithm in which Try all of them possibilities on a key to be closed. It is immediately clear that with increasing Key length the Time theoretically for a brute force attack is needed for all possibilities to try, increases sharply.

In diesem Zusammenhang sei angemerkt, daß zu früheren Zeiten RSA-Anwendungen mit Schlüssellängen von 512 Bits als ausreichend angesehen wurden. Aufgrund technischer und mathematischer Fortschritte der „Gegenseite" wurden dann die Schlüssellängen für typische RSA-Anwendungen auf 1024 Bits erhöht. Inzwischen wird von manchen Seiten die Ansicht vertreten, daß auch diese Schlüssellänge nicht ausreichend ist, so daß RSA-Schlüssellängen von 2048 Bits angestrebt werden.In In this context it should be noted that RSA applications were used in earlier times with key lengths of 512 bits were considered sufficient. Due to technical and mathematical advances of the "opposite side" then became Key lengths for typical RSA applications increased to 1024 bits. Meanwhile, from some sides take the view that also this key length is not is sufficient so that RSA key lengths of 2048 bits are aimed for.

Wenn andererseits existierende kryptographische Coprozessoren, wie z. B. auf SmartCards, betrachtet werden, so ist zu sehen, daß selbstverständlich der Wunsch besteht, auch RSA- Anwendungen mit beispielsweise 2048 Bits Schlüssellängen auf kryptographischen Schaltungen laufen zu lassen, die eigentlich nur für Schlüssellängen von z. B. 1024 Bits entwickelt worden sind. So ist es gerade ein Kennzeichen von arithmetischen Coprozessoren für existierende SmartCard-Anwendungen, daß sie für eine feste Bitlänge entwickelt worden sind, die nicht für die neuesten Sicherheitsanforderungen geeignet sind, d. h. zu klein sind. Dies führt dazu, daß beispielsweise ein 2048-Bit-RSA-Algorithmus auf 1024 Bit-Coprozessoren nicht effizient gehandhabt werden kann. Für RSA-Anwendungen ist beispielsweise der Chinesische Restsatz (CRT; CRT = Chinese Remainder Theorem) bekannt, bei dem eine modulare Exponentiation mit großer Schlüssellänge in zwei modulare Exponentiationen mit halb so großer Schlüssellänge zerlegt wird, wonach die Ergebnisse der beiden modularen Exponentiationen halber Länge entsprechend zusammengefaßt werden.If on the other hand existing cryptographic coprocessors such as e.g. B. on SmartCards, can be seen that of course the There is also a desire for RSA applications with, for example, 2048 bits of key lengths on cryptographic To run circuits that are actually only for key lengths of z. B. 1024 bits have been developed. So it's just a hallmark of arithmetic coprocessors for existing SmartCard applications, that she for one fixed bit length have been developed that do not meet the latest security requirements are suitable, d. H. are too small. As a result, for example a 2048-bit RSA algorithm on 1024-bit coprocessors is not efficient can be handled. For RSA applications are, for example, the Chinese remainder sentence (CRT; CRT = Chinese Remainder Theorem), in which a modular Exponentiation with large Key length in two modular exponentiations with half the key length is broken down, after which the Results of the two modular half-length exponents accordingly summarized become.

In jüngster Zeit hat sich herausgestellt, daß der chinesische Restsatz besonders anfällig gegenüber DFA-Angriffen (DFA = Differential Fault Analysis) ist.In recently, Time has turned out that the Chinese remainder particularly vulnerable across from DFA (Differential Fault Analysis) attacks.

Ein Problem bei vielen Verfahren ist daher das „Aufdoppeln" der sogenannten modularen Multiplikation, die eine zentrale Operation in kryptographischen Berechnungen ist. So kann eine modulare Exponentiation in viele modulare Multiplikationen zerlegt werden, d. h. in eine Operation, bei dem ein Produkt eines ersten Operanden A und eines zweiten Operanden B in einer Restklasse bezüglich eines Moduls N berechnet wird. Wenn die Operanden A und B jeweils 2n Bits haben, so werden typischerweise Rechenwerke verwendet, die eine Länge von 2n Bits haben. Diese Rechenwerke werden aufgrund ihrer hohen Länge als Langzahlrechenwerke bezeichnet, im Gegensatz zu beispielsweise klassischen 8-, 16-, 32- oder 64-Bit-Architekturen, die z. B. für PC- oder Workstation-Prozessoren eingesetzt werden.On The problem with many methods is therefore the "doubling" of the so-called modular multiplication, which is a key operation in cryptographic Calculations. So modular exponentiation can take many modular multiplications are broken down, d. H. into an operation in which a product of a first operand A and a second operand B in a residual class regarding of a module N is calculated. If operands A and B are each 2n bits, so arithmetic units are typically used that a length of 2n bits. These arithmetic units are due to their high Length as Long number arithmetic, in contrast to, for example, classic 8, 16, 32 or 64 bit architectures, the z. B. for PC or workstation processors are used.

Wünsche bestehen daher dahingehend, eine modulare Multiplikation A·B mod N mit Zahlen A, B und N der Bit-Länge 2n auf einem n-Bit-Rechenwerk auszuführen. Dies ist sehr zeitaufwendig, da die Zahlen A, B, N, ... immer nur bruchstückweise geladen werden können, weshalb konventionelle Methoden, sofern sie nicht gänzlich versagen, organisatorisch aufwendig und fehleranfällig sind. In der Technik gibt es mehrere Verfahren, mit denen dieses Problem bisher gelöst worden ist. Diese Verfahren sind unter dem Stichwort Montgomery-Multiplikation, normale Multiplikation, z. B. mit Karatsuba-Ofman und späterer Reduktion, wie z. B. Barret-Reduktion, bekannt.Wishes exist therefore, a modular multiplication A · B mod Execute N with numbers A, B and N of bit length 2n on an n-bit arithmetic unit. This is very time-consuming, since the numbers A, B, N, ... are only fragmentary can be loaded why conventional methods, unless they fail completely, are organizationally complex and prone to errors. In technology there is several methods by which this problem has been solved so far is. These procedures are called Montgomery multiplication, normal multiplication, e.g. B. with Karatsuba-Ofman and later reduction, such as B. Barret reduction, known.

Ein weiteres Konzept, bei dem eine Montgomery-Rechnung in einem „CRT-Fenster" verwendet wird, ist in P. Pailler, „Lowcost double size modular exponentiation or how to stretch your cryptocoprocessor" dargelegt.On another concept in which a Montgomery calculation is used in a "CRT window", is in P. Pailler, “Lowcost double size modular exponentiation or how to stretch your cryptocoprocessor ".

Sämtliche derartigen Konzepte sind aufwendig hinsichtlich der Rechenzeit und der Datenorganisation und daher nicht immer effizient.All Such concepts are expensive in terms of computing time and data organization and therefore not always efficient.

In der am gleichen Tag eingereichten deutschen Patentanmeldung mit dem Titel „Vorrichtung und Verfahren zum Berechnen eines Ergebnisses einer modularen Multiplikation", wird ein Konzept beschrieben, bei dem eine modulare Multiplikation für Operanden von 2n Bits in mehrere sogenannte MMD-Operationen umgesetzt werden, für die Operanden der halben Länge, also mit n Bits, ausreichend sind. Eine MMD-Operation liefert neben dem Rest, der sich durch A × B mod N ergibt, auch das Ergebnis der entsprechenden ganzzahligen Division, d. h. der DIV-Operation, wobei dieses Ergebnis auch als ganzzahliger Quotient Q bezeichnet ist.In the German patent application filed on the same day with the title “Device and method for calculating a result of a modular multiplication”, a concept is described in which a modular multiplication for operands of 2n bits is converted into several so-called MMD operations for which Operands of half the length, ie with n bits, are sufficient In addition to the remainder resulting from A × B mod N, an MMD operation also supplies the result of the corresponding integer division, i. H. the DIV operation, this result also being referred to as an integer quotient Q.

Allgemein führt die Operation T mod N zu einem Rest R, wenn ein Term T bezüglich eines Moduls N reduziert wird. Die Operation T div N liefert dagegen den ganzzahligen Quotienten hinsichtlich des Moduls N, so daß der Term T aus Q × N + R rekonstruierbar ist. Die MMD-Operation (MMD = MultModDiv) dient daher einer Umrechnung eines beliebigen Terms T in einen ganzzahligen Quotienten Q und einen Rest R bezüglich eines Moduls N.Generally leads the Operation T mod N to a residue R if a term T is related to a Module N is reduced. The operation T div N delivers the integer quotients with respect to the module N, so that the term T from Q × N + R can be reconstructed. The MMD operation (MMD = MultModDiv) serves hence a conversion of any term T into an integer Quotient Q and a remainder R with respect to a module N.

In der üblichen modularen Arithmetik, die für Kryptographietechniken verwendet wird, wird normalerweise das Ergebnis der DIV-Operation, also der ganzzahlige Quotient nicht benötigt und auch nicht berechnet. Das oben beschriebenen Konzept basiert jedoch darauf, auch die DIV-Information, also den ganzzahligen Quotienten zu verwerten. So können auch andere Anwendungen in der Technik existieren, bei denen nicht nur das Ergebnis der MOD-Operation, also der Rest, benötigt wird, sondern bei denen auch der ganzzahlige Quotient, also das Ergebnis der DIV-Operation benötigt wird.In the usual modular arithmetic used for cryptographic techniques the result of the DIV operation, So the integer quotient is not required and not calculated. However, the concept described above is based on it, also the DIV information, to use the integer quotient. So can too other applications in technology exist where not only the result of the MOD operation, i.e. the rest, is needed but also the integer quotient, i.e. the result of the DIV surgery needed becomes.

Eine bekannte, effiziente und oft verwendete Möglichkeit, um die modulare Multiplikation zu berechnen, ist in der Technik als Montgomery-Multiplikation bekannt und z. B. im „Handbook of Applied Cryptography", Menezes, van Oorschot, Vanstone, CRC Press, Seiten 600–603, beschrieben. Die Montgomery-Reduktion ist eine Technik, die eine effiziente Implementation der modularen Multiplikation erlaubt, ohne daß der klassische modulare Reduktionsschritt explizit ausgeführt wird. Allgemein gesagt wird bei der Montogomery-Reduktion die Divisionsoperation durch einfache Verschiebungsoperationen ausgedrückt.A Well-known, efficient and often used way to get the modular To calculate multiplication is technically called Montgomery multiplication known and z. B. in the "Handbook of Applied Cryptography ", Menezes, van Oorschot, Vanstone, CRC Press, pages 600-603. The Montgomery reduction is a technique that is an efficient implementation of the modular Multiplication allowed without the classic modular reduction step is carried out explicitly. Generally speaking, in the Montogomery reduction, the division operation is performed by simple displacement operations expressed.

Mittlerweile ist auch eine Erweiterung der Montgomery-Multiplikationsoperation auf den elliptischen Körper GF(2n) bekannt. Diese Erweiterung ist in „Montgomery Multiplication in GF(2k)", Koc, Azar, Designs, Codes and Cryptography, Bd. 14, 1998, S. 57–69, beschrieben. Diese Erweiterung ist ferner in „A Scalable and Unified Multiplier Architecture for Finite Fields Z/NZ and GF(2n)", Erkay Savas u. a., Cryptographic Hardware and Embedded Systems (CHESS 2000), S. 281-289, Springer Lecture Notes, beschrieben.An extension of the Montgomery multiplication operation to the elliptical body GF (2 n ) is now also known. This extension is described in "Montgomery Multiplication in GF (2 k )", Koc, Azar, Designs, Codes and Cryptography, Vol. 14, 1998, pp. 57-69. This extension is also described in "A Scalable and Unified Multiplier Architecture for Finite Fields Z / NZ and GF (2 n ) ", Erkay Savas et al., Cryptographic Hardware and Embedded Systems (CHESS 2000), pp. 281-289, Springer Lecture Notes.

Nachteilig an der Montgomery-Multiplikation über Z/NZ oder GF(2n) ist die Tatsache, daß zwar die hardwaremäßig schlecht implementierbare Divisionsoperation zur modularen Reduktion durch Verschiebungsoperationen umgangen wird, aber keine Look-Ahead-Verfahren oder Vorausschau-Verfahren eingesetzt werden, um die modulare Multiplikationsoperation hardwaremäßig zu beschleunigen.A disadvantage of the Montgomery multiplication via Z / NZ or GF (2 n ) is the fact that although the hardware-poorly implementable division operation for modular reduction is bypassed by shifting operations, no look-ahead methods or look-ahead methods are used to accelerate the modular multiplication operation in terms of hardware.

Die DE 3631992 C2 offenbart ein Verfahren, bei dem die modulare Multiplikation über Z/NZ unter Verwendung eines Multiplikations-Vorausschau-Verfahrens und unter Verwendung eines Reduktions-Vorausschau-Verfahrens beschleunigt werden kann. Das in der DE 3631992 C2 beschriebene Verfahren wird auch als ZDN-Verfahren bezeichnet und anhand von 6 näher beschrieben. Nach einem Startschritt 900 des Algorithmus werden die globalen Variablen M, C und N initialisiert. Ziel ist es, folgende modulare Multiplikation zu berechnen: Z = M·C mod N. The DE 3631992 C2 discloses a method in which modular multiplication over Z / NZ can be accelerated using a multiplication look-ahead method and using a reduction look-ahead method. That in the DE 3631992 C2 The method described is also referred to as the ZDN method and is based on 6 described in more detail. After a start 900 of the algorithm, the global variables M, C and N are initialized. The aim is to calculate the following modular multiplication: Z = M · C mod N.

M wird als der Multiplikator bezeichnet, während C als der Multiplikand bezeichnet wird. Z ist das Ergebnis der modularen Multiplikation, während N der Modul ist.M is referred to as the multiplier, while C as the multiplicand referred to as. Z is the result of modular multiplication, while N is the module.

Hierauf werden verschiedene lokale Variablen initialisiert, auf die zunächst nicht näher eingegangen werden braucht. Anschließend werden zwei Vorausschau-Verfahren angewandt. Im Multiplikations-Vorausschau-Verfahren GEN_MULT_LA wird unter Verwendung verschiedener Look-Ahead-Regeln ein Multiplikations-Verschiebungswert sZ sowie ein Multiplikations-Vorausschau-Parameter a berechnet (910). Hierauf wird der gegenwärtige Inhalt des Z-Registers einer Links-Verschiebungs-Operation um sZ-Stellen unterzogen (920).Various local variables are initialized, which do not need to be discussed in more detail at first. Two look-ahead procedures are then used. In the multiplication look-ahead method GEN_MULT_LA, a multiplication shift value s Z and a multiplication look-ahead parameter a are calculated using different look-ahead rules ( 910 ). The current content of the Z register is then subjected to a left shift operation by s Z positions ( 920 ).

Im wesentlichen parallel dazu wird ein Reduktions-Vorausschau-Verfahren GEN_Mod_LA (930) durchgeführt, um einen Reduktionsverschiebungswert sN und einen Reduktions-Parameter b zu berechnen. In einem Schritt 940 wird dann der gegenwärtige Inhalt des Modul-Registers, also N, um sN Stellen verschoben, um einen verschobenen Modulwert N' zu erzeugen. Die zentrale Drei-Operanden-Operation des ZDN-Verfahrens findet in einem Schritt 950 statt. Hierbei wird das Zwischenergebnis Z' nach dem Schritt 920 zu dem Multiplikanden C, der mit dem Multiplikations-Vorausschau-Parameter a multipliziert ist, und zu dem verschobenen Modul N', der mit dem Reduktions-Vorausschau-Parameter b multipliziert ist, addiert. Je nach aktueller Situation können die Vorausschau-Parameter a und b einen Wert von +1, 0 oder –1 haben.A reduction forecast procedure GEN_Mod_LA ( 930 ) to calculate a reduction shift value s N and a reduction parameter b. In one step 940 the current content of the module register, i.e. N, is then shifted by s N places to produce a shifted module value N '. The central three-operand operation of the ZDN method takes place in one step 950 instead of. Here, the intermediate result Z 'after the step 920 to the multiplicand C, which is multiplied by the multiplication look-ahead parameter a, and to the shifted module N ', which is multiplied by the reduction look-ahead parameter b. Depending on the current situation, the look-ahead parameters a and b can have a value of +1, 0 or -1.

Ein Fall besteht darin, daß der Multiplikations-Vorausschau-Parameter a +1 beträgt, und daß der Reduktion-Vorausschau-Parameter b –1 beträgt, so daß zu einem verschobenen Zwischenergebnis Z' der Multiplikand C hinzu addiert wird, und der verschobene Modul N' davon subtrahiert wird. a wird u. a. einen Wert gleich 0 haben, wenn das Multiplikations-Vorausschau-Verfahren mehr als eine voreingestellte Anzahl von einzelnen Links-Verschiebungen zulassen würde, also wenn sZ größer als der maximal zulässige Wert von sZ ist, der auch als k bezeichnet wird. Für den Fall, daß a gleich 0 ist, und daß Z' aufgrund der vorausgehenden modularen Reduktion, also der vorausgehenden Subtraktion des verschobenen Moduls noch ziemlich klein ist, und insbesondere kleiner als der verschobene Modul N' ist, muß keine Reduktion stattfinden, so daß der Parameter b gleich 0 ist.One case is that the multiplication look-ahead parameter a is +1 and the reduction look-ahead parameter b is -1, so that the multiplicand C is added to a shifted intermediate result Z 'and the shifted module N 'is subtracted from it. Among other things, a will have a value equal to 0 if the multiplication look-ahead method would allow more than a preset number of individual left shifts, ie if s Z is greater than the maximum permissible value of s Z , which is also referred to as k becomes. In the event that a is equal to 0 and that Z 'is still quite small due to the preceding modular reduction, i.e. the preceding subtraction of the shifted module, and in particular is smaller than the shifted module N', no reduction has to take place, so that the parameter b is 0.

Die Schritte 910 bis 950 werden so lange durchgeführt, bis sämtliche Stellen des Multiplikanden abgearbeitet sind, also bis m gleich 0 ist, und bis auch ein Parameter n gleich 0 ist, welcher angibt, ob der verschobene Modul N' noch größer als der ursprüngliche Modul N ist, oder ob trotz der Tatsache, daß bereits sämtliche Stellen des Multiplikanden abgearbeitet sind, noch weitere Reduktionsschritte durch Subtrahieren des Moduls von Z durchgeführt werden müssen.The steps 910 to 950 are carried out until all positions of the multiplicand have been processed, i.e. until m is 0, and also until a parameter n is 0, which indicates whether the shifted module N 'is still larger than the original module N, or whether Despite the fact that all positions of the multiplicand have already been processed, further reduction steps have to be carried out by subtracting the module from Z.

Abschließend wird noch bestimmt, ob Z kleiner als 0 ist. Falls dies der Fall ist, muß, um eine abschließende Reduktion zu erreichen, der Modul N zu Z hinzuaddiert werden, damit schließlich das korrekte Ergebnis Z der modularen Multiplikation erhalten wird. In einem Schritt 960 ist die modulare Multiplikation mittels des ZDN-Verfahrens beendet.Finally, it is determined whether Z is less than 0. If this is the case, in order to achieve a final reduction, the module N must be added to Z so that the correct result Z of the modular multiplication is finally obtained. In one step 960 the modular multiplication by means of the ZDN method is ended.

Der Multiplikations-Verschiebungswert sZ sowie der Multiplikations-Parameter a, welche im Schritt 910 durch den Multiplikations-Vorausschau-Algorithmus berechnet werden, ergeben sich durch die Topologie des Multiplikators sowie durch die eingesetzten Vorausschau-Regeln, die in der DE 3631992 C2 beschrieben sind.The multiplication shift value s Z and the multiplication parameter a, which in step 910 calculated by the multiplication look-ahead algorithm result from the topology of the multiplier and from the look-up rules used in the DE 3631992 C2 are described.

Der Reduktions-Verschiebungswert sN und der Reduktions-Parameter b werden, wie es ebenfalls in der DE 3631992 C2 beschrieben ist, durch Vergleich des gegenwärtigen Inhalts des Z-Registers mit einem Wert 2/3 mal N bestimmt. Aufgrund dieses Vergleiches trägt das ZDN-Verfahren seinen Namen (ZDN = Zwei Drittel N).The reduction shift value s N and the reduction parameter b are, as is also the case in FIG DE 3631992 C2 is determined by comparing the current content of the Z register with a value 2/3 times N. Because of this comparison, the ZDN method bears its name (ZDN = two thirds N).

Das ZDN-Verfahren, wie es in 6 dargestellt ist, führt die modulare Multiplikation auf eine Drei-Operanden-Addition (Block 950 in 6) zurück, wobei zur Steigerung der Rechenzeiteffizienz das Multiplikations-Vorausschau-Verfahren und damit einhergehend das Reduktions-Vorausschau-Verfahren eingesetzt werden. Im Vergleich zur Montgomery-Reduktion für Z/NZ kann daher ein Rechenzeitvorteil um einen Faktor in der Größenordnung von 3 erreicht werden.The ZDN procedure as described in 6 the modular multiplication leads to a three-operand addition (block 950 in 6 ) back, using the multiplication look-ahead method and the associated reduction look-ahead method to increase the computing time efficiency. Compared to the Montgomery reduction for Z / NZ, a computing time advantage of a factor of the order of 3 can therefore be achieved.

Nachteilig an den oben beschriebenen Multiplikationskonzepten ist, daß lediglich die Modulo-Operation berechnet wird, daß jedoch nicht die DIV-Operation berechnet wird, also die Operation, die den ganzzahligen Quotienten Q bezüglich des Moduls N des Produkts aus dem Multiplikator M und dem Multiplikanden C liefert, so daß das Produkt C × M = Q·N + Z darge stellt ist. Wie es jedoch ausgeführt worden ist, ist der ganzzahlige Quotient jedoch für bestimmte Anwendungen nützlich, wobei eine dieser Anwendungen, wie es vorstehend beschrieben worden ist, darin besteht, eine modulare Multiplikation mit Zahlen einer bestimmten Länge auf einem Rechenwerk der halben Länge effizient auszuführen.adversely of the multiplication concepts described above is that only the modulo operation is calculated, but not the DIV operation is calculated, i.e. the operation that uses the integer quotient Q regarding of the module N of the product of the multiplier M and the multiplicand C returns, so that Product C × M = Q · N + Z represents. However, how it was done is the integer Quotient, however, for certain Applications useful using one of these applications as described above is a modular multiplication with numbers one certain length Execute efficiently on a half-length calculator.

Die DE 699 00 127 T2 offenbart ein verbessertes Verfahren zur Ausführung einer ganzzahligen Division, bei dem ein Wort in ein erstes Register geladen wird, bei dem Nullen in ein zweites Register geladen werden, bei dem Nullen ferner in ein drittes Register geladen werden, und bei denen ein anderes Wort in ein viertes Register geladen wird. Hierauf werden Schritte einer ganzzahligen Division, eines Ladens eines weiteren Worts in ein Register sowie einer Verschiebung von Inhalten von verschiedenen Registern, einer Subtraktion von Werten, einer, abhängig von dem Subtraktionsergebnis, erfolgenden Dekrementierung oder Ladung der Wörter in ein Register und eine entsprechende Verschiebung sowie weitere Schritte durchgeführt, um schließlich das Ergebnis einer ganzzahligen Division zu erhalten.The DE 699 00 127 T2 discloses an improved method of performing integer division in which a word is loaded into a first register, zeros are loaded into a second register, zeros are further loaded into a third register, and another word is loaded into one fourth register is loaded. This is followed by steps of an integer division, a loading of another word into a register and a shifting of contents from different registers, a subtraction of values, a decrementing or loading of the words into a register and a corresponding shifting, depending on the result of the subtraction, and further steps to finally get the result of an integer division.

Die DE 698 02 016 T2 offenbart ein Verfahren und eine Vorrichtung zum Durchführen einer ganzzahligen Divisionsoperation mit einem modulo-arithmetischen Koprozessor auf der Basis des Montgomery-Verfahrens, wobei im Verlauf der Division wenigstens eines der Worte mit einer Anzahl von Bits des Zählers oder des Quotienten Bit für Bit in ein Register für das Verschieben von Bits geladen wird, und das Wort in das Register in einer ersten Reihenfolge eingegeben wird und Bit für Bit von dem Register in umgekehrter Reihenfolge gegenüber der ersten Reihenfolge ausgegeben wird.The DE 698 02 016 T2 discloses a method and apparatus for performing an integer division operation with a modulo-arithmetic coprocessor based on the Montgomery method, wherein in the course of the division at least one of the words with a number of bits of the counter or the quotient bit by bit into a register for bit shift loading, and the word is entered into the register in a first order and bit by bit is output from the register in reverse order from the first order.

Die Aufgabe der vorliegenden Erfindung besteht darin, ein Konzept zum einfach und effizient implementierbaren Berechnen eines ganzzahligen Quotienten zu schaffen.The The object of the present invention is to provide a concept for easily and efficiently implementable calculation of an integer quotient to accomplish.

Diese Aufgabe wir durch eine Vorrichtung nach Anspruch 1 oder ein Verfahren nach Anspruch 16 gelöst.This Task we by a device according to claim 1 or a method solved according to claim 16.

Der vorliegenden Erfindung liegt die Erkenntnis zugrunde, daß bei Prozessoren zum Berechnen des Rests Z eines Produkts aus einem Multiplikator und einem Multiplikanden – und optional aus einer Addition dieses Produkts mit einem dritten Operanden multipliziert mit dem Faktor 2n –, die die Bits des Multiplikators in mehreren Verarbeitungsschritten sequentiell abarbeiten oder „abscannen", der ganzzahlige Quotient ohne Eingriff in das Rechenwerk selbst und ferner ohne einen oder einen minimalen Eingriff in den Controlteil, das das Rechenwerk steuert, extrahierbar ist.The present invention is based on the finding that in processors for calculating the remainder Z of a product from a multiplier and a multiplicand - and optionally from an addition of this product with a third operand multiplied by the factor 2 n - which the bits of the multiplier in Process or "scan" several processing steps sequentially, the integer quotient without intervention in the arithmetic unit itself and furthermore without any or minimal intervention can be extracted into the control section that controls the arithmetic unit.

Bei der üblichen modularen Arithmetik ist der ganzzahlige Quotient, also das Ergebnis der DIV-Operation mangels geeigneter Verwendung immer ignoriert worden. Erfindungsgemäß wird der ganzzahlige Quotient unter Verwendung eines Prozessors zum Berechnen des Rests eines Terms bezüglich eines Moduls erhalten, derart, daß in jedem Verarbeitungsschritt, in dem der Prozessor ein bezüglich des Moduls reduziertes Zwischenergebnis berechnet, Reduktionsinformationen einerseits und Ordnungsinformationen andererseits, welche sich auf Stellen des ganzzahligen Quotienten beziehen, die in dem jeweiligen Verarbeitungsschritt betroffen sind, mitprotokolliert werden. Dann, nachdem die Multiplikatorbits mittels der mehrere Ver arbeitungsschritte abgearbeitet sind, werden die mitprotokollierten Reduktionsinformationen und Ordnungsinformationen von den jeweiligen Schritten ausgewertet, um daraufhin ohne aufwendige arithmetische Operationen den ganzzahligen Quotienten zu erhalten.at the usual modular arithmetic is the integer quotient, i.e. the result the DIV operation is always ignored due to a lack of appropriate use Service. According to the invention, the integer Quotient using a processor to calculate the remainder of a term regarding of a module, such that in each processing step, in which the processor is one regarding of the module reduced intermediate result calculated, reduction information on the one hand and order information on the other, which relates to Digits of the integer quotient related to each Processing step are affected, are logged. Then, after the multiplier bits by means of the multiple processing steps the reduction information logged is processed and order information is evaluated by the respective steps, to the integer without complex arithmetic operations To get quotients.

Bei einem bevorzugten Ausführungsbeispiel werden parallel zum Verarbeiten der Multiplikatorbits durch die Verarbeitungseinrichtung Protokollregister geführt, wobei Bits bestimmter Ordnung, die durch die Ordnungsinformationen bestimmt ist, unter Verwendung der Reduktionsinformationen nach jedem Verarbeitungsschritt gesetzt oder nicht gesetzt werden. Werden zwei oder mehrere solche Protokollregister eingesetzt, so ist die Einrichtung zum Auswerten in der Lage, durch einfaches Addieren oder Subtrahieren der Protokollregister nach der Abarbeitung sämtlicher Multiplikatorbits den ganzzahligen Quotienten zu erhalten.at a preferred embodiment in parallel with the processing of the multiplier bits by the processing device Log register kept, being bits of certain order, determined by the ordering information is determined using the reduction information after be set or not set in each processing step. Become two or more such protocol registers are used Device capable of evaluating, simply by adding or subtract the log registers after all have been processed Multiplier bits to get the integer quotient.

Die Erfindung ist insbesondere dahin gehend vorteilhaft, daß keine Informationen benötigt werden, die über Informationen hinausgehen, die ohnehin von einer solchen Verarbeitungseinrichtung zum Berechnen der Modulo-Operation ausgegeben werden. Der ganzzahlige Quotient wird somit gewissermaßen „kostenlos" (insbesondere bezüglich der Rechenzeit) und ohne Eingriffe in das Rechenwerk der Verarbeitungseinrichtung erhalten. Lediglich eine Protokollierungseinrichtung muß vorgesehen werden, die die benötigten Reduktionsinformationen oder Ordnungsinformationen am Ende jedes Verarbeitungsschrittes aus dem Controlteil extrahiert.The Invention is particularly advantageous in that none Information needed be that over Information goes beyond that of such processing equipment anyway to calculate the modulo operation. The integer The quotient is thus "free of charge" to a certain extent (especially with regard to the Computing time) and without intervention in the arithmetic unit of the processing device receive. Only a logging device has to be provided be the ones needed Reduction information or order information at the end of each Processing step extracted from the control part.

Bei einer abschließenden Auswertung der Protokollinformationen durch eine Auswertungseinrichtung ergibt sich dann der ganzzahlige Quotient, ohne daß eine einzige Änderung am festverdrahteten Rechenwerk nötig war.at a final one Evaluation of the protocol information by an evaluation device the integer quotient then results without a single change on the hardwired calculator was.

Diese Tatsache ist insbesondere dahin gehend von Bedeutung, daß kryptographische Rechenwerke typischerweise Langzahl- Rechenwerke sind, die auf bestimmte Operationen, wie z. B. die modulare Multiplikation, optimiert sind. Eingriffe in solche Langzahl-Rechenwerke, die typischerweise Addierer mit 1024 oder mehr Einzeladdierern oder „Bit-Slices" umfassen, sind im Entwurf aufwendig, fehleranfällig und dahin gehend nachteilhaft, daß wieder komplette Funktionstests durchzuführen sind. Insbesondere für sicherheitskritische Anwendungen, für die üblicherweise Kryptographie-Algorithmen eingesetzt werden, ist der Sicherheitsaspekt von besonderer Bedeutung, da sensible Informationen, wie beispielsweise Geldbeträge oder persönliche Informationen, verarbeitet werden, wenn z. B. an Smartcards oder allgemein Chipkarten gedacht wird.This The fact is of particular importance in that cryptographic Arithmetic units are typically long-number arithmetic units that are specific Operations such as B. the modular multiplication are optimized. Interventions in such long number arithmetic units, which are typically added with 1024 or more individual adders or "bit slices" are in Draft complex, prone to errors and disadvantageous in that again complete function tests must be carried out. Especially for safety-critical ones Applications, for the usual Cryptography algorithms are used is the security aspect of particular importance as sensitive information, such as amounts of money or personal Information processed when e.g. B. on smart cards or is generally thought of smart cards.

Das erfindungsgemäße Verfahren ist ferner dahin gehend vorteilhaft, daß es außerdem wenig rechenzeitintensiv ist, was insbesondere dann von Bedeutung ist, wenn aufwendige kryptographische Algorithmen zu berechnen sind, und zwar mit Prozessoren, die aufgrund der Tatsache, daß ihre Chipfläche begrenzt ist, wenn wieder an Chipkarten gedacht wird, begrenzte Rechen- und Speicherressourcen haben.The inventive method is also advantageous in that it also requires little computing time is what is particularly important when complex cryptographic Algorithms are to be calculated, using processors based on the fact that their chip area is limited when thinking again of chip cards Have computing and storage resources.

Bevorzugte Ausführungsbeispiele der vorliegenden Erfindung werden nachfolgend bezug nehmend auf die beiliegenden Zeichnungen detailliert erläutert. Es zeigen:preferred embodiments of the present invention are hereinafter referred to the accompanying drawings explained in detail. Show it:

1 ein Blockschaltbild einer erfindungsgemäßen Vorrichtung zum Berechnen eines ganzzahligen Quotienten; 1 a block diagram of an inventive device for calculating an integer quotient;

2 ein Ablaufdiagramm eines einfachen modularen Multiplikationsalgorithmus; 2 a flow diagram of a simple modular multiplication algorithm;

3 ein Ablaufdiagramm des in 2 gezeigten einfachen Multiplikationsalgorithmus, bei dem neben der Modulo-Operation auch die DIV-Operation ausgeführt wird; 3 a flowchart of the in 2 simple multiplication algorithm shown, in which the DIV operation is carried out in addition to the modulo operation;

4 ein zusammengefaßtes Ablaufdiagramm des bekannten ZDN-Algorithmus; 4 a summarized flow diagram of the known ZDN algorithm;

5 ein Ablaufdiagramm des ZDN-Algorithmus zum zusätzlichen Berechnen des ganzzahligen Quotienten; und 5 a flowchart of the ZDN algorithm for additional calculation of the integer quotient; and

6 ein detailliertes Ablaufdiagramm des bekannten ZDN-Algorithmus. 6 a detailed flow diagram of the known ZDN algorithm.

1 zeigt ein Blockschaltbild einer erfindungsgemäßen Vorrichtung zum Berechnen eines ganzzahligen Quotienten eines Terms T bezüglich eines Moduls N, wobei der Term ein Produkt aus einem binären Multiplikator M und einem binären Multiplikanden C aufweist. Die Vorrichtung umfaßt eine Verarbeitungseinrichtung 10, die sich in ein Rechenwerk 10a und ein Controlteil 10b aufgliedert. Das Rechenwerk besteht typischerweise aus einem Langzahladdierer für zwei oder mehr Operanden, während der Controlteil 10b ausgebildet ist, um das Rechenwerk zu steuern, damit dasselbe sequentiell die Multiplikatorbits abarbeitet und schließlich, wenn alle Multiplikatorbits abgearbeitet sind, das Ergebnis Z der modularen Reduktion des Terms, der das Produkt C·M aufweist, liefert. 1 shows a block diagram of an inventive device for calculating an integer quotient of a term T with respect to a module N, the term being a product of a binary multiplier M and a binary multipli Candidate C. The device comprises a processing device 10 that are in an arithmetic unit 10a and a control part 10b breaks down. The arithmetic unit typically consists of a long number adder for two or more operands, while the control part 10b is designed to control the arithmetic unit so that it sequentially processes the multiplier bits and finally, when all multiplier bits have been processed, delivers the result Z of the modular reduction of the term having the product C · M.

Die erfindungsgemäße Vorrichtung umfaßt ferner eine Protokollierungseinrichtung 12 zum Protokollieren von Reduktionsinformationen in den jeweiligen Schritten und zum Protokollieren von Ordnungsinformationen über durch eine oder mehrere durch den jeweiligen Verarbeitungsschritt betroffene Stellen des ganzzahligen Quotienten. Die Protokollierungseinrichtung 12 ist wirksam mit dem Controlteil 10b gekoppelt, um die Protokollierungsinformationen für jeden Schritt zu extrahieren. Wenn der Controlteil 10b einer ferner vorgesehenen Auswertungseinrichtung 14 signalisiert, daß alle Multiplikatorbits abgearbeitet sind und das Endergebnis Z vorliegt, greift die Auswertungseinrichtung 14 auf die Protokollierungseinrichtung 12 zu, um die Reduktionsinformationen und die Ordnungsinfor mationen auszuwerten, um schließlich den ganzzahligen Quotienten Q auszugeben.The device according to the invention further comprises a logging device 12 for logging reduction information in the respective steps and for logging ordering information about positions of the integer quotient affected by one or more digits affected by the respective processing step. The logging facility 12 is effective with the control part 10b coupled to extract the logging information for each step. If the control part 10b an evaluation device also provided 14 signals that all multiplier bits have been processed and the end result Z is present, the evaluation device intervenes 14 to the logging facility 12 to evaluate the reduction information and the order information in order to finally output the integer quotient Q.

Hardware-technisch wird es bevorzugt, die modulare Reduktion durch Subtraktion des Moduls durchzuführen, wobei in einem Verarbeitungsschritt je nach Implementierung des Rechenwerks 10a eine oder mehrere Modul-Subtraktionen stattfinden können. Werden, wie es nachfolgend erläutert wird, Multiplikations-Look-Ahead-Algorithmen und ferner noch Reduktions-Look-Ahead-Algorithmen eingesetzt, so kann in einem Verarbeitungsschritt der Fall auftreten, daß ein Modul zu dem Zwischenergebnis hinzuaddiert wird. Diese Reduktionsinformationen, also ob ein Modul subtrahiert wird, ob ein Modul addiert wird, oder ob, was ebenfalls auftreten kann, weder eine Addition des Moduls noch eine Subtraktion des Moduls auftritt, können von der Protokollierungseinrichtung 12 in jedem Verarbeitungsschritt protokolliert werden. Die Ordnungsinformationen beziehen sich darauf, welche Stellen des Quotienten durch den jeweiligen Verarbeitungsschritt tangiert werden. So werden die Multiplikatorbits typischerweise von oben, also vom MSB aus (MSB = Most Significant Bit) ausgehend abgearbeitet oder abgescannt. Die Ordnungsinformationen können bei einfacheren modularen Multiplikationsalgorithmen direkt der Ordnung des in einem Schritt betrachteten Multiplikatorbits entsprechen. Wird lediglich ein Multiplikations-Look-Ahead-Algorithmus eingesetzt, so werden in einem Verarbeitungsschritt mehrere Bits des Multiplikators betrachtet und verarbeitet. In diesem Fall werden die Ordnungsinformationen von den mehreren Bits des Multiplikators abhängen. Im Falle gekoppelter Multiplikations-Look-Ahead-Algorithmen und Reduktions-Look-Ahead-Algorithmen hängen die Ordnungsinformationen indirekt von der Ordnung der in einem Verarbeitungsschritt betrachteten Multiplikatorbits ab. Dieser Zusammenhang ist, wie es für Look-Ahead-Algorithmen typisch ist, einerseits datenabhängig und andererseits von der Vorgeschichte bestimmt.In terms of hardware, it is preferred to carry out the modular reduction by subtracting the module, in one processing step depending on the implementation of the arithmetic unit 10a one or more module subtractions can take place. If, as will be explained below, multiplication look-ahead algorithms and furthermore reduction look-ahead algorithms are used, the case may occur in one processing step that a module is added to the intermediate result. This reduction information, that is to say whether a module is subtracted, whether a module is added, or whether, which can also occur, neither an addition of the module nor a subtraction of the module occurs can be obtained from the logging device 12 be logged in every processing step. The order information relates to which positions of the quotient are affected by the respective processing step. The multiplier bits are typically processed or scanned from above, i.e. starting from the MSB (MSB = Most Significant Bit). In the case of simpler modular multiplication algorithms, the order information can correspond directly to the order of the multiplier bits considered in one step. If only a multiplication look-ahead algorithm is used, several bits of the multiplier are considered and processed in one processing step. In this case, the ordering information will depend on the multiple bits of the multiplier. In the case of coupled multiplication look-ahead algorithms and reduction look-ahead algorithms, the order information depends indirectly on the order of the multiplier bits considered in one processing step. As is typical of look-ahead algorithms, this relationship is on the one hand data-dependent and on the other hand determined by the previous history.

Bei einem bevorzugten Ausführungsbeispiel der vorliegenden Erfindung ist die Protokollierungseinrichtung aufgrund der Hardware-technischen einfachen Implementierbarkeit als Registersatz mit einem oder mehreren Registern ausgebildet, welche Schritt für Schritt beschrieben werden und schließlich, nach der Verarbeitung des kompletten Multiplikators durch die Auswertungseinrichtung in geeigneter Weise ausgewertet, wie z. B. addiert oder subtrahiert, werden, um den ganzzahligen Quotienten Q zu erhalten.at a preferred embodiment of the The present invention is based on the logging device the hardware-technical simple implementation as a register set trained with one or more registers, which step by step be described and finally, after the processing of the complete multiplier by the evaluation device evaluated in a suitable manner, such as. B. added or subtracted, to get the integer quotient Q.

Im nachfolgenden wird Bezug nehmend auf 2 ein einfacher Multiplikationsalgorithmus dargestellt, der auch als „Schulbuchalgorithmus" bekannt ist. Dieser Algorithmus erhält als Eingabe den Modul N, den Multiplikanden C, welcher definitionsgemäß kleiner als der Modul N ist, und den Multiplikator M, der aus binären Multiplikatorbits M0 (lsb) bis Mm–1 (msb) besteht und größer als 0 ist. Dieser Algorithmus liefert als Ausgabe Z = C × M mod N. In einem ersten Initialisierungsschritt wird die Ordnung des Multiplikators i auf m – 1 initialisiert. Ferner wird das Z-Register, das während der Verarbeitung als Zwischenergebnisregister und schließlich als Endergebnisregister fungiert, ebenfalls initialisiert (20). Hierauf wird in einer Stufe 21 untersucht, ob das gerade betrachtete Bit des Multiplikators, also Mi gleich 0 oder 1 ist. Ist das Bit gleich 0, so wird lediglich eine Multiplikation mit dem Faktor 2 oder eine Verschiebung um eine Stelle im Z-Register durchgeführt (22a). Ist das Bit dagegen gleich 1, so wird der Inhalt des Registers um eine Stelle nach links verschoben, was einer Multiplikation mit 2 entspricht, und es wird ferner, wie es aus einem Block 22b ersichtlich ist, der Multiplikand C hinzuaddiert. Die modulare Reduktion findet dahin gehend statt, daß zunächst in einer Stufe 23 untersucht wird, ob der Inhalt des Zwischenergebnisregisters Z größer oder gleich N ist. Wird diese Frage bejaht, so wird ein erstes Mal der Modul N von dem Zwischenergebnisregister Z subtrahiert (24). Dann wird erneut untersucht, ob der jetzige Inhalt des Zwischenergebnisregisters Z größer oder gleich N ist (25). Wird diese Frage wieder bejaht, so wird ein weiteres Mal der Modul N subtrahiert (26). Dieses Prozedere wird wiederholt, bis i gleich 0 ist, was in einem Block 27 überprüft wird. Wird die Frage mit Ja beantwortet, so ist der Algorithmus zu Ende. Wird diese Frage dagegen mit Nein beantwortet, so wird i in einem Block 28 um „1" dekrementiert, und es wird eine weitere Iterationsschleife unter Verwendung der Blöcke 21 bis 27 durchlaufen.In the following, reference is made to 2 a simple multiplication algorithm is shown, which is also known as the "textbook algorithm". This algorithm receives as input the module N, the multiplicand C, which by definition is smaller than the module N, and the multiplier M, which consists of binary multiplier bits M 0 (lsb) until M m-1 (msb) exists and is greater than 0. This algorithm delivers Z = C × M mod N as output. In a first initialization step, the order of the multiplier i is initialized to m - 1. Furthermore, the Z register , which acts as an intermediate result register during processing and ultimately as a final result register, also initialized ( 20 ). This is done in one stage 21 examines whether the bit of the multiplier just considered, ie M i is 0 or 1. If the bit is 0, then only a multiplication by a factor of 2 or a shift by one position in the Z register is carried out ( 22a ). If, on the other hand, the bit is 1, the content of the register is shifted to the left by one position, which corresponds to a multiplication by 2, and it also becomes like a block 22b it can be seen that the multiplicand C is added. The modular reduction takes place in such a way that initially in one stage 23 it is examined whether the content of the intermediate result register Z is greater than or equal to N. If this question is answered in the affirmative, the module N is subtracted for the first time from the intermediate result register Z ( 24 ). Then it is checked again whether the current content of the intermediate result register Z is greater than or equal to N ( 25 ). If this question is answered in the affirmative, module N is subtracted again ( 26 ). This procedure is repeated until i equals 0, which is in a block 27 is checked. If the question is answered with yes, the algorithm has ended. If, on the other hand, this question is answered with no, then i becomes egg a block 28 decremented by "1" and there is another iteration loop using the blocks 21 to 27 run through.

Nachfolgend wird anhand von 3 die erfindungsgemäße Erweiterung des in 2 gezeigten Algorithmus, also die Funktionalität der Protokollierungseinrichtung 12 von 1 und der Auswertungseinrichtung 14 von 1 erläutert. Elemente in 3, die die gleichen Bezugszeichen tragen wie in 2 haben dieselbe Funktion und werden nicht erneut erläutert. Die Protokollierungseinrichtung umfaßt bei einem bevorzugten Ausführungsbeispiel der vorliegenden Erfindung zur Erweiterung des in 2 gezeigten bekannten „Schulbuchalgorithmus" zwei Hilfsregister Q und Q', die in einem Schritt 20' initialisiert werden. Abhängig von der Beantwortung der Frage im Block 23, also ob das Zwischenergebnis Z, das durch den Schritt 22a und den Schritt 22b erhalten worden ist, größer oder gleich N ist, werden Bits der Ordnung i in dem ersten Hilfsregister Qi oder im zweiten Hilfsregister Q'i mit „0" beschrieben. Die Reduktionsinformationen bestehen hier in den „Nullen", die an durch die Ordnungsinformationen bestimmten Stellen i der Register eingetragen werden. War das Zwischenergebnis Z kleiner als N, wie es im Block 23 bestimmt worden ist, wurde keine Modulsubtraktion durchgeführt, was sich unmittelbar darin äußert, daß die entsprechenden Hilfsregisterbits gleich 0 gesetzt werden. Wird dagegen eine Modulsubtraktion (Schritt 24) durchgeführt, so wird das Bit i des ersten Hilfsregisters Q auf 1 gesetzt, während das Bit des zweiten Hilfsregisters Q'i auf 0 gesetzt wird, wie es in einem Block 30b zu sehen ist.The following is based on 3 the inventive expansion of the in 2 algorithm shown, ie the functionality of the logging device 12 of 1 and the evaluation device 14 of 1 explained. Elements in 3 that have the same reference numerals as in 2 have the same function and are not explained again. In a preferred exemplary embodiment of the present invention, the logging device comprises for expanding the in 2 shown known "textbook algorithm" two auxiliary registers Q and Q 'in one step 20 ' be initialized. Depending on the answer to the question in the block 23 , so whether the interim result Z that by the step 22a and the step 22b obtained, is greater than or equal to N, bits of order i in the first auxiliary register Q i or in the second auxiliary register Q ' i are written with "0". The reduction information here consists of the "zeros" which are determined by the ordering information Make entries in the register. The intermediate result Z was less than N, as it was in the block 23 no module subtraction has been determined, which is immediately evident in the fact that the corresponding auxiliary register bits are set to 0. If, on the other hand, a module subtraction (step 24 ) is carried out, the bit i of the first auxiliary register Q is set to 1, while the bit of the second auxiliary register Q ' i is set to 0, as in a block 30b you can see.

Wird eine zweite Modulsubtraktion durchgeführt (Block 26 von 3), so werden sowohl das Bit i des ersten Hilfsregisters Q als auch das Bit i des zweiten Hilfsregisters Q' auf 1 gesetzt, wie es durch einen Block 30c zu sehen ist. Dieses Prozedere wird für jeden Verarbeitungsschritt durchgeführt, bis im Block 27 bestimmt worden ist, daß i gleich 0 ist. Dann wird die Auswertungseinrichtung 14 von 1 aktiv, um die beiden Register Q und Q' zu addieren, wie es in einem Block 32 dargestellt ist, um als Ergebnis schließlich den ganzzahligen Quotienten Q zu erhalten. Die Funktionalität der Protokollierungseinrichtung wird somit durch die Blöcke 30a, 30b, 30c implementiert, während die Funktionalität durch die Auswertungseinrichtung 14 von 1 durch den Block 32 in 3 implementiert wird.If a second module subtraction is carried out (block 26 of 3 ), both the bit i of the first auxiliary register Q and the bit i of the second auxiliary register Q 'are set to 1, as is done by a block 30c you can see. This procedure is carried out for each processing step, up to the block 27 it has been determined that i is 0. Then the evaluation device 14 of 1 active to add the two registers Q and Q 'as is in a block 32 is shown in order to finally obtain the integer quotient Q as a result. The functionality of the logging device is thus determined by the blocks 30a . 30b . 30c implemented while the functionality by the evaluation facility 14 of 1 through the block 32 in 3 is implemented.

Aus 3 wird ersichtlich, daß keine Änderung am grundsätzlichen Algorithmus erforderlich ist, um die Quotienteninformation zu erhalten. Im Hinblick auf 1 bedeutet dies, daß sowohl das Rechenwerk 10a als auch der Controlteil 10b der Verarbeitungseinrichtung 10 nicht geändert werden müssen und somit zur Berechnung der Quotienteninformation nicht neu entwickelt und getestet werden müssen.Out 3 it can be seen that no change to the basic algorithm is required to obtain the quotient information. With regard 1 this means that both the arithmetic unit 10a as well as the control part 10b the processing device 10 do not have to be changed and therefore do not have to be newly developed and tested to calculate the quotient information.

Aus 3 wird ferner ersichtlich, daß das Mit-Protokollieren der Reduktionsinformationen und der Ordnungsinformationen keinen weiteren Rechenschritt benötigt. Lediglich die Auswertungseinrichtung, die die beiden Register addieren muß, benötigt einen Addierzyklus, der jedoch nicht ins Gewicht fällt, wenn bedacht wird, daß die Größen N, C, M z. B. 1024 Stellen haben, was bei dem in 3 gezeigten Algorithmus bedeutet, daß die Iterationsschleife 1024 Mal durchlaufen werden muß.Out 3 it can also be seen that the logging of the reduction information and the order information does not require any further calculation step. Only the evaluation device, which has to add the two registers, requires an addition cycle, which, however, is not significant if it is considered that the quantities N, C, M z. B. 1024 digits, which in 3 algorithm shown means that the iteration loop must be run through 1024 times.

Der in 3 gezeigte Algorithmus kann einfach dahin gehend erweitert werden, um nicht nur den Term C × M zu verarbeiten, sondern einen Term C × M + D × 2n. Dies kann einfach dadurch erreicht werden, daß in dem Initialisierungsschritt 20' das Zwischenergebnis Z nicht auf 0 initialisiert wird, sondern auf D initialisiert wird. Aus diesem Grund trägt die Operation, die durch die in 3 gezeigte Schaltung ausgeführt wird, den Namen Initialisierungs-MMD-Operation, wenn das Zwischenergebnisregister Z vor dem ersten Iterationsschritt auf einen Wert D initialisiert wird. In diesem Zusammenhang steht MMD für MultModDiv, um anzuzeigen, daß der in 3 gezeigte Algorithmus sowohl das modular reduzierte Ergebnis des Terms als auch den ganzzahligen Quotienten des Terms C × M + D × 2n liefert, wobei sich für D gleich 0 die übliche Multiplikation ergibt.The in 3 The algorithm shown can simply be expanded to process not only the term C × M, but a term C × M + D × 2 n . This can easily be achieved in that in the initialization step 20 ' the intermediate result Z is not initialized to 0, but is initialized to D. For this reason, the operation carried out by those in 3 shown circuit is executed, the name initialization MMD operation when the intermediate result register Z is initialized to a value D before the first iteration step. In this context MMD stands for MultModDiv to indicate that the in 3 The algorithm shown provides both the modularly reduced result of the term and the integer quotient of the term C × M + D × 2 n , where the usual multiplication results for D equal to 0.

4 zeigt eine etwas komprimierte Darstellung von 6, nämlich den bekannten ZDN-Algorithmus, der vorstehend erläutert worden ist. Ein Initialisierungsblock 40 zeigt die für die vorliegende Erfindung bedeutsamen Größen i, Z und c. Wieder kann Z entweder auf 0 oder auf D initialisiert werden, um entweder eine MMD-Operation oder eine Initialisierungs-MMD-Operation auszuführen. 4 shows a somewhat compressed representation of 6 , namely the known ZDN algorithm, which has been explained above. An initialization block 40 shows the quantities i, Z and c which are important for the present invention. Again, Z can be initialized to either 0 or D to perform either an MMD operation or an initialization MMD operation.

Wie es durch einen nachfolgenden Block dargestellt ist, erzeugt die ZDN-Einrichtung 910, 920, 930 von 6 einen Multiplikations-Verschiebungswert sZ, der üblicherweise immer größer 0 ist, einen Multiplikator-Bit-Wert sM, der anzeigt, wie viele Multiplikator-Bits in einem Look-Ahead-Schritt verarbeitet worden sind, den Reduktions-Verschiebungswert sN, sowie den Multiplikations-Look-Ahead-Parameter a und den Reduktions-Look-Ahead-Parameter b. Die Multiplikator-Bit-Ordnungszahl i wird nach jedem Schritt um sM reduziert. Die Größe c gibt an, an welcher Stelle eines Puffers für den Modul das Komma des Moduls, also das LSB des ursprünglichen Moduls steht. Die Größe c wird nach jedem Schritt durch c + sN geändert.As represented by a subsequent block, the ZDN facility creates 910 . 920 . 930 of 6 a multiplication shift value s Z , which is usually always greater than 0, a multiplier bit value s M which indicates how many multiplier bits have been processed in a look-ahead step, the reduction shift value s N , and the multiplication look-ahead parameter a and the reduction look-ahead parameter b. The multiplier bit ordinal number i is reduced by s M after each step. The size c specifies the position of a buffer for the module with the comma of the module, i.e. the LSB of the original module. The size c is changed by c + s N after each step.

In einem Schritt 940 findet dann die Modul-Verschiebung statt, die durch Multiplikation des alten Inhalts des Modul-Registers N mit einem Faktor 2s N darstellbar ist. In einem Schritt 950 findet dann die bereits Bezug nehmend auf 6 beschriebene 3-Operanden-Addition statt, die so lange fortgesetzt wird, bis i gleich 0 ist und c ebenfalls gleich 0 ist (Block 42). Ist dies der Fall, wird in einem Schritt 44 untersucht, ob das Zwischenergebnisregister Z kleiner als 0 ist. Ist dies der Fall, so wird noch einmal der Modul N hinzuaddiert (Block 46), da der Rest der modularen Multiplikation, also Z, per Definition größer als 0 sein muß. Wird dagegen Block 42 mit Ja beantwortet, wo wird eine weitere Iteration durchgeführt, um eines oder mehrere Multiplikatorbits, je nach Look-Ahead-Eigenschaft des Multiplikators zu verarbeiten.In one step 940 then the module shift takes place, by multiplying the old content of the module register N by a factor 2 s N can be represented. In one step 950 then find the one already referring to 6 described 3-operand addition instead, which continues until i is 0 and c is also 0 (block 42 ). If so, it will be in one step 44 examines whether the intermediate result register Z is less than 0. If this is the case, the module N is added again (block 46 ), since the rest of the modular multiplication, i.e. Z, must by definition be greater than 0. In contrast, becomes block 42 answered yes, where is another iteration carried out to process one or more multiplier bits, depending on the look-ahead property of the multiplier.

Im nachfolgenden wird anhand von 5 die erfindungsgemäße Erweiterung des in den 4 und 6 gezeigten bekannten ZDN-Algorithmus dargestellt. Gleiche Bezugszeichen in den 4 und 5 bedeuten gleiche Elemente. Aus diesem Grund werden diese Elemente nicht noch einmal erläutert. Der durch einen Block 910, 920, 930 bezeichnete ZDN-Prozessor liefert wieder sZ, sN, a und b. Hierauf wird der in dem Initialisierungsblock 40' initialisierte Quotienten-Ordnungswert j, welcher auf m initialisiert worden ist, in einem Block 50 verringert, und zwar um die Differenz aus dem Multiplikations-Verschiebungswert sZ und dem Reduktions-Verschiebungswert sN. Stellt der Multiplikations-Look-Ahead-Algorithmus, welcher für den Multiplikations-Verschiebungswert sZ verantwortlich ist, fest, daß das Zwischenergebnis nach oben verschoben werden soll, also zu höherwertigen Bits hin, so wird dies hinsichtlich der Ordnungsinformationen der Protokollierungseinrichtung, welche durch Block 50 dargestellt ist, dahin gehend berücksichtigt, daß geringerwertige Bits des Quotienten betroffen sind. Die Ordnung eines Quotientenbits im aktuellen Schritt ist daher um (sZ – sN) niedriger als die Ordnung des entsprechenden Quotientenregisterbits aus dem vorherigen Schritt.The following is based on 5 the extension of the invention in the 4 and 6 known ZDN algorithm shown. The same reference numerals in the 4 and 5 mean the same elements. For this reason, these elements are not explained again. The one through a block 910 . 920 . 930 designated ZDN processor again delivers s Z , s N , a and b. Then the in the initialization block 40 ' initialized quotient order value j, which has been initialized to m, in one block 50 reduced, namely by the difference between the multiplication shift value s Z and the reduction shift value s N. If the multiplication look-ahead algorithm, which is responsible for the multiplication shift value s Z , determines that the intermediate result is to be shifted upwards, that is to say to higher-order bits, this becomes clear with regard to the order information of the logging device, which is indicated by block 50 is shown, taking into account that less significant bits of the quotient are affected. The order of a quotient bit in the current step is therefore (s Z - s N ) lower than the order of the corresponding quotient register bit from the previous step.

Ist dagegen ein positiver Reduktions-Verschiebungswert sN vorhanden, so bedeutet dies, daß der Inhalt des Modul-Registers N um den Faktor 2s N größer ist als im vorherigen Schritt. Wenn ein solcher „vergrößerter" Modul subtrahiert wird, was durch einen Reduktions-Look-Ahead-Parameter b von „–1" bewirkt wird, so wird dies in den Ordnungsinformationen (Block 50, Parameter j) dahin gehend berücksichtigt, daß höherwertige Bits des ganzzahligen Quotienten betroffen sind, als im vorherigen Iterationsschritt.If, on the other hand, there is a positive reduction shift value s N , this means that the content of the module register N is greater by a factor of 2 s N than in the previous step. If such an "enlarged" module is subtracted, which is brought about by a reduction look-ahead parameter b of "-1", this is shown in the order information (block 50 , Parameter j) is taken into account to the effect that higher-order bits of the integer quotient are affected than in the previous iteration step.

Die Reduktionsinformationen sind tabellarisch in einem Block 52 von 5 dargestellt. Die Protokollierungseinrichtung verwendet wieder zwei Hilfsregister Q und Q', wobei die Bitwerte in den beiden Registern von dem Reduktions-Parameter b abhängen. Ist b durch die ZDN-Einrichtung zu 0 berechnet worden, so findet überhaupt keine Reduktion statt. Daher werden die Bits der Ordnung j beider Register Q und Q' auf 0 gesetzt. Ist der Reduktions-Parameter b dagegen gleich „1", so wurde in der 3-Operanden-Operation zum aktuellen Zwischenergebnis ein Modul hinzuaddiert. Dies wird im Block 52 dadurch berücksichtigt, daß das entsprechende Bit j des zweiten Hilfsregisters Q' zu 1 gesetzt wird, während das entsprechende Bit des ersten Hilfsregisters zu 0 gesetzt wird. Wird dagegen ein Modul subtrahiert, also tatsächlich eine Reduktion durchgeführt, was durch einen Reduktions-Parameter von „–1" dargestellt wird, so äußert sich dies in den beiden Hilfsregistern dahin gehend, daß das entsprechende Bit j des ersten Hilfsregisters Q zu 1 gesetzt wird, während das entsprechende Bit j des zweiten Hilfsregisters Q' zu 0 gesetzt wird. In einem Block 54 wird eine Korrektur gewissermaßen ähnlich zu dem Fall von b gleich 1 durchgeführt. Wenn in dem Block 44 herausgefunden worden ist, daß das Zwischenergebnis Z nach der Abarbeitung sämtlicher Multiplikatorbits kleiner 0 war, so bedeutet dies, daß eine Reduktion zu viel stattgefunden hat. Z wird im Block 46 daher um N erhöht. Dies wird in den Reduktionsinformationen dahin gehend berücksichtigt, daß im Block 54 das niedrigste Bit Q0 des zweiten Hilfsregisters Q' zu 1 gesetzt wird.The reduction information is tabulated in a block 52 of 5 shown. The logging device again uses two auxiliary registers Q and Q ', the bit values in the two registers depending on the reduction parameter b. If b has been calculated by the ZDN facility to be 0, no reduction takes place at all. Therefore, the order j bits of both registers Q and Q 'are set to 0. If, on the other hand, the reduction parameter b is "1", a module was added to the current intermediate result in the 3-operand operation. This is done in the block 52 thereby taking into account that the corresponding bit j of the second auxiliary register Q 'is set to 1, while the corresponding bit of the first auxiliary register is set to 0. If, on the other hand, a module is subtracted, that is to say a reduction is actually carried out, which is represented by a reduction parameter of “-1”, this is expressed in the two auxiliary registers to the effect that the corresponding bit j of the first auxiliary register Q is set to 1 while the corresponding bit j of the second auxiliary register Q 'is set to 0. In a block 54 a correction is carried out in a manner similar to the case where b is 1. If in the block 44 If it has been found that the intermediate result Z after the processing of all multiplier bits was less than 0, this means that a reduction has occurred too much. Z is in the block 46 therefore increased by N. This is taken into account in the reduction information in that in the block 54 the lowest bit Q 0 of the second auxiliary register Q 'is set to 1.

Die Auswertungseinrichtung 14 von 1 wird schließlich dahin gehend aktiv, daß sie von dem ersten Hilfsregister Q das zweite Hilfsregister Q' abzieht (Block 56), um den ganzzahligen Quotienten Q in binärer Form zu erhalten. Die Subtraktion im Block 56 ist dahin gehend zu verstehen, daß das Register Q einen Zählwert für alle tatsächlich durchgeführten Modulsubtraktionen in der 3-Operanden-Operation umfaßt, wobei diese Zahl zu hoch ist, wenn Z kleiner als 0 wird (Block 44), so daß der Inhalt des zweiten Hilfsregisters Q' und insbesondere das niederstwertige Bit, das im Block 54 gesetzt wird, wieder abgezogen werden muß. Das selbe trifft für den Fall zu, bei dem der Reduktions-Parameter b gleich 1 ist. Hier wird kein Modul subtrahiert, sondern ein Modul addiert. Dies muß im ganzzahligen Quotienten wieder dahin gehend berücksichtigt werden, daß das Hilfsregister von dem ersten Hilfsregister subtrahiert wird. Für Fachleute ist es ersichtlich, daß, wenn die Bits des zweiten Hilfsregisters Q' statt auf „+1" auf „ –1" gesetzt werden würden, in dem Block 56 durch die Auswertungseinrichtung keine Subtraktion, sondern eine Addition vorgenommen werden müßte.The evaluation facility 14 of 1 finally becomes active in that it subtracts the second auxiliary register Q 'from the first auxiliary register Q (block 56 ) to get the integer quotient Q in binary form. The subtraction in the block 56 It should be understood that the register Q contains a count for all module subtractions actually performed in the 3-operand operation, this number being too high if Z becomes less than 0 (block 44 ), so that the content of the second auxiliary register Q 'and in particular the least significant bit that is in the block 54 is set, must be deducted again. The same applies to the case where the reduction parameter b is 1. No module is subtracted here, but a module is added. This must again be taken into account in the integer quotient so that the auxiliary register is subtracted from the first auxiliary register. It will be apparent to those skilled in the art that if the bits of the second auxiliary register Q 'were set to "-1" instead of "+1", in the block 56 no subtraction, but an addition would have to be carried out by the evaluation device.

Aus dem Vorstehenden ist für Fachleute ersichtlich, daß die Erfindung besonders für eine Hardwaretechnische Realisierung geeignet ist. Dies ist vorteilhaft, da eine Software-technische Realisierung des MMD-Befehls Performance- und Verwaltungsaufwand kostet.Out the above is for Experts can see that the Invention especially for a hardware implementation is suitable. This is beneficial because a software-technical implementation of the MMD command performance and administration costs.

Die Erfindung ersetzt eine solche Software-technische Realisierung. Insbesondere kann das vorgestellte Konzept günstig in bestehende Kryptoprozessoren integriert werden, wobei hier nur VHDL-Änderungen des Krypto-Controllers nötig sind, um sowohl die Protokollierungseinrichtung als auch die Auswertungseinrichtung in die bestehende Verarbeitungseinrichtung einzufügen. Der üblicherweise vorhandene modulare Multiplikationsbefehl kann somit einfach und wenig fehleranfällig um das Er gebnis der DIV-Operation, also den ganzzahligen Quotienten, ergänzt werden.The invention replaces such a software-technical implementation. In particular, it can The concept presented can be inexpensively integrated into existing crypto processors, only VHDL changes of the crypto controller being necessary here in order to insert both the logging device and the evaluation device into the existing processing device. The modular multiplication command that is usually present can thus be supplemented easily and less prone to errors by the result of the DIV operation, that is to say the integer quotient.

1010
Verarbeitungseinrichtungprocessing device
10a10a
Rechenwerkcalculator
10b10b
ControlteilControl part
1212
Protokollierungseinrichtunglogging equipment
1414
Auswertungseinrichtungevaluation device
2020
Initialisierungsschrittinitialization
20'20 '
Initialisierunginitialization
2121
BituntersuchungsschrittBituntersuchungsschritt
22a, 22b22a, 22b
ZwischenergebnisberechnungInterim results calculation
2323
Erster Modulvergleichfirst module comparison
2424
Erste ModulsubtraktionFirst modulus subtraction
2525
Zweiter Modulvergleichsecond module comparison
2626
Zweite ModulsubtraktionSecond modulus subtraction
2727
IndexuntersuchungIndex study
2828
IndexinkrementierungIndexinkrementierung
30a30a
Reduktionsinformationen ohne Modulsubtraktionreduction information without module subtraction
30b30b
Reduktionsinformationen nach einer Modul-Subtraktionreduction information after module subtraction
30c30c
Reduktionsinformationen nach zwei Modul-Subtraktionenreduction information after two module subtractions
3232
Addition der Hilfsregisteraddition the auxiliary register
4040
Initialisierunginitialization
40'40 '
Initialisierunginitialization
4242
IterationsuntersuchungIterationsuntersuchung
4444
ZwischenergebnisuntersuchungIntermediate result inquiry
4646
Moduladditionmodule addition
5050
OrdnungsinformationsberechnungOrder information calculation
5252
ReduktionsinformationsberechnungReduction information calculating
5454
ReduktionsinformationskorrekturReduction information correction
5656
Subtraktion der Hilfsregistersubtraction the auxiliary register
900900
Start des ZDN-Algorithmusbegin of the ZDN algorithm
910910
Multiplikations-Look-Ahead-AlgorithmusMultiplication look-ahead algorithm
920920
Zwischenergebnis-VerschiebungIntermediate-result shift
930930
Reduktions-Look-Ahead-AlgorithmusReduction look-ahead algorithm
940940
Modulverschiebungmodule shift
950950
3-Operanden-Operation3-operand operation
960960
Ende des ZDN-AlgorithmusThe End of the ZDN algorithm

Claims (16)

Vorrichtung zum Berechnen eines ganzzahligen Quotienten eines Terms (T) bezüglich eines Moduls (N), wobei der Term ein Produkt aus einem binären Multiplikator (M) und einem Multiplikanden (C) aufweist, mit folgenden Merkmalen: einer Verarbeitungseinrichtung (10) zum Verarbeiten von Bits des Multiplikators (N) in mehreren Verarbeitungsschritten, wobei die Verarbeitungseinrichtung (10) ausgebildet ist, um in einem Verarbeitungsschritt ein bezüglich des Moduls reduziertes Zwischenergebnis (Z) zu berechnen, das von dem einen oder den mehreren Bits des binären Multiplikators abhängt, die in dem einen Verarbeitungsschritt betrachtet werden; einer Einrichtung (12) zum Protokollieren von Reduktionsinformationen in dem einen Verarbeitungsschritt und zum Protokollieren von Ordnungsinformationen über durch eine oder mehrere durch den einen Verarbeitungsschritt betroffene Stellen des ganzzahligen Quotienten; und einer Auswertungseinrichtung (14) zum Auswerten der Reduktionsinformationen und der Ordnungsinformationen aus den Verarbeitungsschritten, um den ganzzahligen Quotienten (Q) zu erhalten.Device for calculating an integer quotient of a term (T) with respect to a module (N), the term having a product of a binary multiplier (M) and a multiplicand (C), with the following features: a processing device ( 10 ) for processing bits of the multiplier (N) in a plurality of processing steps, the processing device ( 10 ) is designed to calculate, in one processing step, an intermediate result (Z) which is reduced with respect to the module and which depends on the one or more bits of the binary multiplier which are considered in the one processing step; a facility ( 12 ) for logging reduction information in the one processing step and for logging ordering information about one or more digits of the integer quotient affected by the one processing step; and an evaluation device ( 14 ) for evaluating the reduction information and the ordering information from the processing steps in order to obtain the integer quotient (Q). Vorrichtung nach Anspruch 1, bei der die Verarbeitungseinrichtung (10) ein festverdrahtetes Rechenwerk (10a) zum Berechnen des modular reduzierten Zwischenergebnisses (Z) aufweist, bei der die Verarbeitungseinrichtung ferner ein Controlteil (10b) zum Steuern des fest-verdrahteten Rechenwerkes (10a) aufweist; und bei dem die Protokollierungseinrichtung mit dem Controlteil (10b) gekoppelt ist, um die Reduktionsinformationen und die Ordnungsinformationen von dem Controlteil zu erhalten.Apparatus according to claim 1, wherein the processing device ( 10 ) a hard-wired arithmetic unit ( 10a ) for calculating the modularly reduced intermediate result (Z), in which the processing device also has a control part ( 10b ) to control the hard-wired arithmetic unit ( 10a ) having; and in which the logging device with the control part ( 10b ) is coupled to obtain the reduction information and the order information from the control part. Vorrichtung nach Anspruch 1 oder 2, bei der ein Zwischenergebnisregister (Z) auf 0 initialisiert ist (20'; 40'), so daß der Term (T) gleich dem Produkt des ersten Operanden und des zweiten Operanden ist.Device according to Claim 1 or 2, in which an intermediate result register (Z) is initialized to 0 ( 20 '; 40 ' ), so that the term (T) is equal to the product of the first operand and the second operand. Vorrichtung nach Anspruch 1 oder 2, bei dem ein Zwischenergebnisregister (20'; 40') auf einen dritten Operanden (D) initialisierbar ist, so daß der Term gleich C × M + D × 2n ist, wobei C der Multiplikand ist, wobei M der Multiplikator ist, wobei D der dritte Operand ist, und wobei n eine maximale Länge von A, B und D in Bits ist.Device according to Claim 1 or 2, in which an intermediate result register ( 20 '; 40 ' ) can be initialized to a third operand (D) such that the term is C × M + D × 2 n , where C is the multiplicand, where M is the multiplier, where D is the third operand, and where n is a maximum Length of A, B and D is in bits. Vorrichtung nach einem der vorhergehenden Ansprüche, bei der die Verarbeitungseinrichtung (10) ausgebildet ist, um ausgehend von einem höchstwertigen Multiplikatorbit bis zu einem niederstwertigen Multiplikatorbit zu arbeiten.Device according to one of the preceding claims, in which the processing device ( 10 ) is designed to work from a most significant multiplier bit to a least significant multiplier bit. Vorrichtung nach einem der vorhergehenden Ansprüche, bei der die Verarbeitungseinrichtung ausgebildet ist, um in jedem Verarbeitungsschritt ein Bit zu verarbeiten, bei der die Einrichtung zum Protokollieren (30a, 30b, 30c) eine Registereinrichtung mit zwei Hilfsregistern (Q, Q') aufweist, wobei die Reduktionsinformationen (30a, 30b, 30c) bestimmen, ob eines oder mehrere Bits in der Registereinrichtung gesetzt sind oder nicht, und wobei die Ordnungsinformationen bestimmen, welches eine oder welche mehreren Bits in einem Verarbeitungsschritt betroffen sind, und bei dem die Auswertungseinrichtung (32) ausgebildet ist, um die Registereinrichtung auszuwerten, um den ganzzahligen Quotienten auszugeben.Device according to one of the preceding claims, in which the processing device is designed to process a bit in each processing step, in which the device for logging ( 30a . 30b . 30c ) a register device with two auxiliary registers (Q, Q '), the reduction information ( 30a . 30b . 30c ) determine whether or not one or more bits are set in the register device, and the order information determines which one or which several bits are affected in a processing step, and in which the evaluation device ( 32 ) is designed to evaluate the register device in order to output the integer quotient. Vorrichtung nach einem der vorhergehenden Ansprüche, bei der die Verarbeitungseinrichtung (10) ausgebildet ist, um in jedem Verarbeitungsschritt ein Bit des Multiplikators zu verarbeiten (28), ein Zwischenergebnis abhängig von den Multiplikatorbits zu berechnen (22a, 22b), das berechnete Zwischenergebnis zu untersuchen (23), ob es größer als der Modul ist, falls es größer als der Modul ist, ein neues Zwischenergebnis zu berechnen (24), indem der Modul von dem Zwischenergebnis subtrahiert wird, das neue Zwischenergebnis zu untersuchen (25), ob es größer als der Modul ist, und falls es größer als der Modul ist, ein weiteres neues Zwischenergebnis zu berechnen (26), indem der Modul ein weiteres Mal subtrahiert wird.Device according to one of the preceding claims, in which the processing device ( 10 ) is designed to process one bit of the multiplier in each processing step ( 28 ) to calculate an intermediate result depending on the multiplier bits ( 22a . 22b) to examine the calculated intermediate result ( 23 ) whether it is larger than the module, if it is larger than the module, to calculate a new intermediate result ( 24 ) by subtracting the module from the intermediate result to examine the new intermediate result ( 25 ) whether it is larger than the module and, if it is larger than the module, calculate another new intermediate result ( 26 ) by subtracting the module one more time. Vorrichtung nach Anspruch 7, bei der die Protokollierungseinrichtung (12) ausgebildet ist, um als Reduktionsinformationen die Anzahl der Subtraktionen des Moduls zu verwenden, und um als Ordnungsinformationen ei ne Ordnung (i) des gerade verarbeiteten Multiplikatorbits zu verwenden.Apparatus according to claim 7, wherein the logging device ( 12 ) is designed to use the number of subtractions of the module as reduction information and to use an order (i) of the multiplier bit just processed as order information. Vorrichtung nach Anspruch 7 oder 8, bei der die Protokollierungseinrichtung (12) ausgebildet ist, um ein Bit mit einer Ordnung gleich einer Ordnung des verarbeiteten Multiplikatorbits eines ersten Hilfsregisters zu setzen (30b), wenn der Modul ein erstes Mal subtrahiert wird (24), ein Bit einer Ordnung gleich einer Ordnung des gerade verarbeiteten Multiplikatorbits eines zweiten Hilfsregisters (Q') zu setzen (30c), wenn der Modul ein zweites Mal subtrahiert wird (26), und bei dem die Auswertungseinrichtung (14) ausgebildet ist, um das erste und das zweite Hilfsregister zu addieren (32), um den ganzzahligen Quotienten zu erhalten.Apparatus according to claim 7 or 8, wherein the logging device ( 12 ) is designed to set a bit with an order equal to an order of the processed multiplier bit of a first auxiliary register ( 30b ) when the module is subtracted for the first time ( 24 ) to set a bit of an order equal to an order of the multiplier bit of a second auxiliary register (Q ') being processed ( 30c ) if the module is subtracted a second time ( 26 ), and in which the evaluation device ( 14 ) is designed to add the first and the second auxiliary register ( 32 ) to get the integer quotient. Vorrichtung nach einem der Ansprüche 1 bis 5, bei der die Verarbeitungseinrichtung (10) ausgebildet ist, um einen Multiplikations-Look-Ahead-Algorithmus (910) auszuführen, so daß in einem Verarbeitungsschritt eine Mehrzahl von Multiplikatorbits betrachtet werden, wenn die Mehrzahl von Multiplikatorbits eine von dem Look-Ahead-Algorithmus abhängige Eigenschaft hat, und bei der die Protokollierungseinrichtung (12) ausgebildet ist, um bei den Reduktionsinformationen und den Ordnungsinformationen den Multiplikations-Look-Ahead-Algorithmus (910) zu berücksichtigen.Device according to one of Claims 1 to 5, in which the processing device ( 10 ) is designed to use a multiplication look-ahead algorithm ( 910 ) so that a plurality of multiplier bits are considered in one processing step if the plurality of multiplier bits has a property dependent on the look-ahead algorithm, and in which the logging device ( 12 ) is designed to use the multiplication look-ahead algorithm ( 910 ) to be taken into account. Vorrichtung nach Anspruch 10, bei der die Verarbeitungseinrichtung (10) ausgebildet ist, um neben dem Multiplikations-Look-Ahead-Algorithmus (910) einen Reduktions-Look-Ahead-Algorithmus (930) zu verwenden, und bei der die Protokollierungseinrichtung (12) ausgebildet ist, um bei den Reduktionsinformationen und den Ordnungsinformationen den Reduktions-Look-Ahead-Algorithmus zu berücksichtigen.Apparatus according to claim 10, wherein the processing device ( 10 ) is designed in addition to the multiplication look-ahead algorithm ( 910 ) a reduction look ahead algorithm ( 930 ) and where the logging facility ( 12 ) is designed to take the reduction look ahead algorithm into account in the reduction information and the ordering information. Vorrichtung nach Anspruch 11, bei der die Verarbeitungseinrichtung (10) ausgebildet ist, um das reduzierte Zwischenergebnis (Z) unter Verwendung einer 3-Operanden-Addition (950) zu berechnen, wobei ein erster Operand (Z) ein Zwischenergebnis aus einem vorherigen Verarbeitungsschritt ist, ein zweiter Operand der Multiplikand (C) ist, und ein dritter Operand der Modul (N) ist, wobei zwei der drei Operanden in der 3-Operanden-Addition mit Faktoren gewichtet sind, die durch einen Faktor 2 hoch jeweiligen Verschiebungswerten (sZ, sN) gewichtet sind, und wobei der Modul (N) mit einem Reduktions-Look-Ahead-Parameter (b) beaufschlagt ist, wobei der Reduktions-Look-Ahead-Parameter (b) Werte von „0", „+1", „–1" haben kann, und bei der die Protokollierungseinrichtung (12) ausgebildet ist, um die Ordnungsinformationen (50) basierend auf einem Verschiebungswert (sZ, sN) zu bestimmen, und die Reduktionsinformationen (52) auf der Basis des Reduktions-Look-Ahead-Parameters (b) zu bestimmen.Apparatus according to claim 11, wherein the processing device ( 10 ) is designed to calculate the reduced intermediate result (Z) using a 3-operand addition ( 950 ), where a first operand (Z) is an intermediate result from a previous processing step, a second operand is the multiplicand (C), and a third operand is the module (N), two of the three operands in the 3-operand -Addition are weighted with factors which are weighted by a factor 2 to the respective displacement values (s Z , s N ), and wherein the module (N) is acted upon by a reduction look-ahead parameter (b), the reduction -Look-ahead parameter (b) can have values of "0", "+1", "-1", and at which the logging device ( 12 ) is designed to store the order information ( 50 ) based on a displacement value (s Z , s N ), and the reduction information ( 52 ) on the basis of the reduction look ahead parameter (b). Vorrichtung nach Anspruch 12, bei der die Protokollierungseinrichtung (12) zwei Hilfsregister (Q, Q') aufweist, wobei durch die Ordnungsinformationen bestimmte Bits (j) der zumindest zwei Register als Reduktionsinformationen folgendermaßen gesetzt werden (52): wenn b gleich 0 ist, dann ist Qj gleich Q'j gleich 0 wenn b gleich 1 ist, dann ist Qj gleich 0, Q'j gleich 1, und wenn b gleich –1 ist, dann ist Qj gleich 1, Q'j gleich 0, wobei b der Reduktions-Look-Ahead-Parameter ist, wobei Qj ein Bit j des ersten Hilfsregisters (Q) ist, und wobei Q'j ein Bit j des zweiten Hilfsregisters (Q') ist.Device according to Claim 12, in which the logging device ( 12 ) has two auxiliary registers (Q, Q '), bits (j) of the at least two registers determined by the ordering information being set as reduction information as follows ( 52 ): if b is 0, then Q j is Q ' j is 0, if b is 1, then Q j is 0, Q' j is 1, and if b is -1, then Q j is equal 1, Q ' j is 0, where b is the reduction look-ahead parameter, Q j is a bit j of the first auxiliary register (Q), and Q' j is a bit j of the second auxiliary register (Q ') , Vorrichtung nach Anspruch 12 oder 13, bei der dem Modul (N) ein Reduktions-Verschiebungswert (sN) zugeordnet ist, bei der dem Zwischenergebnis ein Multiplikations-Verschiebungswert (sZ) zugeordnet ist, und bei der die Protokollierungseinrichtung (12) ausgebildet ist, um als Ordnungsinformationen eine Ordnung (j) der Bits des ersten Hilfsregisters und des zweiten Hilfsregisters aus einer Differenz zwischen Ordnungsinformationen eines vorhergehenden Schritts und einer Differenz zwischen dem Multiplikations-Verschiebungswert (sZ) und dem Reduktions-Verschiebungswert (sN) zu bestimmen.Device according to Claim 12 or 13, in which a reduction shift value (s N ) is assigned to the module (N), in which a multiplication shift value (s Z ) is assigned to the intermediate result, and where the logging facility ( 12 ) is configured to order (j) the bits of the first auxiliary register and the second auxiliary register from a difference between order information of a previous step and a difference between the multiplication shift value (s Z ) and the reduction shift value (s N ) to determine. Vorrichtung nach Anspruch 13 oder 14, bei der die Auswertungseinrichtung (14) ausgebildet ist, um nach einer Abarbeitung der Multiplikatorbits durch die Verarbeitungseinrichtung (10) das zweite Hilfsregister (Q') von dem ersten Hilfsregister (Q) zu subtrahieren (56), um den ganzzahligen Quotienten zu erhalten.Device according to Claim 13 or 14, in which the evaluation device ( 14 ) is designed to, after the multiplier bits have been processed by the processing device ( 10 ) subtract the second auxiliary register (Q ') from the first auxiliary register (Q) ( 56 ) to get the integer quotient. Verfahren zum Berechnen eines ganzzahligen Quotienten eines Terms (T) bezüglich eines Moduls (N), wobei der Term ein Produkt aus einem binären Multiplikator (M) und einem Multiplikanden (C) aufweist, mit folgenden Schritten: Verarbeiten (10) von Bits des Multiplikators (N) in mehreren Verarbeitungsschritten, wobei die Verarbeitungseinrichtung (10) ausgebildet ist, um in einem Verarbeitungsschritt ein bezüglich des Moduls reduziertes Zwischenergebnis (Z) zu berechnen, das von dem einen oder den mehreren Bits des binären Multiplikators abhängt, die in dem einen Verarbeitungsschritt betrachtet werden; Protokollieren (12) von Reduktionsinformationen in dem einen Verarbeitungsschritt und Protokollieren von Ordnungsinformationen über durch eine oder mehrere durch den einen Verarbeitungsschritt betroffene Stellen des ganzzahligen Quotienten; und Auswerten (14) der Reduktionsinformationen und der Ordnungsinformationen aus den Verarbeitungsschritten, um den ganzzahligen Quotienten (Q) zu erhalten.Method for calculating an integer quotient of a term (T) with respect to a module (N), the term having a product of a binary multiplier (M) and a multiplicand (C), with the following steps: processing ( 10 ) of bits of the multiplier (N) in several processing steps, the processing device ( 10 ) is designed to calculate, in one processing step, an intermediate result (Z) which is reduced with respect to the module and which depends on the one or more bits of the binary multiplier which are considered in the one processing step; To log ( 12 ) reduction information in the one processing step and logging of order information about one or more digits of the integer quotient affected by the one processing step; and evaluation ( 14 ) the reduction information and the order information from the processing steps in order to obtain the integer quotient (Q).
DE2002119164 2002-04-29 2002-04-29 Device and method for calculating an integer quotient Expired - Fee Related DE10219164B4 (en)

Priority Applications (4)

Application Number Priority Date Filing Date Title
DE2002119164 DE10219164B4 (en) 2002-04-29 2002-04-29 Device and method for calculating an integer quotient
AU2003224137A AU2003224137A1 (en) 2002-04-29 2003-04-28 Device and method for calculating an integer quotient
PCT/EP2003/004427 WO2003093970A2 (en) 2002-04-29 2003-04-28 Device and method for calculating an integer quotient
TW92109930A TW200400442A (en) 2002-04-29 2003-04-28 Apparatus and method for calculating an integer quotient

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
DE2002119164 DE10219164B4 (en) 2002-04-29 2002-04-29 Device and method for calculating an integer quotient

Publications (2)

Publication Number Publication Date
DE10219164A1 DE10219164A1 (en) 2003-11-20
DE10219164B4 true DE10219164B4 (en) 2004-12-02

Family

ID=29264906

Family Applications (1)

Application Number Title Priority Date Filing Date
DE2002119164 Expired - Fee Related DE10219164B4 (en) 2002-04-29 2002-04-29 Device and method for calculating an integer quotient

Country Status (4)

Country Link
AU (1) AU2003224137A1 (en)
DE (1) DE10219164B4 (en)
TW (1) TW200400442A (en)
WO (1) WO2003093970A2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102006025673B4 (en) * 2005-10-28 2010-04-22 Infineon Technologies Ag Calculator for reducing an input number with respect to a module

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102006025713B9 (en) 2005-10-28 2013-10-17 Infineon Technologies Ag Cryptographic device and cryptographic method for calculating a result of a modular multiplication
DE102006025569A1 (en) 2005-10-28 2007-05-03 Infineon Technologies Ag Modular multiplication process for cryptography uses multiplicand in three bit segments in an multiplication addition operation
DE102006025677B4 (en) 2005-10-28 2020-03-12 Infineon Technologies Ag Device and method for calculating a result of a sum with an arithmetic unit with a limited word length
US20220121424A1 (en) * 2020-10-21 2022-04-21 PUFsecurity Corporation Device and Method of Handling a Modular Multiplication

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3631992C2 (en) * 1986-03-05 1988-12-08 Holger 3300 Braunschweig De Sedlak
DE69900127T2 (en) * 1998-04-02 2001-09-13 St Microelectronics Sa Improved procedure for performing integer division
DE69802016T2 (en) * 1997-09-09 2002-01-31 St Microelectronics Sa Method and arrangement for performing integer division operations with a modulo-arithmetic coprocessor

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0786826B2 (en) * 1988-07-19 1995-09-20 日本電気株式会社 Integer division circuit
US5710730A (en) * 1995-03-31 1998-01-20 International Business Machines Corporation Divide to integer
SE517045C2 (en) * 2000-10-17 2002-04-09 Novacatus Invest Ab Method and device for module multiplication and use of method for asymmetric encryption / decryption

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE3631992C2 (en) * 1986-03-05 1988-12-08 Holger 3300 Braunschweig De Sedlak
DE69802016T2 (en) * 1997-09-09 2002-01-31 St Microelectronics Sa Method and arrangement for performing integer division operations with a modulo-arithmetic coprocessor
DE69900127T2 (en) * 1998-04-02 2001-09-13 St Microelectronics Sa Improved procedure for performing integer division

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE102006025673B4 (en) * 2005-10-28 2010-04-22 Infineon Technologies Ag Calculator for reducing an input number with respect to a module
DE102006025673B9 (en) * 2005-10-28 2010-12-16 Infineon Technologies Ag Calculator for reducing an input number with respect to a module

Also Published As

Publication number Publication date
WO2003093970A3 (en) 2004-07-15
AU2003224137A1 (en) 2003-11-17
DE10219164A1 (en) 2003-11-20
WO2003093970A2 (en) 2003-11-13
TW200400442A (en) 2004-01-01

Similar Documents

Publication Publication Date Title
EP1360579B1 (en) Method and device for conducting modular multiplication and arithmetic-logic unit for conducting modular multiplication
DE69826963T2 (en) Device for modular inversion for securing information
WO2013060467A1 (en) Efficient prime-number check
DE102020102453A1 (en) Integrated circuit for the modular multiplication of two whole numbers for a cryptographic method and method for the cryptographic processing of data based on modular multiplication
DE10219158B4 (en) Device and method for calculating a result of a modular multiplication
DE10357661B4 (en) Modular Montgomery multiplier and associated multiplication method
WO2004059463A1 (en) Device and method for calculating a multiplication involving a shifting of the multiplicand
EP1370933B1 (en) Method and device for modular multiplication
DE10260660B3 (en) Modular multiplication device for cryptographic applications with parallel calculation of look-ahead parameters for next iteration step during 3 operand addition
DE10219164B4 (en) Device and method for calculating an integer quotient
DE102006025677B4 (en) Device and method for calculating a result of a sum with an arithmetic unit with a limited word length
EP1478999B1 (en) Device and method for converting a term
DE10151129B4 (en) Method and device for calculating a result of an exponentiation in a cryptography circuit
EP1474741B1 (en) System and method for calculating a result from a division
DE10142155C1 (en) Processor modular multiplication method uses determination of multiplication shift values and reduction shift values and successive actualisation of intermediate result
WO2013060466A2 (en) Determination of a division remainder and detection of prime number candidates for a cryptographic application
DE102008050800B4 (en) Apparatus and method for determining a modular multiplicative inverse
DE10223853B4 (en) Method and integrated circuit for performing a multiplication modulo M
EP1497713B1 (en) Processor and method for simultaneously doing a calculation and carrying out a copying process
DE10156708A1 (en) Method and device for multiplying and method and device for adding on an elliptic curve
DE102020133312A1 (en) CRYPTOGRAPHIC PROCESSING DEVICE AND METHOD FOR CRYPTOGRAPHIC PROCESSING OF DATA
DE10201442C1 (en) Device and method for multiplying or dividing a first operand by or by a second operand

Legal Events

Date Code Title Description
OP8 Request for examination as to paragraph 44 patent law
8364 No opposition during term of opposition
R119 Application deemed withdrawn, or ip right lapsed, due to non-payment of renewal fee