CRYPTOGRAPHY SYSTEM AND ELLIPTIC CURVE OPERATION METHOD
A cryptographic system is disclosed, implementing an Elliptic Curve operation method. A memory stores a program and data. A central processor unit (CPU) dispatches requests to the program. The program is converted into an equivalent substitution sequence comprising only arithmetic addition, subtraction and shift operations. A register pool stores data associated with the substitution sequence. An arithmetic logic unit (ALU) is controlled by the ASIC flow controller to execute the substitution sequence to output an execution result.
Latest MEDIATEK INC. Patents:
- Video encoder with motion compensated temporal filtering
- Antenna for multi-broadband and multi-polarization communication
- Dynamic frame rate adjustment mechanism
- METHOD FOR ADJUSTING TIME-AVERAGED PARAMETERS OF TRANSMITTING POWER OF RADIO MODULE AND ASSOCIATED RADIO MODULE
- Memory Inline Cypher Engine with Confidentiality, Integrity, and Anti-Replay for Artificial Intelligence or Machine Learning Accelerator
This application claims the benefit of U.S. Provisional Application No. 60/743,126, filed Jan. 12, 2006.
BACKGROUND OF THE INVENTION1. Field of the Invention
The invention relates to Elliptic Curve Cryptography (ECC), and in particular, to arithmetic circuits for EC operations.
2. Description of the Related Art
Elliptic Curve Cryptography (ECC) is an approach to public-key cryptography based on the algebraic structure of elliptic curves over finite fields. The use of elliptic curves in cryptography was suggested independently by Neal Koblitz and Victor S. Miller in 1985. Elliptic curves are also used in several integer factorization algorithms that have applications in cryptography, such as, for instance, Lenstra elliptic curve factorization, but this use of elliptic curves is not usually referred to as “elliptic curve cryptography.”
In ECC, a finite field, also referred to as a Galois field (GF), defines a field that contains only finitely many elements. The GF is typically categorized into two types, a prime field GF(p) and a binary field GF(2m). The prime field GF(p) is a finite field with p elements, usually labelled 0, 1, 2, . . . p−1, where arithmetic is performed with modulo p. Most of the ECC schemes are related to the prime field GF(p). Often seen examples are, the Elliptic Curve Diffie-Hellman (ECDH) key agreement scheme based on the Diffie-Hellman algorithm, the Elliptic Curve Digital Signature Algorithm (ECDSA) based on the Digital Signature Algorithm, and the ECMQV key agreement scheme based on the MQV key agreement scheme.
Conventionally, for a software based system, the ECC schemes are executed by a CPU cooperated with memory. The memory is accessed rapidly, thus a costly wide-width bus is requested. Specifically designed circuits are proposed to accelerate the EC operations. For example, prior arts in US patents U.S. Pat. No. 6,963,644, U.S. Pat. No. 6,820,105, U.S. Pat. No. 6,691,143 are hardware implementations for various ECC calculations, in which a plurality of multipliers and adders are utilized. Circuits in the published disclosures, however, are designed for particular operations, and the components therein can not be reused or shared by other algorithms. Thus, redundant components are used with considerable costs, and an improvement is therefore desirable.
BRIEF SUMMARY OF THE INVENTIONAn exemplary embodiment of a cryptographic system is disclosed to implement an Elliptic Curve operation method. A memory stores a program and data. A central processor unit (CPU) dispatches requests to the program. The program is converted into an equivalent substitution sequence comprising only arithmetic addition, subtraction and shift operations. A register pool stores program data associated with the substitution sequence. An arithmetic logic unit (ALU) is controlled by the ASIC flow controller or the CPU to execute the substitution sequence to output an execution result.
In the ALU, an adder adds or subtracts two input numbers based on an adder trigger signal to generate the execution result. Two selectors controlled by a selection signal, pass values from the register pool to the adder as the input numbers. The adder trigger signal and selection signal are delivered from the ASIC flow controller based on the substitution sequence.
In the register pool, a plurality of registers store the program data associated with the substitution sequence. A dispatcher selectively stores the execution result or program data to one of the registers based on a storage signal. The storage signal is delivered from the ASIC flow controller based on the substitution sequence.
The shift operation may be performed by the register pool. The ASIC flow controller delivers a shift signal to one of the registers when a shift operation is requested, and the register shifts its stored data leftwards or rightwards accordingly. Each selector is coupled to outputs of the registers, selecting one of them to pass an input number to the adder. The registers may be at least 160 bit, the adder is a 32 bit full adder, and the input numbers are 32 bit individually obtained from the registers based on the selection signal.
Specifically, the program is an Elliptic Curve (EC) related application comprising point multiplication and addition operations, and prime field multiplication, inversion, addition, and subtraction operations.
The ASIC flow controller converts the point multiplication operations to a sequence comprising only prime field operations and shift operations. Furthermore, the ASIC flow controller converts prime field multiplication and inversion operations to an equivalent sequence comprising only arithmetic addition, subtraction and shift operations, such that the substitution sequence equivalent to the program is generated. The conversion of the prime field multiplication and inversion operations is a Montgomery domain transfer.
Another embodiment is an Elliptic Curve operation method, for use in an apparatus only capable of performing arithmetic addition, subtraction and shift operations. A program to be executed is firstly provided. The program is converted into an equivalent substitution sequence comprising only arithmetic addition, subtraction and shift operations. The substitution sequence is then executed and an execution result is output. A detailed description is given in the following embodiments with reference to the accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGSThe invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein:
The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims.
Furthermore, EC point addition is convertible to a sequence of operations in Prime field GF(p), such as multiplication/inversion and addition/subtraction. Thus, multiplication (as well as inversion) in Prime field GF(p) is performed in state 207, serving as sub-functions for the aforementioned state blocks 201, 203 and 205. More than that, multiplication in Prime field GF(p) is also convertible to a sequence of arithmetic addition/subtraction operations. For example, by transferring into Montgomery domain, multiplication/inversion in Prime field GF(p) can be accomplished by only adders and bit shifters respectively associated within states 209. In view of the states classification, a generalized hardware is provided in the embodiment to perform all EC operations and operations over Prime field GF(p).
The ALU 220 comprises the adder 308, adding or subtracting two input numbers based on an adder trigger signal #addsub to generate the execution result. The two numbers are selected from the registers 304 by two selectors 306 according to a selection signal #select. The adder trigger signal #addsub and selection signal #select are delivered from the ASIC flow controller 120 or the CPU 102 when required. In the embodiment, the registers 304 are of 160 bit-width, and the adder 308 may be a 32 bit-width full adder. Each input number is 32 bit with an extra bit indicating carry or borrow. The output of the adder 308 is coupled to the dispatcher 302, thus the execution result #SUM can be feedback to the registers 304. If a 160 bit addition is requested, the adder 308 loops for five cycles with 32 bits processed per cycle. The execution result #SUM also comprises an extra bit to indicate carry or borrow. Through the control signals, the register pool 210 and ALU 220 flexibly solve all EC related operations by only addition, subtraction and shift operations.
Claims
1. A cryptographic system, comprising:
- a memory for storage of a program;
- a central processor unit (CPU), dispatching requests to an ASIC flow controller according to the program;
- the ASIC flow controller, coupled to the CPU, generating a substitution sequence and performing flow control of the substitution sequence;
- a register pool, coupled to the ASIC flow controller for storage of data associated with the substitution sequence; and
- an arithmetic logic unit (ALU), controlled by the ASIC flow controller to execute the substitution sequence and output an execution result; wherein the substitution sequence comprises only arithmetic addition, subtraction and shift operations.
2. The cryptography system as claimed in claim 1, wherein the substitution sequence is converted by the CPU.
3. The cryptography system as claimed in claim 1, wherein the substitution sequence is converted by the ASIC flow controller.
4. The cryptography system as claimed in claim 1, wherein the ALU comprises:
- an adder, adding or subtracting two input numbers based on an adder trigger signal to generate the execution result;
- two selectors, coupled to the register pool, controlled by a selection signal to pass values from the register pool to the adder as the input numbers; wherein:
- the adder trigger signal and selection signal are delivered from the ASIC flow controller or the CPU based on the substitution sequence.
5. The cryptography system as claimed in claim 4, wherein the register pool comprises:
- a plurality of registers for storage of data associated with the substitution sequence;and
- a dispatcher, selectively storing the execution result or data to one of the registers based on a storage signal; wherein:
- the storage signal is delivered from the ASIC flow controller or the CPU based on the substitution sequence.
6. The cryptography system as claimed in claim 5, wherein:
- the shift operation is performed by the ALU;
- the ASIC flow controller delivers a shift signal to ALU when a shift operation is requested; and
- the ALU shifts data stored in the register pool leftwards or rightwards according to the shift signal.
7. The cryptography system as claimed in claim 5, wherein each selector is coupled to outputs of the registers, selecting one of them to pass an input number to the ALU.
8. The cryptography system as claimed in claim 5, wherein:
- the registers are 160 bit; and
- the adder is a 32 bit full adder; and
- the input numbers are 32 bit individually obtained from the registers based on the selection signal.
9. The cryptography system as claimed in claim 1, wherein the program is an Elliptic Curve (EC) related application comprising:
- EC point multiplication and addition operations,
- prime field multiplication and inversion, and
- arithmetic addition, and subtraction operations.
10. The cryptography system as claimed in claim 9, wherein the ASIC flow controller converts the EC point multiplication operations to a first sequence of only EC point add operations and arithmetic operations.
11. The cryptography system as claimed in claim 10, wherein the ASIC flow controller converts the first sequence to a second sequence comprising only prime field operations and shift operations.
12. The cryptography system as claimed in claim 11, wherein the ASIC flow controller further converts prime field multiplication and inversion operations to an equivalent sequence comprising only arithmetic addition, subtraction and shift operations.
13. An Elliptic Curve operation method, for use in an apparatus only capable of performing arithmetic addition, subtraction and shift operations, comprising:
- providing a program to be executed;
- converting the program into an equivalent substitution sequence comprising only arithmetic addition, subtraction and shift operations;
- executing the substitution sequence, and outputting an execution result.
14. The Elliptic Curve operation method as claimed in claim 13, wherein the program is an Elliptic Curve(EC) related application comprising:
- point multiplication and addition operations,
- prime field multiplication and inversion, and
- arithmetic addition, and subtraction operations.
15. The Elliptic Curve operation method as claimed in claim 14, wherein the conversion comprises converting the point multiplication operations to an arithmetic sequence of only prime field operations and shift operations.
16. The Elliptic Curve operation method as claimed in claim 15, wherein the conversion further comprises, converting prime field multiplication and inversion operations to an equivalent sequence comprising only arithmetic addition, subtraction and shift operations, such that the substitution sequence equivalent to the program is generated.
17. The Elliptic Curve operation method as claimed in claim 16, wherein the conversion of the multiplication and inversion in the prime field operations comprises transferring the prime field multiplication and inversion operations to Montgomery domain.
18. The Elliptic Curve operation method as claimed in claim 13, further comprising providing flow control of the substitution sequence.
Type: Application
Filed: Jan 11, 2007
Publication Date: Aug 23, 2007
Applicant: MEDIATEK INC. (Hsin-Chu)
Inventors: Chia-Ping Chen (Hsinchu City), Ying-Che Hung (Taipei Hsien), Li-Lien Lin (Hsinchu City)
Application Number: 11/622,011
International Classification: H04L 9/00 (20060101);