DE10101884A1 - Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably - Google Patents

Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably

Info

Publication number
DE10101884A1
DE10101884A1 DE10101884A DE10101884A DE10101884A1 DE 10101884 A1 DE10101884 A1 DE 10101884A1 DE 10101884 A DE10101884 A DE 10101884A DE 10101884 A DE10101884 A DE 10101884A DE 10101884 A1 DE10101884 A1 DE 10101884A1
Authority
DE
Germany
Prior art keywords
prime number
microprocessor
inversion
number field
numbers
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
DE10101884A
Other languages
German (de)
Inventor
Rainer Bluemel
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
CV CRYPTOVISION GmbH
Original Assignee
CV CRYPTOVISION GmbH
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by CV CRYPTOVISION GmbH filed Critical CV CRYPTOVISION GmbH
Priority to DE10101884A priority Critical patent/DE10101884A1/en
Publication of DE10101884A1 publication Critical patent/DE10101884A1/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/721Modular inversion, reciprocal or quotient calculation
    • 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/724Finite field arithmetic
    • G06F7/725Finite field arithmetic over elliptic curves

Landscapes

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

Abstract

The invention uses the extended, Euclidean algorithm for detecting an inverse in the prime number field. The method uses an algorithm such that in one processing step the results of two necessary operators are determined. To do this two numbers are successively stored in the long number registers of a computer processor. Further acceleration is obtained because typical processors store long numbers in an external register, so that by dropping half the operations half of the load cycles to the external arithmetic unit register are also dropped. An Independent claim is made for a smart card with a processor for carrying out the cryptography method.

Description

Gebiet der ErfindungField of the Invention

Die Erfindung betrifft das Gebiet der kryptographischen Verfahren und Vorrichtungen, und zwar Verfahren und Vorrichtungen, die die Durchführung einer speziellen Berechnung ermöglichen, nämlich einer Inversion im Primzahlkörper wie sie z. B. bei der Verschlüsselung mittels elliptischer Kurven benötigt wird.The invention relates to the field of cryptographic methods and devices, namely methods and devices that allow the implementation of a special Enable calculation, namely an inversion in the prime number field as z. B. at encryption using elliptic curves is required.

Hintergrund der ErfindungBackground of the Invention

Zur Verschlüsselung und Entschlüsselung von Informationen aller Art sind verschiedene mathematische Methoden bekannt, die den Bestandteilen einer z. B. aus Zahlen oder Buchstaben bestehenden Information Zahlen zuordnen und aus diesen Zahlen neue Zahlen berechnen, aus denen sich ohne Kenntnis einer Schlüsselzahl, kurz eines Schlüssels, die ursprüngliche Information nicht erhalten läßt.To encrypt and decrypt information of all kinds known various mathematical methods that the components of a z. B. from Numbers or letters assign existing information to numbers and from them Numbers calculate new numbers that, without knowing a key number, in short a key that does not preserve the original information.

Diese mathematischen Verfahren lassen sich einteilen in
These mathematical methods can be divided into

  • - symmetrische Verfahren, bei denen zur Entschlüsselung derselbe Schlüssel verwendet wird wie zur Verschlüsselung, und- symmetrical procedures, in which the same key is used to decrypt is used as for encryption, and
  • - asymmetrische Verfahren, bei denen zur Entschlüsselung ein anderer Schlüssel verwendet wird als zur Verschlüsselung.- Asymmetric procedures in which another decryption Key is used as for encryption.

Soll eine verschlüsselte Information an einem anderen Ort als am Ort der Verschlüsselung entschlüsselt werden, soll also z. B. eine Information von einem Computersystem (Sender) zu einem anderen Computersystem (Empfänger) z. B. über das Internet übertragen werden, so muß bei den symmetrischen Verfahren dem Empfänger auch der Schlüssel in irgendeiner Form übermittelt werden. Da die Gefahr besteht, daß der Schlüssel bei dieser Übermittlung abgefangen wird, gelten bei der Übertragung verschlüsselter Informationen die asymmetrischen Verfahren als sicherer. Should encrypted information be in a different location than the location of the Encryption should be decrypted. B. information from one Computer system (transmitter) to another computer system (receiver) z. B. about the Internet must be transmitted, so with the symmetrical procedure Recipients also receive the key in some form. Because the danger If the key is intercepted during this transmission, apply to the Transmission of encrypted information using the asymmetric procedures as more secure.  

Bei einer Gruppe von auch als Public-Key-Kryptographie bekannten asymmetrischen Verfahren berechnen Sender und Empfänger aus einem öffentlichen Schlüssel G jeweils für sich einen privaten Schlüssel GS bzw. GE und tauschen diese aus, wobei zur Verschlüsselung bzw. Entschlüsselung dann ein Schlüssel GSE verwendet wird. Selbst wenn dabei ein Dritter sowohl GS als auch GE abfragen würde, könnte er aufgrund des sogenannten "Problems des diskreten Logarithmus" die mit dem Schlüssel GSE verschlüsselte Nachricht nicht entziffern.In a group of asymmetric methods also known as public key cryptography, the sender and receiver each calculate and exchange a private key G S or G E for themselves from a public key G, and then exchange a key G for encryption or decryption SE is used. Even if a third party would query both G S and G E , he would not be able to decipher the message encrypted with the key G SE due to the so-called "problem of the discrete logarithm".

Asymmetrische Veschlüsselungsverfahren und Vorrichtungen zum Ausführen zumindest von Teilschritten bei der Verschlüsselung und Entschlüsselung mittels asymmetrischer Verfahren, insbesondere mittels elliptischer Kurven sind aus einer Vielzahl von Druckschriften bekannt, beispielsweise aus den Druckschriften US 5,159,632, US 5,271,061, US 5,463,690, US 5,581,616, US 5,805,703, US 5,442,707, EP 0 892 520 A2, PCT/DE 99/00278 und PCT/US 99/12749, in welchen auch die mathematischen Grundlagen elliptischer Kurven und deren Anwendung in der Kryptographie beschrieben wird und deren gesamter technischer Offenbarungsgehalt hiermit durch Zitierung voll umfänglich zum Bestandteil dieser Anmeldung gemacht wird.Asymmetric encryption methods and devices for execution at least partial steps in the encryption and decryption using asymmetrical methods, in particular by means of elliptic curves, are from one A large number of publications are known, for example from the publications US 5,159,632, US 5,271,061, US 5,463,690, US 5,581,616, US 5,805,703, US 5,442,707, EP 0 892 520 A2, PCT / DE 99/00278 and PCT / US 99/12749, in which also the mathematical basics of elliptic curves and their application in the Cryptography is described and its total technical disclosure content hereby made fully part of this application by citation becomes.

In den genannten Druckschriften wird auch auf die Vorteile und Nachteile der auf elliptischen Kurven basierenden Verschlüsselungstechniken gegenüber der zur Zeit noch am weitesten verbreiteten Art asymmetrischer Verschlüsselungstechniken, dem sog. RSA-Verfahren, hingewiesen. Das RSA-Verfahren basiert auf dem Problem des Faktorisierens großer Zahlen. Zur Zeit erhältliche Smartcards verwenden diesen Algorithmus.The cited documents also highlight the advantages and disadvantages of encryption techniques based on elliptic curves compared to the currently most widespread type of asymmetric encryption technology, the the so-called RSA procedure. The RSA process is based on the problem of Factoring large numbers. Smart cards currently available use this Algorithm.

Dabei ist die wesentliche Operation beim RSA-Verfahren die Potentierung einer Zahl m in einem Zahlenkörper Zn, wobei n eine aus der Multiplikation zweier großer Primzahlen p und q entstandene Zahl ist, die als Binärzahl eine Bitlänge von typischerweise zwischen 1024 bis 2048 Bit besitzt (p und q besitzen üblicherweise Bitlängen zwischen 512 und 1024 Bit). Implementierungen des RSA-Verfahrens auf Smartcards beschränken normalerweise n auf 1024 Bit. The essential operation in the RSA method is the potentiation of a number m in a number field Z n , where n is a number resulting from the multiplication of two large prime numbers p and q, which as a binary number typically has a bit length of between 1024 and 2048 bits ( p and q usually have bit lengths between 512 and 1024 bits). Implementations of the RSA method on smart cards normally limit n to 1024 bits.

Anders als beim RSA-Verfahren sind bei kryptographischen Verfahren auf Basis elliptischer Kurven Divisionen im Primzahlkörper nötig. Stehen genügend Ressourcen zur Verfügung, ist die Ausführung solcher Divisionen mittels entsprechender Computerprogramme leicht realisierbar.Unlike the RSA method, cryptographic methods are based on elliptic curve divisions in the prime number field necessary. Have enough resources is available, the execution of such divisions by means of appropriate Computer programs easily implemented.

Nun besteht aber das Problem, daß bei vielen Anwendungsfällen, beispielsweise bei den genannten Smartcards, die zur Verfügung stehenden Prozessoren für die Anwendung des RSA-Verfahrens optimiert sind, was bedeutet, daß zwar sogenannte Langzahlregister zur Verfügung stehen, die es erlauben, sehr lange Zahlen zu handhaben, daß mit diesen Zahlen jedoch nur wenige arithmetische Funktionen ausgeführt werden können. Divisionen in Primzahlkörpern werden von den bekannten Prozessoren für Smartcards und dergleichen nicht unterstützt. Es ist zwar möglich, die Rechenleistung auch bei Smartcards zu erhöhen, jedoch vergrößert dies die Chipfläche und erhöht die Kosten.Now there is the problem that in many applications, for example the aforementioned smart cards, the processors available for the Application of the RSA method are optimized, which means that so-called Long number registers are available that allow very long numbers to be handle that with these numbers but only a few arithmetic functions can be executed. Divisions in prime number fields are known by the Processors for smart cards and the like are not supported. It is possible that To increase computing power even with smart cards, but this increases the Chip area and increases costs.

Die bisherigen Realisierungen von auf elliptischen Kurven basierenden Verschlüsselungstechniken nutzen im wesentlichen die Standardbefehle des Prozessors und verwenden die Langzahlregister nur an wenigen Stellen und sind daher wenig effizient. Alle bekannte Implementationen auf Prozessoren von Smartcards (auch Smardcard-ICs genannt) und dergleichen beschleunigen die Rechenzeiten, indem sie die zugrunde liegende elliptische Kurve und/oder den Grundkörper festlegen. Damit ist es nicht möglich, z. B. mit einer Smartcard Operationen für Benutzergruppen mit verschiedenen Parametersätzen durchzuführen.The previous realizations of based on elliptic curves Encryption techniques essentially use the standard commands of the Processor and use the long number register only in a few places and are therefore not very efficient. All known implementations on processors from Smart cards (also called smart card ICs) and the like accelerate this Computing times by taking the underlying elliptic curve and / or the Define basic body. So it is not possible, for. B. with a smart card Perform operations for user groups with different parameter sets.

Aufgabe der Erfindung ist es daher zum einen, Verfahren und Vorrichtungen anzugeben, die es ermöglichen, Standardalgorithmen für die Kryptographie mit elliptischen Kurven auf den Prozessoren von Smartcards (auch Smardcard-ICs genannt) mit Langzahl-Krypto-Koprozessoren effizient zu implementieren.The object of the invention is therefore on the one hand, methods and devices specify that make it possible to use standard algorithms for cryptography elliptical curves on the processors of smart cards (also smart card ICs to implement efficiently with long-number crypto coprocessors.

Eine weitere Aufgabe ist es, Verfahren und Vorrichtungen anzugeben, bei denen Zahlenkörper und elliptische Kurve frei wählbar sind und erst beim Personalisieren eines entsprechenden Speichermediums, also z. B. einer Smartcard, z. B. in das EEPROM der Smartcard eingelesen werden. Another object is to specify methods and devices in which Number body and elliptic curve are freely selectable and only when personalizing an appropriate storage medium, e.g. B. a smart card, e.g. B. in that EEPROM of the smart card can be read.  

Zusammenfassung der ErfindungSummary of the invention

Da eine allgemeine Division sich durch eine Inversion (1/x) und eine Multiplikation ersetzen lassen, genügt ein allgemein einsetzbares Verfahren für Inversionen im Primzahlkörper.Since a general division is divided by an inversion (1 / x) and a multiplication Have replaced, a generally applicable procedure for inversions in the Prime number field.

Die Erfindung schlägt die Verwendung des erweiterten euklidischen Algorithmus zur Bestimmung einer Inversen im Primzahlkörper vor.The invention proposes the use of the extended Euclidean algorithm Determination of an inverse in the prime number field before.

Das Inverse eines Elementes q in Zp (bezeichnet mit q-1) ist eine Zahl, so daß gilt
The inverse of an element q in Z p (denoted by q -1 ) is a number, so that applies

q q-1 = 1(mod p).qq -1 = 1 (mod p).

Hintergrund der neuen Lösung ist, daß kryptographische Verfahren auf Basis elliptischer Kurven mit geringeren Bitzahlen auskommen als RSA-Verfahren, so daß die bei bekannten Smartcard-ICs vorhandenen Register mehr als doppelt so lang sind als die für Berechnungen auf elliptischen Kurven eigentlich benötigten. Der Kern der Idee besteht nun darin, in den Langzahlregistern zwei Zahlen hintereinander zu speichern.The background to the new solution is that cryptographic based elliptic curves manage with fewer bit numbers than RSA methods, so that the registers available in known smart card ICs are more than twice as long than actually needed for calculations on elliptic curves. The core of the The idea now is to add two numbers in a row in the long number registers to save.

Für die Programmierung von auf elliptischen Kurven basierenden Verschlüsselungsalgorithmen (nachfolgend kurz ECC-Algorithmen genannt) auf Smartcards oder anderen Prozessoren mit beschränktem Leistungsumfang ist die Inversion einer Zahl modulo einer Primzahl notwendig, da ansonsten mehr Zwischenspeicher benötigt wird als auf diesen Prozessoren üblicherweise zur Verfügung steht.For programming elliptic curve based Encryption algorithms (hereinafter referred to as ECC algorithms) Smart cards or other processors with limited performance is the Inversion of a number modulo a prime number necessary, otherwise more Buffer is usually required than on these processors Available.

Diese Inversion wird mit Hilfe des erweiterten Euklidischen Algorithmus durchgeführt. Es werden also für die Eingabe von zwei Zahlen a, b < 0 der Wert d = ggT(a, b) (ggT = größter gemeinsamer Teiler) sowie zwei Zahlen x und y mit d = x.a + y.b berechnet.This inversion is carried out using the extended Euclidean algorithm. For the input of two numbers a, b <0, the value d = ggT (a, b) (ggT = greatest common divisor) and two numbers x and y with d = x.a + y.b calculated.

Die grundsätzliche Struktur ist wie folgt:
The basic structure is as follows:

  • a) Initialisiere A = a, B = b, x = 0, y = 1 a) Initialize A = a, B = b, x = 0, y = 1  
  • b) Solange B < 0 ist
    • 1. i) Berechne q = A/B
    • 2. ii) Berechne r = A mod B
    • 3. iii) Verändere x und y
    • 4. iv) Berechne A und B neu
    b) As long as B <0
    • 1. i) Calculate q = A / B
    • 2. ii) Calculate r = A mod B
    • 3. iii) Change x and y
    • 4. iv) Recalculate A and B.

Erfindungsgemäß werden die Neuberechnung von A und die Berechnung von x zusammengefasst, indem die beiden Werte in einem Register gespeichert werden (was dann notwendigerweise mindestens die doppelte Länge haben muß).According to the recalculation of A and the calculation of x summarized by storing the two values in a register (which then necessarily has to be at least twice the length).

Prinzipiell sieht dazu der Algorithmus folgendermaßen aus:
In principle, the algorithm looks like this:

Initialisiere X = P.2l+k + BP und Y = Q.2l+k + BQ
Initialize X = P.2 l + k + B P and Y = Q.2 l + k + B Q

wobei X in einem Langzahlregister wie folgt eingeschrieben sein kann: P (linksbündig), gefolgt von einer Anzahl freier Bits (Länge k), BP (rechtsbündig).where X can be written in a long number register as follows: P (left-justified), followed by a number of free bits (length k), B P (right-justified).

Dementsprechend kann in einem anderen Langzahlregister Q wie folgt eingeschrieben sein: Q (linksbündig), frei (Länge k), BQ (rechtsbündig).Accordingly, Q can be written in another long number register as follows: Q (left-justified), free (length k), B Q (right-justified).

Der eigentliche Algorithmus arbeitet dann mit den Werten von X und Y, bearbeitet also P und BP bzw. Q und BQ gleichzeitig.The actual algorithm then works with the values of X and Y, ie processes P and B P or Q and B Q simultaneously.

Ein Teilschritt sorgt nun dafür, daß (im Falle der Bearbeitung von X) P auf den Rest der Division von P/Q gesetzt wird und (gleichzeitig) der Wert in BP entsprechend angepasst wird. Im Falle der Bearbeitung von Y wird entsprechend verfahren. Diese Berechnungen werden solange durchgeführt wie P und Q größer als Null sind. Ist man bei Null angelangt, so enthält BP bzw. BQ die gesuchte Inverse.A sub-step now ensures that (in the case of processing X) P is set to the rest of the division of P / Q and (at the same time) the value in B P is adjusted accordingly. If Y is processed, the same procedure is followed. These calculations are performed as long as P and Q are greater than zero. If one has reached zero, then B P or B Q contains the inverse sought.

Für eine effiziente Realisierung der Inversionen genügen bei diesen Verfahren im wesentlichen halb so viele doppelt so lange Register. Die Anzahl der Speicherbits bleibt daher unverändert. Dieses neue Verfahren kommt mit einem Langzahlakkumulator und ohne wesentliche Unterstützung eines Host-Prozessors aus, da nur elementare Befehle für die Langzahlregister (Addieren, Shiften, Bit-Test und eine Möglichkeit zum Vergleichen, was auch durch einen Bit-Test geschehen kann) benötigt werden und die Teiler mit Rest (P und Q) nicht zwischengespeichert werden müssen.For an efficient realization of the inversions with these methods in the substantially half as many registers twice as long. The number of memory bits therefore remains unchanged. This new process comes with one Long-term accumulator and without substantial support from a host processor, since only elementary commands for the long number register (add, shift, bit test and  a way to compare what can also be done by a bit test) are needed and the dividers with remainder (P and Q) are not buffered have to.

Das Verfahren beschreibt, wie eine bestimmte Klasse von kryptographischen Verfahren auf speziellen Mikroprozessoren effizient implementiert werden können. Bei gleichen Sicherheitsanforderungen läßt sich damit die notwendige Rechenzeit auf marktüblichen Prozessoren gegenüber den bekannten Verfahren erheblich reduzieren.The procedure describes how a certain class of cryptographic Procedures on special microprocessors can be implemented efficiently. At The necessary computing time can thus be based on the same security requirements market processors significantly reduce compared to the known methods.

Der Algorithmus ist unabhängig von den speziellen Parametern, welche der Berechnung zugrunde liegen. Damit ist es z. B. bei der Implementierung auf Smartcards möglich, diese Parameter erst bei der sogenannte Personalisierung der Karte aufzuspielen (statt sie bereits bei der Herstellung des Mikroprozessors festzulegen).The algorithm is independent of the special parameters which the Underlying the calculation. So that it is z. B. on implementation Smart cards possible, these parameters only with the so-called personalization of the Play card (instead of already during the manufacture of the microprocessor to be determined).

Auf dem als Referenz dienenden Smartcard-Prozessor SLE66CxxS der Firma Infineon benötigt die Erstellung einer digitalen Signatur ungefähr 500 Millisekunden bis zu einer Sekunde beim Einsatz des RSA-Algorithmus. Mit dem hier verwendeten Verfahren auf Basis elliptischer Kurven beläuft sich die notwendige Zeit auf 100 bis 200 Millisekunden bei vergleichbarer Sicherheit. Dieser Geschwindigkeitsvorteil ergibt sich aus zwei Aspekten des Verfahrens:
Einerseit ist es durch den hier beschriebenen Algorithmus möglich, in einem Rechenschritt die Ergebnisse zweier notwendiger Operatoren zu erhalten; dies bedeutet auf jeden Fall eine Beschleunigung.
Zusätzlich ergibt sich eine weitere Beschleunigung durch die folgende Tatsache: typischerweise ist bei Smartcard-Prozessoren die Recheneinheit für die Langzahlarithmetik (der sogenannte mathematische Koprozessor) ausgelagert und bildet eine Recheneinheit mit einem separaten Registersatz. Eine Berechnung findet daher in mehreren Schritten statt:
On the SLE66CxxS smart card processor from Infineon, which serves as a reference, the creation of a digital signature takes approximately 500 milliseconds to one second when using the RSA algorithm. With the method used here based on elliptic curves, the necessary time amounts to 100 to 200 milliseconds with comparable security. This speed advantage results from two aspects of the process:
On the one hand, the algorithm described here makes it possible to obtain the results of two necessary operators in one calculation step; this definitely means acceleration.
In addition, there is a further acceleration due to the following fact: typically the arithmetic unit for the long number arithmetic (the so-called mathematical coprocessor) is outsourced in smart card processors and forms an arithmetic unit with a separate register set. A calculation therefore takes place in several steps:

  • a) Die Register des Koprozessors werden mit den Operanden geladen.a) The registers of the coprocessor are loaded with the operands.
  • b) Die eigentliche Berechnung wird auf dem Koprozessor durchgeführt. b) The actual calculation is carried out on the coprocessor.  
  • c) Der Hauptprozessor liest die Ergebnisse aus den Registern des Koprozessors.c) The main processor reads the results from the registers of the coprocessor.

Da der Zeitaufwand für die Schritte a) und c) gegenüber der Zeit für die eigentliche Berechnung in Schritt b) relativ groß ist, ist also ein weiterer Zeitvorteil durch die simultane Berechnung von mehr als einem Wert gegeben.Since the time required for steps a) and c) compared to the time for the actual Calculation in step b) is relatively large, so is another time advantage due to the given simultaneous calculation of more than one value.

Der vorgestellte Algorithmus ist eine Optimierung für den Fall, daß der Mikroprozessor Arithmetikroutinen für Zahlen mit einer Bitlänge zur Verfügung stellt, welche echt größer als das Doppelte der Bitlänge der zu bearbeitenden Zahlen ist.The algorithm presented is an optimization in the event that the microprocessor Provides arithmetic routines for numbers with a bit length which is real is greater than twice the bit length of the numbers to be processed.

Kurze Beschreibung der ZeichnungBrief description of the drawing

Fig. 1 zeigt eine im Bereich der reellen Zahlen scheinbar aus zwei unzusammenhängenden Stücken bestehende elliptische Kurve und drei Punkte P, Q und R auf dieser Kurve. Fig. 1 shows a in the range of real numbers of two seemingly unrelated pieces existing elliptic curve and three points P, Q and R on this curve.

Beschreibung bevorzugter AusführungsformenDescription of preferred embodiments

Für die Programmierung von ECC-Algorithmen auf Smartcards (oder allgemeiner auf Mikroprozessoren mit beschränktem Leistungsumfang) ist normalerweise die Inversion einer Zahl modulo einer Primzahl notwendig (da für eine alternative Methode zur Berechnung mehr Zwischenspeicher benötigt wird als auf diesen Prozessoren üblicherweise zur Verfügung steht). Hat man eine schnelle Inversion zur Verfügung, so ist das Gruppengesetz für Punkte auf elliptischen Kurven sehr einfach, es lautet für die Operation auf der Kurve y2 = x3 + a.x + b:
P + O = O + P = P für alle P ∈ E(Zp).
Für P = (x, y) ∈ E(Zp) ist (x, y) + (x, -y) = O. (Der Punkt (x, -y) wird bezeichnet mit -P und wird als das Negative von P bezeichnet; zu beachten ist, daß -P tatsächlich ein Punkt auf der Kurve ist).
Für P = (x1, y1) ∈ E(Zp) und Q = (x2, y2) ∈ E(Zp) mit P ≠ -Q berechnet sich P + Q = (x3, y3) durch
x3 = λ2 - x1 - x2
y3 = λ*(x1 - x3) - y1,
wobei
λ = (y2 - y1)/(x2 - x1) falls P ungleich Q und
λ = (3.x1 2 + a)/(2.y1) falls P gleich Q.
For the programming of ECC algorithms on smart cards (or more generally on microprocessors with limited scope of performance), the inversion of a number modulo a prime number is normally necessary (since an alternative method of calculation requires more intermediate storage than is usually available on these processors). If you have a fast inversion available, the group law for points on elliptic curves is very simple, for the operation on the curve y 2 = x 3 + ax + b:
P + O = O + P = P for all P ∈ E (Z p ).
For P = (x, y) ∈ E (Z p ) is (x, y) + (x, -y) = O. (The point (x, -y) is denoted by -P and is called the negative of P; note that -P is actually a point on the curve).
For P = (x 1 , y 1 ) ∈ E (Z p ) and Q = (x 2 , y 2 ) ∈ E (Z p ) with P ≠ -Q, P + Q = (x 3 , y 3 ) by
x 3 = λ 2 - x 1 - x 2
y 3 = λ * (x 1 - x 3 ) - y 1 ,
in which
λ = (y 2 - y 1 ) / (x 2 - x 1 ) if P is not equal to Q and
λ = (3.x 1 2 + a) / (2.y 1 ) if P is Q.

Die Fig. 1 stellt diese Operationen graphisch dar. Figure 1 graphically illustrates these operations.

Die Inversion wird mit Hilfe des erweiterten Euklidischen Algorithmus durchgeführt, also einem Verfahren, welches für die Eingabe von 2 Zahlen a, b < 0 den Wert d = ggT(a, b) sowie 2 Zahlen x und y mit d = x.a + y.b berechnet.The inversion is carried out using the advanced Euclidean algorithm, in other words, a method which, for the input of 2 numbers a, b <0, has the value d = ggT (a, b) and 2 numbers x and y calculated with d = x.a + y.b.

Für die Anwendung bei der Inversion wird dies folgendermaßen verwendet: Man setzt das erste Argument (a) auf die Primzahl modulo derer man das zweite Argument (b) invertieren will; da der größte gemeinsame Teiler einer Primzahl mit einer beliebigen anderen Zahl (kleiner als diese Primzahl) immer 1 ist, hat man die folgende Identität:
For the application in the inversion this is used as follows: The first argument (a) is set to the prime number modulo which one wants to invert the second argument (b); Since the greatest common divisor of a prime number with any other number (smaller than this prime number) is always 1, one has the following identity:

1 = ggT(a, p) = x.a + y.p = x.a (mod p)
1 = ggT (a, p) = xa + yp = xa (mod p)

wobei die letzte Gleichheit gilt, da y.p mod p identisch 0 ist. Damit ist also gezeigt, daß x = a-1 mod p gilt und daß x damit die gesuchte Inverse von a ist.where the last equality applies since yp mod p is identical to 0. This shows that x = a -1 mod p and that x is the inverse of a.

Der genaue Algorithmus dazu lautet in diesem Fall (die erste Vertauschung der Rollen von a & p dient nur dazu, daß ein ansonsten durchgeführter, zusätzlicher Schritt entfällt):
Gegeben sind a, p in Z mit 0 < a < p, p ist eine Primzahl.
Gesucht ist x in Z, 0 < x < p mit x.a = 1 mod p.
In this case, the exact algorithm is as follows (the first swapping of the roles of a & p only serves to avoid an additional step that would otherwise have been carried out):
Given a, p in Z with 0 <a <p, p is a prime number.
We are looking for x in Z, 0 <x <p with xa = 1 mod p.

  • a) Initialisiere A = p, B = a, x1 = 1, x2 = 0a) Initialize A = p, B = a, x 1 = 1, x 2 = 0
  • b) Solange B < 0 ist:
    q = A/B
    r = A - q.B
    x0 = x2 - q.x1
    A = B
    B = r
    x2 = x1
    x1 = x0
    b) As long as B <0:
    q = A / B
    r = A - qB
    x 0 = x 2 - qx 1
    A = B
    B = r
    x 2 = x 1
    x 1 = x 0
  • c) Setze x = x0 c) Set x = x 0

Der Vorteil des neuen Algorithmus ist, daß die Neuberechnung von A und die Berechnung von x zusammengefasst werden, indem die beiden Werte in einem Register gespeichert werden (was dann notwendigerweise mindestens die doppelte Länge haben muß).The advantage of the new algorithm is that the recalculation of A and the Calculation of x can be summarized by combining the two values in one Registers are saved (which then necessarily at least double Length).

Der Vorteil bei dieser Vorgehensweise die beiden Berechnungen zusammen zu fassen liegt nicht nur in der Beschleunigung der Rechenzeiten. Vielmehr ist es so, daß auf den verwendeten Prozessoren das Laden der Register mit den Operanden zum Teil mehr Zeit kostet als die eigentliche arithmetische Operation. Da hierdurch die gleichzeitige Verarbeitung ein Ladezyklus entfällt, ist der Algorithmus schon allein dadurch deutlich schneller.The advantage of this approach is to summarize the two calculations lies not only in the acceleration of the computing times. Rather, it is the case that Processors sometimes used register loading with operands Time costs as the actual arithmetic operation. Because this makes the simultaneous If a load cycle is not processed, the algorithm alone is clear more quickly.

Der zu implementierende Algorithmus sieht prinzipiell folgendermaßen aus:
The algorithm to be implemented looks in principle as follows:

Initialisiere T = A.2l+k + x2 sowie U = B.2l+k + x1 Initialize T = A.2 l + k + x 2 and U = B.2 l + k + x 1

Nachfolgend sollen die Rahmen die Registerlänge des verwendeten Prozessors verdeutlichen:Below, the frames are the register length of the processor used clarify:

Darstellung von T Representation of T

Darstellung von U Representation of U

Der Algorithmus arbeitet dann mit den Werten von T und U, bearbeitet also A und B bzw. x2 und x1 gleichzeitig. Die Subtraktion V = T - q.U liefert dann die Ergebnisse für r & x0 in einem Schritt. The algorithm then works with the values of T and U, i.e. processes A and B or x 2 and x 1 simultaneously. The subtraction V = T - qU then provides the results for r & x 0 in one step.

Solange B < 0:
q = A/B
V = T - q.U (V = (r, x0))
T = U
U = V
As long as B <0:
q = A / B
V = T - qU (V = (r, x 0 ))
T = U
U = V

Wenn B ≦ 0: Setze x = x2.If B ≦ 0: set x = x 2 .

Der Quotient q wird in der Praxis nicht wirklich ausgerechnet. Statt dessen werden sukzessive die maximal möglichen Vielfachen (mit einer Zweierpotenz) abgezogen. Bei der Subtraktion von X2 und dem jeweiligen Vielfachen von X1 pflanzt sich das Vorzeichenbit bei der üblichen Binärdarstellung der Operanden bis zur Darstellung von A fort.The quotient q is not really calculated in practice. Instead, the maximum possible multiples are successively subtracted (with a power of two). With the subtraction of X 2 and the respective multiple of X 1 , the sign bit propagates until the representation of A in the usual binary representation of the operands.

Dadurch, daß mit dieser Formulierung die Rechnungen deutlich schneller werden, ist man in der Lage, den Programmcode auf der Karte vollkommen unabhängig von den Kurvenparametern zu halten und kann somit diese erst zu einem späteren Zeitpunkt (z. B. bei der Personalisierung der Karte) in das EEPROM laden.Because this wording makes the calculations much faster, one is able to completely independent of the program code on the card keep the curve parameters and can therefore only at a later Load the time (e.g. when personalizing the card) into the EEPROM.

Kurze Beschreibung des euklidischen AlgorithmusBrief description of the Euclidean algorithm

Der Algorithmus berechnet von zwei Elementen P und Q den größten gemeinsamen Teiler D = gcd (P, Q) (gcd = greatest common divisor = ggT = größter gemeinsamer Teiler) und in der erweiterten Form zusätzlich zwei Elemente AP und BQ mit
The algorithm calculates the largest common divisor D = gcd (P, Q) (gcd = greatest common divisor = ggT = largest common divisor) of two elements P and Q and in the extended form also two elements A P and B Q

AP.P + BQ.Q = D (1)A P .P + B Q .Q = D (1)

Benötigt wird der euklidische Algorithmus vorwiegend zur Berechnung einer Inversen. Dazu sei P ein Primelement, der größte gemeinsame Teiler ist also das 1-Element, und gesucht wird BQ mit
The Euclidean algorithm is mainly required to calculate an inverse. Let P be a prime element, so the greatest common divisor is the 1 element, and B Q is also searched for

BQ.Q ∼ 1 mod P (2)B Q .Q ∼ 1 mod P (2)

Beschrieben wird zunächst der allgemeine Ablauf des Algorithmus in einer symmetrischen Form; der Grund dafür wird nachgeliefert. Es werden zwei weitere Elemente AQ und BP verwendet; beim Start finden die folgenden Initialisierungen statt:
The general procedure of the algorithm is first described in a symmetrical form; the reason for this will be added. Two other elements A Q and B P are used; The following initializations take place at startup:

P' = P
Q' = Q
BQ = AQ = 1
AP = BP = 0 (3)
P '= P
Q '= Q
B Q = A Q = 1
A P = B P = 0 (3)

Der Algorithmus besteht aus Schritten der Form
The algorithm consists of steps of the form

Teil a: Bestimme vier Elemente pP, qP, pQ, qQ mit gcd (pP.P' + qP.Q', pQ.P' + qQ.Q') = D
Part a: Determine four elements p P , q P , p Q , q Q with gcd (p P .P '+ q P .Q', p Q .P '+ q Q .Q') = D

Teil b: Berechne neue Zwischenwerte
temp: = pP.P' + qP.Q'
Q': = pQ.P' + qQ.Q'
P': = temp
temp: = pQ.AQ + qQ.AP
AQ: = pP.AQ + qP.AP
AP: = temp
temp: = pQ.BP + qQ.BQ
BP: = pP.BP + qP.BQ
BQ: = temp (4)
Part b: Calculate new intermediate values
temp: = p P .P '+ q P .Q'
Q ': = p Q .P' + q Q .Q '
P ': = temp
temp: = p Q .A Q + q Q .A P
A Q : = p P .A Q + q P .A P
A P : = temp
temp: = p Q .B P + q Q .B Q
B P : = p P .B P + q P .B Q
B Q : = temp (4)

wodurch sichergestellt ist, daß die folgenden Gleichungen erfüllt sind:
which ensures that the following equations are satisfied:

AQ.P + BP.Q = P'
AP.P + BQ.Q = Q' (5)
A Q .P + B P .Q = P '
A P .P + B Q .Q = Q '(5)

Die symmetrische Formulierung macht deutlich (dies ist der Grund für ihre Verwendung), wie sich Zwischenschritte zusammenfassen lassen. Gilt:
The symmetrical wording makes it clear (this is the reason for its use) how intermediate steps can be summarized. Applies:

D = gcd (P', Q')
D = gcd (pP.P' + qP.Q', pQ.P' + qQ.Q')
P": = pP.P' + qP.Q'
Q": = pQ.P' + qQ.Q'
sowie
D = gcd (p'P.P" + q'P.Q", p'Q.P" + q'Q.Q"
P''': = p'P.P" + q'P.Q"
Q''': = p'Q.P" + q'Q.Q" (6)
D = gcd (P ', Q')
D = gcd (p P .P '+ q P .Q', p Q .P '+ q Q .Q')
P ": = p P .P '+ q P .Q'
Q ": = p Q .P '+ q Q .Q'
such as
D = gcd (p ' P .P "+ q' P .Q", p ' Q .P "+ q' Q .Q"
P ''': = p' P .P "+ q ' P .Q"
Q ''': = p' Q .P "+ q ' Q .Q" (6)

dann lassen sich die beiden Schritte zusammenfassen:
then the two steps can be summarized:

Die Berechnung der Vorfaktoren kann man natürlich genauso zusammenfassen:
Gelten
P' = AQ.P + BP.Q
Q' = AP.P + BQ.Q
und wird
The calculation of the pre-factors can of course be summarized in the same way:
Be valid
P '= A Q .P + B P .Q
Q '= A P .P + B Q .Q
and will

AQ,g: = pP,g.AQ + qP,g.AP
AP,g: = pQ,g.AQ + qQ,g.AP
BP,g: = pP,g.BP + QP,g.BQ
BQ,g: = pQ,g.BP + qQ,g.BQ (7)
A Q, g : = p P, g .A Q + q P, g .A P
A P, g : = p Q, g .A Q + q Q, g .A P
B P, g : = p P, g .B P + Q P, g .B Q
B Q, g : = p Q, g .B P + q Q, g .B Q (7)

gesetzt, so gilt auch:
P''' = AQ,g.P + BP,g.Q
Q''' = AP,g.P + BQ,g.Q.
also applies:
P '''= A Q, g .P + B P, g .Q
Q '''= A P, g .P + B Q, g .Q.

Offensichtlich beeinflussen sich die Faktoren (A für P und B für Q) nicht gegenseitig und die Schritte für ihre Berechnung sind immer völlig analog zu denen von P' und Q'. Dies heißt zum einen, daß das Inverse Q-1 mod P unabhängig von A berechnet werden kann und zum anderen, daß die Schritte zum Aktualisieren von BP parallel zu denen von P' sind
Obviously the factors (A for P and B for Q) do not influence each other and the steps for their calculation are always completely analogous to those of P 'and Q'. This means on the one hand that the inverse Q -1 mod P can be calculated independently of A and on the other hand that the steps for updating B P are parallel to those of P '

P'neu = pP.P' + qP.Q'
BP,neu = pP.BP + qP.BQ (8)
P ' new = p P .P' + q P .Q '
B P, new = p P .B P + q P .B Q (8)

und die Berechnung von BQ parallel zu der von Q'
and the calculation of B Q parallel to that of Q '

Q'neu = pQ.P' + qQ.Q'
BQ,neu = pQ.BP + qQ.BQ (9)
Q ' new = p Q .P' + q Q .Q '
B Q, new = p Q .B P + q Q .B Q (9)

ist.is.

Der Algorithmus endet wegen gcd (P, Q) = gcd (P', Q'), wenn P' oder/und Q' den Wert des größten gemeinsamen Teilers von P und Q annimmt. In diesem Fall sind entweder die beiden Werte P' und Q' gleich, oder einer von ihnen ist 0; diese Fälle kennzeichnen das Ende des Algorithmus.The algorithm ends because gcd (P, Q) = gcd (P ', Q') if P 'or / and Q' the value of the greatest common divisor of P and Q. In this case, either the two values P 'and Q' are the same, or one of them is 0; identify these cases the end of the algorithm.

Für die Berechnung der Inversen werden, wenn P das Primelement ist, nur die Werte BQ und BP mitgeführt. Der Algorithmus endet dann, wenn einer der Werte, P' oder Q', das 1-Element ist.If P is the prime element, only the values B Q and B P are included in the calculation of the inverses. The algorithm ends when one of the values, P 'or Q', is the 1 element.

Der beschriebene Algorithmus läßt sich weiter verallgemeinern; statt Multiplikationen (mit pP, pQ, qP, qQ) sind auch Divisionen möglich.The algorithm described can be further generalized; instead of multiplications (with p P , p Q , q P , q Q ), divisions are also possible.

Prinzipielle Umsetzung des euklidischen AlgorithmusBasic implementation of the Euclidean algorithm

Die übliche Formulierung des euklidischen Algorithmus beruht auf einer Division mit Rest. In jedem Teilschritt wird eine der beiden folgenden Operationen ausgeführt:
The usual formulation of the Euclidean algorithm is based on division by remainder. In each sub-step, one of the following two operations is carried out:

P'neu = P' + qP.Q', P'neu also der Rest der obigen Division und Q'neu = Q'
oder
pP = qQ = 1; qP = 0
P ' new = P' + q P .Q ', P' new thus the rest of the above division and Q ' new = Q'
or
p P = q Q = 1; q P = 0

Q'neu = Q' + pQ.P', Q'neu also der Rest der obigen Division und P'neu = P',
wobei elementar nachzurechnen ist, daß gcd (P'neu, Q'neu) = gcd (P', Q') ist.
Q ' new = Q' + p Q .P ', Q' new thus the rest of the above division and P ' new = P',
where it is elementary to calculate that gcd (P ' new , Q' new ) = gcd (P ', Q').

Letzteres gilt offensichtlich auch etwas allgemeiner:
The latter obviously also applies somewhat more generally:

gcd (a, b) = gcd (a + p.b, b) (10)gcd (a, b) = gcd (a + p.b, b) (10)

In der konkreten Umsetzung ist natürlich eine echte Division mit Langzahlen nicht praktikabel, es sind effizientere Vorgehensweisen nötig. Die genaue Umsetzung hängt dabei von der konkreten Darstellung der Elemente im Computer ab. Mit der üblichen Binärdarstellung und einer damit konsistenten Ordnungsrelation reichen die führenden Bits von P' und Q' zur (evtl. angenäherten) Bestimmung der Faktoren p bzw. q des üblichen euklidischen Algorithmus. Diese (meist "kleinen") Faktoren kann man über mehrere Schritte zusammenfassen, bevor man mit der vollständigen Langzahl multiplizieren muß.Of course, a real division with long numbers is not in the concrete implementation practicable, more efficient procedures are necessary. The exact implementation depends thereby on the concrete representation of the elements in the computer. With the usual Binary representation and a consistent order relation are enough Bits of P 'and Q' for (possibly approximate) determination of the factors p and q of the usual Euclidean algorithm. These (mostly "small") factors can be over summarize several steps before going with the full long number must multiply.

Man kann auch vollständig auf echte Multiplikationen mit Langzahlen verzichten und nur vergleichsweise günstige Shift-Operationen verwenden (binäre Verfahren). Diese laufen darauf hinaus, Divisionen und Multiplikationen implizit durchzuführen.You can also do without real multiplications with long numbers and use only comparatively cheap shift operations (binary methods). This amount to implicitly performing divisions and multiplications.

Da in jedem Fall eine konkrete Darstellung der Zahl eine Rolle spielt, wird im weiteren einer der beiden Fälle
Since a concrete representation of the number plays a role in each case, one of the two cases will be discussed below

  • - Primzahlarithmetik- prime arithmetic
  • - Polynomarithmetik (Charakteristik 2 Arithmetik)- polynomial arithmetic (characteristic 2 arithmetic)

zugrundegelegt. based on.  

Effiziente Umsetzung der Inversion im Primzahlkörper mit LangzahlregisternEfficient implementation of inversion in the prime number field with long number registers

Stehen Register mit mehr als der doppelten Länge einer Langzahl zur Verfügung, läßt sich die binäre Methode mit geringen Anforderungen an die Hardware realisieren. Beschrieben wird eine Inversion für Primzahlarithmetik, die gleiche Technik funktioniert aber auch für Charakteristik 2. Die Realisierung ist algorithmisch äquivalent zum üblichen erweiterten euklidischen Algorithmus.If registers with more than twice the length of a long number are available, leave implement the binary method with low hardware requirements. An inversion for prime number arithmetic is described, the same technique works but also for characteristic 2. The implementation is algorithmically equivalent to usual advanced Euclidean algorithm.

Als konkretes Modell für die zugrundegelegte Hardware dient die "advanced crypto engine (ACE)" der Sienens/Infineon "ALE66CX. . ."-Smartcard-Prozessorfamilie.The "advanced crypto" serves as a concrete model for the underlying hardware engine (ACE) "of the Sienens / Infineon" ALE66CX. . . "- Smartcard processor family.

Grundsätze des VerfahrensPrinciples of the procedure

Gegeben sind zwei Register N und Z mit fester Bitlänge 2.l + k, zwei binärcodierte Zahlen P (= P') und Q (= Q'), wobei P eine Primzahl ist und Q ≦ P (= nur im Fall von Polynomarithmetik) sowie zwei Zahlen BP und BQ, initialisiert mit BP = 0 bzw. BQ = 1. Alle Zahlen werden mit l Bit dargestellt und sind gegebenenfalls mit führenden Nullen versehen. Im realisierten euklidischen Algorithmus wird die Division mit Rest nicht direkt durchgeführt, sondern durch einzelne Schritte der Form
There are two registers N and Z with a fixed bit length 2.l + k, two binary-coded numbers P (= P ') and Q (= Q'), where P is a prime number and Q ≦ P (= only in the case of polynomial arithmetic) as well as two numbers B P and B Q , initialized with B P = 0 and B Q = 1, respectively. All numbers are represented with 1 bit and are optionally provided with leading zeros. In the implemented Euclidean algorithm, the division with remainder is not carried out directly, but through individual steps of the form

P = P - 2s.Q (falls P ≧ 2s.Q ist), (11)
P = P - 2 s .Q (if P ≧ 2 s .Q), (11)

wobei s bis 0 heruntergezählt wird. Zum Schluß (es gilt dann P < Q) ist P der Rest der Division. Zum Start des Algorithmus wird
where s is counted down to 0. In the end (then P <Q) P is the rest of the division. At the start of the algorithm

Z = P.2l+k + BP
N = Q.2l+k + BQ (12)
Z = P.2 l + k + B P
N = Q.2 l + k + B Q (12)

gesetzt; da alle Zahlen mit max l Bits dargestellt werden (natürlich muß die Anzahl der Trennbits k < 0 sein), findet keine (wesentliche) Beeinflussung zwischen P und Q auf der einen und BP und BQ auf der anderen Seite statt. Für den Ablauf des Algorithmus merkt man sich die aktuelle Bitzahl n der Darstellung von P, ebenso wird mit Q bzw. m verfahren. Ein Teilschritt läuft nach folgendem Muster ab:
set; since all numbers are represented with max 1 bits (of course the number of separating bits must be k <0), there is no (significant) influence between P and Q on the one hand and B P and B Q on the other. The current number of bits n of the representation of P is noted for the execution of the algorithm, and the same procedure is used with Q or m. A sub-step follows the following pattern:

Nach jedem Teilschritt tauschen Z und N ihre Rollen; das Ganze wiederholt sich, bis die Inverse von Q bestimmt ist. Für den Ablauf des Algorithmus genügen die Grundrechenarten (+ und -, Shift-Operationen sowie die Möglichkeit, das führende Bit von Z zu testen).After each step, Z and N swap roles; the whole thing repeats until the inverse of Q is determined. They are sufficient for the algorithm to run Basic arithmetic operations (+ and -, shift operations and the possibility of using the leading bit from Z to test).

Eine konkrete UmsetzungA concrete implementation

Für die konkrete Umsetzung wird eine Darstellung der Zahlen im Zweierkomplement vorausgesetzt, das führende (Negativ-)Bit muß man testen können; der Überlauf einer Addition wird am gesetzten Negativbit erkannt. For the concrete implementation, a representation of the numbers in two's complement is used provided that the leading (negative) bit must be able to be tested; the overflow of one Addition is recognized by the set negative bit.  

Zum Start des Algorithmus seien die führenden l < 2 Bits von Z mit P' = P gefüllt, dann folgen k-viele Null-Bits und dann BP. Im N-Register ist analog in den ersten Bits Q' = Q und in den letzten Bits BQ gespeichert. Zwei Zählvariablen m und n geben die Länge von P und Q in Bit an, es muß l < n ≧ m (sowie n < 2) gelten. Die Ausgangsposition ist also folgendermaßen:
At the start of the algorithm the leading l <2 bits of Z are filled with P '= P, followed by k-many zero bits and then B P. In the N register, Q '= Q is analogously stored in the first bits and B Q in the last bits. Two counting variables m and n indicate the length of P and Q in bits, l <n ≧ m (as well as n <2) must apply. The starting position is as follows:

wobei 0,1 und die Kleinbuchstaben p bzw. q einzelne Bits darstellen.where 0.1 and the lower case letters p and q represent individual bits.

In einem ersten Schritt werden die Register justiert:
In a first step, the registers are adjusted:

wesentlich ist hierbei die Differenz zwischen n und m. Konkret heißt dies, daß eine Subtraktion (Z = Z - N) für P' und BP folgende Bedeutung hat:
the difference between n and m is essential. Specifically, this means that a subtraction (Z = Z - N) for P 'and B P has the following meaning:

P' = P' - 2n-m Q'
B'P = B'P - 2n-m B'Q (15)
P '= P' - 2 nm Q '
B ' P = B' P - 2 nm B ' Q (15)

Hierbei sei zunächst vorausgesetzt, daß n-m - 1 ≧ 0 ist. Da im Algorithmus außer Shift-Operationen nur Subtraktionen und Additionen durchgeführt werden und das Shiften im wesentlichen nur der Justierung von P' und Q' auf die High-Bits der Register Z und N dient (es werden keine 0-Bits nachgeschoben, stattdessen wird die Bitlänge kleiner), sind (15) die einzigen echten arithmetischen Operationen.It is assumed that n-m - 1 ≧ 0. Because in the algorithm except Shift operations only subtractions and additions are performed and that  Shift only the adjustment of P 'and Q' to the high bits of the register Z and N is used (no 0-bits are added, instead the bit length smaller), (15) are the only real arithmetic operations.

Im Laufe des Teilschritts wird das führende Bit von Z durch Operationen der Form (15) zu 0 und das Z-Register um 1 Bit nach links geshiftet; ob danach das führende Bit von Z gleich 1 ist, weiß man nicht im voraus. Aus diesem Grund wird die Subtraktion in der Form
In the course of the substep, the leading bit from Z is shifted to 0 by operations of the form (15) and the Z register is shifted to the left by 1 bit; It is not known in advance whether the leading bit of Z is 1. Because of this, the subtraction is in the form

durchgeführt; solange das führende Bit gesetzt ist, ist Z < N sichergestellt. Bietet die Hardware einen einfachen Mechanismus zum Größenvergleich, ist es sinnvoller mit einem um 1 nach links geshifteten N zu arbeiten. In diesem Fall bietet sich
carried out; as long as the leading bit is set, Z <N is ensured. If the hardware offers a simple mechanism for size comparison, it makes more sense to work with an N shifted to the left. In this case it is a good idea

an. Versucht man das gleiche ohne die Operation (Z < N) zur Verfügung zu haben, kann man auf folgendes Codefragment zurückgreifen:
on. If you try the same thing without having the operation (Z <N) available, you can use the following code fragment:

Dies ist gleichwertig mit dem ersten Codefragment (wo das führende Bit von N = 0 ist).This is equivalent to the first code fragment (where the leading bit of N = 0).

Nach der Subtraktion ist das führende Bit sicher gelöscht, der Inhalt der Register sieht nun folgendermaßen aus:
After subtraction, the leading bit is safely deleted, the contents of the registers now look like this:

wobei sich BP eine 1 von P' borgt, die Bits-Darstellung von P' in Z ist also die von P'-1.where B P borrows a 1 from P ', so the bits representation of P' in Z is that of P'-1.

In jedem Fall ist die Länge von P' (wobei führende 0-Bits nicht gezählt werden) nun höchstens noch n-1. Abhängig vom Wert in N (genauer, falls n-1 ≧ m) wird nun:
shift_left Z, 1;
n = n-1;
was zu
In any case, the length of P '(leading 0 bits are not counted) is now at most n-1. Depending on the value in N (more precisely, if n-1 ≧ m):
shift_left Z, 1;
n = n-1;
what to

führt (das führende Bit von Z kann dabei durchaus 0 sein), durchgeführt und die Subtraktion wiederholt sich. Ist dagegen n = m, kann immer noch Z < N gelten, daher wird zum Abschluß des Teilschritts:
leads (the leading bit of Z can be 0), and the subtraction is repeated. On the other hand, if n = m, Z <N can still apply, so at the end of the substep:

durchgeführt. War bereits ganz zu Anfang n = m, so darf nur der gerade geschilderte Abschluß durchgeführt werden. Insgesamt ergibt sich für den Teilschritt, der die wesentliche Arbeit verrichtet, folgender Pseudocode:
Teilschritt
carried out. If n = m at the very beginning, only the conclusion just described may be carried out. Overall, the following pseudocode results for the sub-step that does the essential work:
Substep

Die anderen Teilschritte sind, bis auf den Abschluß, unproblematisch.
The other sub-steps, except for the conclusion, are unproblematic.

Der Gesamtablauf wird dann durch den folgenden Pseudocode beschrieben:
The overall process is then described by the following pseudocode:

Für den noch fehlenden Abschluß ist unter vernünftigen Bedingungen sichergestellt, daß im N-Register noch genau 2 Bits von Q' sind, von denen das erste 0 ist, also muß Q' ≦ 1 sein. Im Z-Register sind noch mehr als 2 Bits, das führende Bit ist ebenfalls 0 und das darauffolgende 1, also insbesondere P' < 1. Da bekannt ist, daß 1 der größte gemeinsame Teiler von P und Q ist, muß Q' = 1 gelten. Im wesentlichen kann der Pseudocode Teilschritt also nochmal ausgeführt werden, um auch P' auf 1 zu bringen. Nun ist eine der Zahlen BP oder BQ positiv, dies ist die gesuchte Inverse zu Q mod P.
For the still missing completion it is ensured under reasonable conditions that there are exactly 2 bits of Q 'in the N register, the first of which is 0, so Q' ≦ 1 must be. There are more than 2 bits in the Z register, the leading bit is also 0 and the following 1, in particular P '<1. Since it is known that 1 is the largest common divisor of P and Q, Q' = 1 be valid. Essentially, the pseudocode substep can therefore be carried out again in order to also bring P 'to 1. Now one of the numbers B P or B Q is positive, this is the inverse to Q mod P.

Es bleiben nun noch einige Dinge, die einer genaueren Betrachtung bedürfen: There are still a few things that require closer examination:  

Korrektheitcorrectness

Zunächst muß sichergestellt werden, daß der Algorithmus mit "sinnvollen" Startwerten gefüttert wird. Dies bedeutet, daß P ≧ 2 eine Primzahl ist und Q ≧ 1 sein muß.First of all, it must be ensured that the algorithm has "reasonable" start values is fed. This means that P ≧ 2 is a prime number and Q ≧ 1 must be.

Da sich BP eine 1 von P' borgt, ist die Bit-Darstellung von P', also die ersten n Bits des Z-Registers, in Wirklichkeit die von P'-1. Die Differenz zwischen P' und Q' ist aber bis zum Abschluß größer als der größte gemeinsame Teiler, also mindestens 2. Das Vorzeichen von P'-Q' bzw. Q'-P' wird von diesem "Fehler" damit nicht beeinflußt.Since B P borrows a 1 from P ', the bit representation of P', i.e. the first n bits of the Z register, is actually that of P'-1. However, the difference between P 'and Q' is greater than the largest common divisor, at least 2, until the conclusion. The sign of P'-Q 'or Q'-P' is not affected by this "error".

Eine zweite Folge des "Bit borgens" ist die Bitlänge von P'. Wäre der korrekte Wert eine Zweierpotenz (2n-1), so ist die tatsächliche Bitdarstellung 2n-1-1, die Bitlänge der Zahl also um 1 kürzer. Ist die um 1 zu kleine Zahl in Q', so führt dies aber nur dazu, daß die for-Schleife von Teilschritt einen Schleifendurchgang (den ersten) mehr durchführt als nötig. Ist nach anschließendem Tausche_Z_mit_N die um 1 verminderte Zahl im Z-Register, wird in Teilschritt der Schleifendurchgang "wegoptimiert".A second consequence of the "bit borrow" is the bit length of P '. If the correct value were a power of two (2 n-1 ), the actual bit representation is 2 n-1 -1, i.e. the bit length of the number is 1 shorter. If the number in Q 'is too small by 1, this only means that the for loop of partial step performs one loop pass (the first) more than necessary. If, after the subsequent exchange_Z_mit_N, the number in the Z register reduced by 1, the loop passage is "optimized away" in partial step.

Die eigentliche Rechnung wird, wie nicht anders zu erwarten, durch das "Bit borgen" auch nicht verfälscht, da sie auf die Register als Ganzes zurückgeführt wird:
As expected, the actual calculation is not falsified by the "borrow bit", since it is traced back to the register as a whole:

((P' - 1).2l+k + (2l+k - (-BP))) - (Q'.2l+k + BQ)).2s = ((P' - Q'.2s - 1).2l+k + (2l+k - (-BP) - BQ.2s))
((P '- 1) .2 l + k + (2 l + k - (-B P ))) - (Q'.2 l + k + B Q )). 2 s = ((P' - Q '.2 s - 1) .2 l + k + (2 l + k - (-B P ) - B Q .2 s ))

(Q'.2l+k + BQ)) - ((P' - 1).2l+k + (2l+k - (-BP))).2s = ((Q' - P'.2s).2l+k + (BQ + (-BP).2s))
(Q'.2 l + k + B Q )) - ((P '- 1) .2 l + k + (2 l + k - (-B P ))). 2 s = ((Q' - P '.2 s ) .2 l + k + (B Q + (-B P ) .2 s ))

wobei P', Q', -BP, BQ ≧ 0 sind.where P ', Q', -B P , B Q ≧ 0.

Insgesamt ist daher klar, daß die um 1 verminderte Bitdarstellung sich nicht fehlerhaft auf den euklidischen Algorithmus auswirkt. Außerdem ist klar, daß BQ und -BP immer positiv sind.Overall, it is therefore clear that the bit representation reduced by 1 does not have an incorrect effect on the Euclidean algorithm. It is also clear that B Q and -B P are always positive.

Bleibt (zumindest im Prinzip) als letztes noch die Frage, ob eine der Zahlen BP, BQ länger als l Bits (genauer: größer als P) werden kann. Für den euklidischen Algorithmus besteht diese Gefahr jedoch nicht, vgl. etwa "Knuth Vol. 2, p. 343". The last question (at least in principle) is whether one of the numbers B P , B Q can be longer than 1 bits (more precisely: greater than P). However, this danger does not exist for the Euclidean algorithm, cf. such as "Knuth Vol. 2, p. 343".

Hinweise zur effizienten DurchführungInstructions for efficient implementation

Wie der Algorithmus zu implementieren ist, damit er möglichst effektiv abläuft, hängt natürlich von der konkret verwendeten Harware ab. Sind Schleifenkonstrukte relativ teuer, bietet es sich an, die for-Schleife in Teilschritt zusammenzufassen, so daß in jedem Durchlauf s (falls genügend groß) um einen konstanten Wert (etwa zwischen 4 und 10) verringert wird. Auf der "SLE66CX-"-Familie ist dieses Verfahren anzuraten.How the algorithm is implemented so that it runs as effectively as possible depends of course on the specific hardware used. Are loop constructs relative expensive, it makes sense to combine the for loop in partial steps, so that in each pass s (if large enough) by a constant value (approximately between 4 and 10) is reduced. This procedure is recommended for the "SLE66CX -" family.

BeispieleExamples Problemstellung bei ECC-AlgorithmenProblem with ECC algorithms

Als Beispiel dient hier der Einfachheit halber die Erstellung einer sogenannten digitalen Signatur; es gibt aber auch Protokolle zum Verschlüsseln von Daten. Dieser ECDSA- Algorithmus (s. [ANSI], (IEEE]) zum Erstellen von Digitalen Signaturen funktioniert auf die folgende Art und Weise:
Legende:
Domain Parameter:
q Primzahl (< 160 Bit)
E: y2 = x3 + ax + b Elliptische Kurve über Fq
a Koeffizient von E (aus Fq)
b Koeffizient von E (aus Fq)
P = (xG, yG): Basispunkt auf der Kurve
xG Koeffizient von G (aus Fq)
yG Koeffizient von G (aus Fq)
n Ordnung von G
l Ordnung von E, wird nicht benutzt
h Co-Faktor (l = nh), wird nicht benutzt
Sonstige Elemente:
k Zufallszahl
m Nachricht
H Hashfunktion
H(m) Hashwert der Nachricht
Schlüsselelemente
d privater Schlüssel
Q = dP öffentlicher Schlüssel
Erzeugen von Signaturen:
For simplicity's sake, an example is the creation of a so-called digital signature; there are also protocols for encrypting data. This ECDSA algorithm (see [ANSI], (IEEE]) for creating digital signatures works in the following way:
Legend:
Domain parameters:
q Prime number (<160 bit)
E: y 2 = x 3 + ax + b elliptic curve over F q
a coefficient of E (from F q )
b coefficient of E (from F q )
P = (x G , y G ): base point on the curve
x G coefficient of G (from F q )
y G coefficient of G (from F q )
n order of G
l order of E, is not used
h Co-factor (l = nh) is not used
Other elements:
k random number
m message
H hash function
H (m) hash value of the message
Key elements
d private key
Q = dP public key
Generate signatures:

  • 1. Berechne e = H(m)1. Calculate e = H (m)
  • 2. Erzeuge eine Zufallszahl k mit 1 < k < n-12. Generate a random number k with 1 <k <n-1
  • 3. Berechne G = (x1, y1) = kP3. Calculate G = (x 1 , y 1 ) = kP
  • 4. Setze r = x1 mod n4. Set r = x 1 mod n
  • 5. Berechne s = k-1 (e + dr)5.Calculate s = k -1 (e + dr)
  • 6. Die Signatur für m ist (r, s)6. The signature for m is (r, s)

Überprüfen von Signaturen:
Check signatures:

  • 1. Berechne e = H(m)1. Calculate e = H (m)
  • 2. Berechne s-1 mod n2. Calculate s -1 mod n
  • 3. Berechne u1 = es-1 mod n3. Calculate u 1 = e s-1 mod n
  • 4. Berechne u2 = rs-1 mod n4. Calculate u 2 = r s-1 mod n
  • 5. Berechne u1P + u2Q = (x1, y1)5.Calculate u 1 P + u 2 Q = (x 1 , y 1 )
  • 6. Berechne t = x1 mod n6. Calculate t = x 1 mod n
  • 7. Signatur ist gültig falls t = r7. Signature is valid if t = r
Mathematische GrundlagenMathematical basics

Mit Hilfe des euklidischen Algorithmus läßt sich für zwei gegebene Zahlen a und b der größte gemeinsame Teiler d berechnen; die erweiterte Version liefert zusätzlich Koeffizienten x und y, so daß sich d als Linearkombination von a und b darstellen läßt, d. h. es gilt: d = xa + yb.With the help of the Euclidean algorithm, for two given numbers a and b calculate the greatest common factor d; the extended version also delivers Coefficients x and y, so that d is a linear combination of a and b lets, d. H. the following applies: d = xa + yb.

Dies kann für die notwendige Inversion folgendermaßen verwendet werden: Das Inverse eines Elementes q in ZP (bezeichnet mit q-1) ist eine Zahl, so daß gilt:
q q-1 = 1 (mod p)
d. h. es gilt q q-1 = n p für ein beliebiges n (ist also ein beliebiges Vielfaches von p). Berechnet man nun (mit der erweiterten Version des Algorithmus) den ggT von q und p (und beachtet, daß dieser 1 ist, da p in unserem Fall eine Primzahl darstellt), so er­ hält man Zahlen a und b mit
1 = d = aq + bp.
This can be used for the necessary inversion as follows: The inverse of an element q in Z P (denoted by q -1 ) is a number, so that:
qq -1 = 1 (mod p)
ie qq -1 = np for an arbitrary n (is therefore an arbitrary multiple of p). If you now calculate (with the extended version of the algorithm) the PGD of q and p (and note that this is 1, since p is a prime number in our case), then you keep numbers a and b with
1 = d = aq + bp.

Da nach Definition bp = 0 (mod p) gilt, hat man also a q = 1 (mod p) und das gewünschte Ergebnis lautet q-1 = a.Since bp = 0 (mod p) applies by definition, we have aq = 1 (mod p) and the desired result is q -1 = a.

Anpassung des erweiterten euklidischen AlgorithmusAdaptation of the extended Euclidean algorithm

Im erweiterten euklidischen Algorithmus werden 2 Zahlentripel (P, a, b) und (Q, c, d) verwendet, die nach jedem Schritt ihre Rollen tauschen. Ein einzelner Schritt besteht im wesentlichen aus einer Rechenoperation der Form
P = P - pQ
a = a - pc
b = b - pd
mit einer geeignet zu bestimmenden, relativ kleinen Zahl (wenige Bits) p. Daß die Tripel die Rollen tauschen, heißt, daß im nächsten Schritt
Q = Q - qP
c = c - qa
d = d - qb
berechnet wird. Der euklidische Algorithmus funktioniert dadurch, daß die in jedem Schritt zu bestimmenden Zahlen p bzw. q so gewählt werden können, daß die Langzahlen P und Q mit jedem Doppelschritt kleiner werden. Beim Start des Algorithmus wird c und d auf 1, a und b auf 0, Q auf die zu invertierende Zahl und P auf die Primzahl, modulo der invertiert wird, gesetzt.
In the extended Euclidean algorithm, two triplets of numbers (P, a, b) and (Q, c, d) are used, which switch roles after each step. A single step essentially consists of an arithmetic operation of the form
P = P - pQ
a = a - pc
b = b - pd
with a suitably determinable, relatively small number (a few bits) p. The fact that the triples swap roles means that in the next step
Q = Q - qP
c = c - qa
d = d - qb
is calculated. The Euclidean algorithm works in that the numbers p and q to be determined in each step can be chosen such that the long numbers P and Q become smaller with each double step. At the start of the algorithm, c and d are set to 1, a and b to 0, Q to the number to be inverted and P to the prime number, modulo which is inverted.

Im allgemeinen wird durch den Algorithmus der größte gemeinsame Teiler T von P und Q berechnet, man erhält als Ergebnis cP + bQ = T. In general, the largest common divisor T of P and Calculated Q, the result is cP + bQ = T.  

Bei einer Inversion bezüglich einer Primzahl kennt man den ggT (T = 1) und das Inverse von Q ist b oder d; man braucht c und a nicht zu berechnen. Die sukzessiv zu bestimmenden Zahlen p und q ergeben sich durch Teilen mit Rest von P durch Q (p = P/Q + Rest).In the case of an inversion with respect to a prime number one knows the ggT (T = 1) and that Inverse of Q is b or d; there is no need to calculate c and a. The successively too determining numbers p and q result from dividing with remainder of P by Q (p = P / Q + rest).

Anpassungen für LangzahlregisterAdjustments for long number registers

Prozessoren mit Langzahlregistern haben bei der Umsetzung des euklidischen Algorithmus zwei Probleme:
Processors with long number registers have two problems when implementing the Euclidean algorithm:

  • 1. Divisionen mit Rest, auch solche mit kleinen Zahlen, sind nicht ohne weiteres möglich. Daher kann bei der Division immer nur eine Zweierpotenz für p bestimmt werden. Praktisch heißt dies, daß P = P - pQ schrittweise, zuerst P = P - x(n)2nQ, dann P = P - x(n-1)2(n-l)Q und zum Schluß P = P - x(0)2Q (x(i) ist immer 0 oder 1), durchgeführt werden muß, wobei n die Differenz der Längen von P und Q in Bit ist; die Division von P durch Q wird also implizit durchgeführt.1. Divisions with remainder, even those with small numbers, are not easily possible. Therefore, only a power of two for p can be determined in the division. In practice this means that P = P - pQ step by step, first P = P - x (n) 2 nQ, then P = P - x (n-1) 2 (nl) Q and finally P = P - x (0) 2Q (x (i) is always 0 or 1), where n is the difference in length of P and Q in bits; the division of P by Q is therefore carried out implicitly.
  • 2. Die Gruppierung von Rechenschritten, hier P = P - pQ und b = b - pd, ist nicht ohne weiteres möglich, d. h. auch eine gleichartige Rechnung mit neuen Operanden kann nicht allein mit Befehlen für Langzahlregister durchgeführt werden (zumindest nicht mit den bisher existierenden Prozessoren für Smartcards). Die Lösung, p im steuernden Hostprozessor zu bestimmen, ist zwar immer möglich, aber ineffizient. Die Lösung besteht darin, daß P und b, sowie Q und d, je zusammen in einem Register untergebracht werden, jeweils durch einige Bits voneinander getrennt. Wird nun die Rechnung P = P - pQ, für eine Zweierpotenz p, durchgeführt, wird gleichzeitig auch b = b - pd berechnet. Dadurch genügt es, wie oben beschrieben, die Berechnung von p bzw. P = P - pQ schrittweise durchzuführen; dies ist mit geringem Aufwand effizient möglich (z. B. auf den SLE-Chips). Ein Problem ist, daß b und d die Zahlen P und Q nicht (wesentlich) beeinflussen dürfen. Eine Analyse zeigt, daß p und q immer positiv sind, also ist d immer positiv (und damit unproblematisch) und b immer negativ. In der üblichen Binärdarstellung der Langzahlen bedeutet dies, daß sich "b von P eine 1 borgt", ein Umstand, der im Algorithmus berücksichtigt werden muß.2. The grouping of calculation steps, here P = P - pQ and b = b - pd, is not easily possible, d. H. also a similar calculation with new ones Operands cannot be performed using commands for long number registers alone (at least not with the existing processors for smart cards). The Solution to determine p in the controlling host processor is always possible, but inefficient. The solution is that P and b, and Q and d, each together in one Registers are housed, each separated by a few bits. Becomes now the calculation P = P - pQ, for a power of two p, is carried out simultaneously also calculated b = b - pd. As a result, the calculation is sufficient, as described above of p or P = P - pQ to be carried out step by step; this is with little effort efficiently possible (e.g. on the SLE chips). One problem is that b and d are the numbers P and Q must not (significantly) influence. An analysis shows that p and q are always are positive, so d is always positive (and therefore unproblematic) and b is always negative. In the usual binary representation of the long numbers, this means that "b of P is a 1 borrows ", a fact that must be taken into account in the algorithm.
Konkretes Vorgehen bei der ImplementierungSpecific implementation procedure

Bestimmung einer Inversen im Primzahlkörper, d. h.
geg.:
eine Primzahl P
eine positive Zahl Q kleiner als P
eine Zahl D, so daß DP = 1 mod P ist.
Determination of an inverse in the prime number field, ie
given:
a prime number P
a positive number Q less than P
a number D, so that DP = 1 mod P.

Initialisierung des VerfahrensInitialization of the procedure

Die Anzahl der Bits in der Binärdarstellung von P sei n.
Die Anzahl der Bits in der Binärdarstellung von Q sei m (m < = n).
Die Anzahl trennender 0-Bits zwischen P und b, bzw. Q und d, ist x (x < = 1).
Die Länge der Langzahlregister beträgt mindestens 2n + x Bit.
P und b wird in ein Langzahlregister Z und Q und d in ein Langzahlregister y geladen und gemäß der trennenden x 0-Bits justiert:
Let the number of bits in the binary representation of P be n.
Let the number of bits in the binary representation of Q be m (m <= n).
The number of separating 0 bits between P and b, or Q and d, is x (x <= 1).
The length of the long number register is at least 2n + x bits.
P and b are loaded into a long number register Z and Q and d into a long number register y and adjusted according to the separating x 0 bits:

Hierbei wird b mit 0 und d mit 1 initialisiert und es ist möglich, daß m = n ist, ansonsten kennzeichnen Buchstaben Bits, die 0 oder 1 sein können; die führenden 0-Bits sind optional.Here b is initialized with 0 and d with 1 and it is possible that m = n, otherwise letters denote bits that can be 0 or 1; are the leading 0 bits optional.

Abhängig von der konkreten Hardwarearchitektur - zumindest das führende Bit von P muß getestet werden können - werden beide Register parallel nach links geshiftet, bis das führende Bit des Z-Registers gesetzt ist (dies ist bei der Implementierung auf CCP/ACE notwendig). Das führende Bit von P in Z ist nach der Initialisierung in jedem Fall gesetzt. Je nach Realisierung der Hardware muß das nicht das physikalisch höchstwertigste Bit des Z-Registers getestet werden können. Im folgenden ist mit "Testen des höchstwertigsten Bits des Z-Registers" das höchstwertigste Bit des Z-Registers gemeint, das getestet werden kann. Zum Abschluß der Initialisierung ist das höchstwertige Bit des Z-Registers das höchstwertige gesetzte Bit von P und Z und Y sind gemäß der trennenden x 0-Bits justiert:
Depending on the specific hardware architecture - at least the leading bit of P must be able to be tested - both registers are shifted in parallel to the left until the leading bit of the Z register is set (this is necessary for the implementation on CCP / ACE). The leading bit from P to Z is always set after initialization. Depending on the hardware implementation, it may not be possible to test the most physically significant bit of the Z register. In the following, "testing the most significant bit of the Z register" means the most significant bit of the Z register that can be tested. At the end of the initialization, the most significant bit of the Z register is the most significant bit of P and Z and Y are adjusted according to the separating x 0 bits:

Hauptschleife des VerfahrensMain loop of the process

  • 1. Berechne die Differenz u der führenden Nullen von y und Z (u gleich "Anzahl der führenden Nullen von Y" minus "Anzahl der führenden Nullen von Z"). u ist größer oder gleich 0.
    Falls 2uY < Z ist, setze Z = Z-2uY
    Setze u = u-1;
    falls u negativ ist, beende die Teilschleife, sonst gehe zur Zeile mit Z = Z - . . .
    1. Calculate the difference u of the leading zeros of y and Z (u equals "number of leading zeros of Y" minus "number of leading zeros of Z"). u is greater than or equal to 0.
    If 2 uY <Z, set Z = Z-2 uY
    Set u = u-1;
    if u is negative, end the loop, otherwise go to the line with Z = Z -. , ,
  • 2. Setze u = 0
    Wenn das führende Bit von Z nicht gesetzt, shifte Z um 1 nach links, setze n = n-1.
    Wiederhole den vorherigen Schritt, falls n < O ist und das führende Bit von Z nicht gesetzt ist.
    2. Set u = 0
    If the leading bit of Z is not set, shift Z left by 1, set n = n-1.
    Repeat the previous step if n <O and the leading bit of Z is not set.
  • 3. Vertausche Y und Z sowie m und n.3. Swap Y and Z as well as m and n.
  • 4. Falls m = 0 ist, beende die Hauptschleife.4. If m = 0, end the main loop.
Die konkrete Umsetzung am Beispiel des SLE66CxxSThe concrete implementation using the example of the SLE66CxxS

Dieser Prozessor besitzt einen mathematischen Koprozessor der Länge 1120 Bit (ACE, Advanced Crypto Engine) bzw. 560 Bit (CCP, Crypto Coprocessor) und erfüllt damit die notwendigen Voraussetzungen für die Implementierung des vorgeschlagenen Algorithmus. Es ist die Verwendung der maximalen in Standardisierungsbemühungen vorgesehenen Parametergrößen möglich (NIST, ANSI 512 Bit).This processor has a mathematical coprocessor with a length of 1120 bits (ACE, Advanced Crypto Engine) or 560 bit (CCP, Crypto Coprocessor) and fulfilled thus the necessary conditions for the implementation of the proposed Algorithm. It is the use of the maximum in standardization efforts provided parameter sizes possible (NIST, ANSI 512 bit).

Für die Verwendung der üblicherweise eingesetzten Parametergrößen (160-256 Bit) reicht es, den Prozessor in der Betriebsart mit der kurzen Registerlänge zu betreiben.For the use of the commonly used parameter sizes (160-256 bit) it is sufficient to operate the processor in the operating mode with the short register length.

Anwendungsgebieteapplication areas

  • 1. Verschlüsseln von Daten: Als Absender einer Nachricht möchte ich diese so behandeln, daß nur der vorgesehene Empfänger sie lesen kann. Dazu nehme ich den öffentlich bekannten Schlüssel und führe eine mathematische Transformation durch, die mit Kenntnis des geheimen Schlüssels rückgängig gemacht werden kann.1. Encrypt data: As the sender of a message, I would like it to be like this handle that only the intended recipient can read them. I'll take it with you  publicly known key and perform a mathematical transformation, which can be undone with knowledge of the secret key.
  • 2. Digitale Signaturen: Als Absender einer Nachricht möchte ich die Nachricht so kennzeichnen, daß sich der Empfänger davon überzeugen kann, daß diese Nachricht wirklich von mir stammt. Üblicherweise erzeugt man dazu mit Hilfe des geheimen Schlüssels eine zusätzliche Information, so daß sich der Empfänger Sicherheit dadurch verschaffen kann, daß er prüft, ob eine bestimmte Beziehung zwischen der erhaltenen Nachricht, dieser Zusatzinformation und meinem öffentlichen Schlüssel besteht.2. Digital signatures: As the sender of a message, I want the message to be like this indicate that the recipient can be convinced that this message really comes from me. Usually you create with the help of the secret Key additional information so that the recipient is safe by checking whether a certain relationship between the received message, this additional information and my public key consists.

Die Vorteile des Algorithmus entstammen der Tatsache, daß die Registerlänge des verwendeten Prozessors mehr als doppelt so lang wie die zu bearbeitenden Zahlen sind.The advantages of the algorithm stem from the fact that the register length of the processor used more than twice as long as the numbers to be processed are.

Der beschriebene Algorithmus ist in dieser Form auch in endlichen Körpern mit Charakteristik 2 verwendbar.The algorithm described is also in this form in finite fields Characteristic 2 can be used.

Claims (10)

1. Verfahren zur Durchführung einer Inversion im Primzahlkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven, wobei eine Inverse zu bestimmen ist, dadurch gekennzeichnet, daß in einem Rechenschritt die Ergebnisse zweier notwendiger Operatoren erhalten werden.1. A method for performing an inversion in the prime number field, in particular in the case of encryption by means of elliptic curves, an inverse being to be determined, characterized in that the results of two necessary operators are obtained in one calculation step. 2. Verfahren insbesondere nach Anspruch 1 zur Durchführung einer Inversion im Primzahlkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven, wobei eine Inverse zu bestimmen ist, dadurch gekennzeichnet, daß der erweiterte euklidische Algorithmus zur Bestimmung der Inversen im Primzahlkörper verwendet wird.2. The method in particular according to claim 1 for performing an inversion in Prime number field, particularly when encrypting using elliptic curves, where an inverse is to be determined, characterized in that the expanded Euclidean algorithm used to determine the inverse in the prime number field becomes. 3. Verfahren insbesondere nach Anspruch 1 oder 2 zur Durchführung einer Inversion im Primzahlkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven unter Verwendung eines Mikroprozessors, wobei der Mikroprozessor auf wenigstens zwei Register T und U zugreifen kann, deren Registerlänge echt größer ist als das Doppelte der Bitlänge der zu berechnenden Zahlen, wobei der Mikroprozessor über Arithmetikroutinen für solche Zahlen verfügt,
wobei gegeben sind a, p in Z mit 0 < a < p, p ist eine Primzahl,
wobei gesucht ist x in Z, 0 < x < p mit x.a = 1 mod p,
gekennzeichnet durch folgende Schritte:
Initialisiere A = p, B = a, x1 = 1, x2 = 0 und
T = A.2l+k + x2 sowie U = B.2l+k + x1
Solange B < 0:
q = A/B
V = T - q.U (V = (r, x0))
T = U
U = V
Wenn B ≦ 0: Setze x = x2
3. The method in particular according to claim 1 or 2 for performing an inversion in the prime number field, in particular when encrypting by means of elliptic curves using a microprocessor, the microprocessor being able to access at least two registers T and U, the register length of which is actually greater than twice the bit length the numbers to be calculated, the microprocessor having arithmetic routines for such numbers,
where a, p in Z with 0 <a <p, p is a prime number,
looking for x in Z, 0 <x <p with xa = 1 mod p,
characterized by the following steps:
Initialize A = p, B = a, x 1 = 1, x 2 = 0 and
T = A.2 l + k + x 2 and U = B.2 l + k + x 1
As long as B <0:
q = A / B
V = T - qU (V = (r, x 0 ))
T = U
U = V
If B ≦ 0: set x = x 2
4. Verfahren nach einem der Ansprüche 1 bis 3, dadurch gekennzeichnet, daß der Primzahlkörper und die Parameter der elliptischen Kurve frei gewählt werden. 4. The method according to any one of claims 1 to 3, characterized in that the Prime number field and the parameters of the elliptic curve can be chosen freely.   5. Vorrichtung, insbesondere Smartcard, zur Durchführung einer Inversion im Primzahlenkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven, wobei eine Inverse zu bestimmen ist, dadurch gekennzeichnet, daß die Vorrichtung über einen Mikroprozessor verfügt, der derart ausgebildet ist, daß in einem Rechenschritt die Ergebnisse zweier notwendiger Operatoren erhalten werden.5. Device, in particular smart card, for performing an inversion in Prime number field, especially in the case of encryption using elliptical Curves, an inverse to be determined, characterized in that the Device has a microprocessor which is designed such that in one Arithmetic step the results of two necessary operators can be obtained. 6. Vorrichtung, insbesondere Smartcard, insbesondere nach Anspruch 5 zur Durchführung einer Inversion im Primzahlkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven, wobei eine Inverse zu bestimmen ist, dadurch gekennzeichnet, daß der Mikroprozessor mit einem Speicher versehen ist, in welchem Befehle gespeichert sind, die den erweiterten euklidischen Algorithmus repräsentieren, mittels welchem die Bestimmung der Inversen im Primzahlkörper möglich ist.6. The device, in particular a smart card, in particular according to claim 5 Implementation of an inversion in the prime number field, particularly in the case of encryption by means of elliptic curves, whereby an inverse is to be determined, thereby characterized in that the microprocessor is provided with a memory in which Commands are stored which represent the extended Euclidean algorithm, by means of which the determination of the inverses in the prime number field is possible. 7. Vorrichtung, insbesondere Smartcard, insbesondere nach Anspruch 5 oder 6 zur Durchführung einer Inversion im Primzahlkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven unter Verwendung eines Mikroprozessors, wobei der Mikroprozessor auf wenigstens zwei Register T und U zugreifen kann, deren Registerlänge echt größer ist als das Doppelte der Bitlänge der zu berechnenden Zahlen, wobei der Mikroprozessor über Arithmetikroutinen für solche Zahlen verfügt,
wobei gegeben sind a, p in Z mit 0 < a < p, p ist eine Primzahl,
wobei gesucht ist x in Z, 0 < x < p mit x.a = 1 mod p,
dadurch gekennzeichnet, daß der Mikroprozessor über einen Speicher zur automatischen Ausführung folgender Schritte verfügt:
Initialisiere A = p, B = a, x1 = 1, x2 = 0 und
T = A.2l+k + x2 sowie U = B.2l+k + x1
Solange B < 0:
q = A/B
V = T - q.U (V = (r, x0))
T = U
U = V
Wenn B ≦ 0: Setze x = x2
7. The device, in particular a smart card, in particular according to claim 5 or 6 for performing an inversion in the prime number field, in particular when encrypting by means of elliptic curves using a microprocessor, the microprocessor being able to access at least two registers T and U, the register length of which is really greater than twice the bit length of the numbers to be calculated, the microprocessor having arithmetic routines for such numbers,
where a, p in Z with 0 <a <p, p is a prime number,
looking for x in Z, 0 <x <p with xa = 1 mod p,
characterized in that the microprocessor has a memory for automatically performing the following steps:
Initialize A = p, B = a, x 1 = 1, x 2 = 0 and
T = A.2 l + k + x 2 and U = B.2 l + k + x 1
As long as B <0:
q = A / B
V = T - qU (V = (r, x 0 ))
T = U
U = V
If B ≦ 0: set x = x 2
8. Vorrichtung, insbesondere Smartcard, insbesondere nach einem der Ansprüche 5 bis 7 zur Durchführung einer Inversion im Primzahlkörper insbesondere bei der Verschlüsselung mittels elliptischer Kurven unter Verwendung eines Mikroprozessors, dadurch gekennzeichnet, daß der Primzahlkörper und die Parameter der elliptischen Kurve erst nach Herstellung der Vorrichtung in einen vom Mikroprozessor auslesbaren Speicher, insbesondere ein EEPROM, eingelesen wurden, insbesondere beim Personalisieren der Vorrichtung.8. Device, in particular smart card, in particular according to one of the claims 5 to 7 for performing an inversion in the prime number field, in particular in the case of Encryption using elliptic curves using a microprocessor, characterized in that the prime number field and the parameters of the elliptical Curve only after manufacture of the device in a readable by the microprocessor Memory, in particular an EEPROM, have been read in, especially when Personalize the device. 9. Verwendung eines Verfahrens oder einer Vorrichtung nach einem der vorangehenden Ansprüche bei der digitalen Datenübermittlung, insbesondere bei der Erzeugung digitaler Signaturen, bei Mobilfunk, Internet und sonstigen digitalen Übertragungsverfahren wie beispielsweise GSM, UMTS und DAB.9. Use of a method or a device according to one of the preceding claims in digital data transmission, in particular in the Generation of digital signatures for mobile radio, internet and other digital Transmission methods such as GSM, UMTS and DAB. 10. Maschinenlesbarer Speicher enthaltend die zum automatischen Ausführen eines Verfahrens nach einem der Ansprüche 1 bis 4 benötigten Befehle.10. Machine readable memory containing those for automatic execution a method according to one of claims 1 to 4 required commands.
DE10101884A 2000-01-16 2001-01-16 Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably Withdrawn DE10101884A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
DE10101884A DE10101884A1 (en) 2000-01-16 2001-01-16 Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
DE10002901 2000-01-16
DE10101884A DE10101884A1 (en) 2000-01-16 2001-01-16 Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably

Publications (1)

Publication Number Publication Date
DE10101884A1 true DE10101884A1 (en) 2001-10-25

Family

ID=7628537

Family Applications (2)

Application Number Title Priority Date Filing Date
DE10101884A Withdrawn DE10101884A1 (en) 2000-01-16 2001-01-16 Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably
DE10190100T Expired - Fee Related DE10190100D2 (en) 2000-01-16 2001-01-16 Methods and devices for performing an inversion, in particular in the case of encryption using elliptical curves

Family Applications After (1)

Application Number Title Priority Date Filing Date
DE10190100T Expired - Fee Related DE10190100D2 (en) 2000-01-16 2001-01-16 Methods and devices for performing an inversion, in particular in the case of encryption using elliptical curves

Country Status (3)

Country Link
AU (1) AU3721801A (en)
DE (2) DE10101884A1 (en)
WO (1) WO2001052051A2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9047167B2 (en) 2002-05-06 2015-06-02 Giesecke & Devrient Gmbh Calculating the modular inverses of a value

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1946205B1 (en) 2005-10-18 2010-04-14 Telecom Italia S.p.A. A method for scalar multiplication in elliptic curve groups over prime fields for side-channel attack resistant cryptosystems
WO2007048430A1 (en) * 2005-10-28 2007-05-03 Telecom Italia S.P.A. A method for scalar multiplication in elliptic curve groups over binary polynomial fields for side-channel attack-resistant cryptosystems

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
IL121297A0 (en) * 1997-07-14 1998-02-22 L P K Information Integrity Lt A method and apparatus for the efficient execution of elliptic curve cryptographic operations

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9047167B2 (en) 2002-05-06 2015-06-02 Giesecke & Devrient Gmbh Calculating the modular inverses of a value

Also Published As

Publication number Publication date
WO2001052051A3 (en) 2001-10-25
AU3721801A (en) 2001-07-24
WO2001052051A2 (en) 2001-07-19
DE10190100D2 (en) 2002-06-06

Similar Documents

Publication Publication Date Title
DE2843583C2 (en) Method for access-secure message traffic over an unsecured message transmission channel
DE60217260T2 (en) Data processing and encryption unit
DE69829967T2 (en) METHOD AND DEVICE FOR QUICK ELLIPTIC ENCRYPTION WITH IMMEDIATE EMBEDDING
DE60316586T2 (en) EFFICIENT ARITHMETIC IN GALOIS FIELDS OF UNGERADER CHARACTERISTICS ON BINARY HARDWARE
DE102017117907B4 (en) Performing a cryptographic operation
DE102018122278A1 (en) Perform a cryptographic operation
DE102005028662A1 (en) Polynom multiplication calculating method e.g. for elliptical curve cryptography, making available coefficients with two polynomials each polynomial fragmented into two or more fragments, being operands partial multiplication
EP2771782A1 (en) Efficient prime-number check
DE102015104421A1 (en) Method of using a token in cryptography
DE60109805T2 (en) METHOD AND SYSTEM FOR USE OF AN UNSAVERED CYPRUS ACCELERATOR
DE60117813T2 (en) Method and device for storing and retrieving eones private crypto key
DE112018002723B4 (en) SYSTEM, METHOD AND APPARATUS FOR CONCEALING DEVICE OPERATIONS
EP2641241B1 (en) Method for long-number division or modular reduction
EP1442391B1 (en) Method and device for guaranteeing a calculation in a cryptographic algorithm
DE10328860B4 (en) Device and method for encrypting data
DE10101884A1 (en) Cryptography implementation based on inversion using elliptic curves, intended for use with processors having long number registers, but limited processing power, the algorithm used reducing processing time considerably
DE10161137A1 (en) Cryptographic data processing system for signature verification tests elliptical and twisted curves and uses one coordinate for data encryption and transmission
WO2013060466A2 (en) Determination of a division remainder and detection of prime number candidates for a cryptographic application
DE102021106883A1 (en) Compression in lattice-based cryptography
EP2128754B1 (en) Safe sliding window exponentiation
WO2002019065A2 (en) Method and device for carrying out a modular exponentiation in a cryptographic processor
DE102004001659B4 (en) Apparatus and method for converting a first message into a second message
DE10162496B4 (en) Method and device for securing a calculation in a cryptographic algorithm
DE10156708A1 (en) Method and device for multiplying and method and device for adding on an elliptic curve
DE10057203C1 (en) Digital signal value calculation method for cryptography calculates scalar product from natural number and point along elliptical curve

Legal Events

Date Code Title Description
8141 Disposal/no request for examination