Arithmetic Operations in the Polynomial Modular Number System

Arithmetic Operations in the Polynomial Modular Number System

Arithmetic Operations in the Polynomial Modular Number System Jean-Claude Bajard1, Laurent Imbert1,2, and Thomas Plantard1 1 CNRS LIRMM UMR 5506 161 rue Ada, 34392 Montpellier cedex 5, France 2 ATIPS, CISaC, University of Calgary 2500 University drive NW, Calgary, AB, T2N 1N4, Canada Abstract rett [3]. (For more details, see [10], chapter 14.) These general algorithms do not require the divisor, also called We propose a new number representation and arithmetic modulus, to be of special form. When this is the case, how- for the elements of the ring of integers modulo p. The so- ever, modular multiplication and reduction can be acceler- called Polynomial Modular Number System (PMNS) allows ated considerably. Mersenne numbers, of the form 2m − 1, for fast polynomial arithmetic and easy parallelization. The are the most common examples. Pseudo-Mersenne num- most important contribution of this paper is the fundamen- bers [5], generalized Mersenne numbers [14], and their ex- tal theorem of a Modular Number System, which provides tension [4] are other examples of numbers allowing fast a bound for the coefficients of the polynomials used to rep- modular arithmetic. resent the set Zp. However, we also propose a complete set of algorithms to perform the arithmetic operations over a PMNS, which make this system of practical interest for In a recent paper [2], we have defined the so-called Mod- people concerned about efficient implementation of modu- ular Number Systems (MNS) and Adapted Modular Num- lar arithmetic. ber Systems (AMNS) to speed up the arithmetic operations for moduli which do not belong to any of the previous Keywords: Number system, Modular arithmetic, Lat- classes. In this paper, we propose a new representation, and tice theory, Table-based methods the corresponding arithmetic operations for the elements of Zp, the ring of integers modulo p. (The integer p does not 1. Introduction have to be a prime, although it is very likely to be prime for practical cryptographic applications.) We define the Poly- Efficient implementation of modular arithmetic is an nomial Modular Number System (PMNS), over which inte- important prerequisite in today’s public-key cryptogra- gers are represented as polynomials. Compared to the clas- phy [10]. The celebrated RSA algorithm [13], and the cryp- sical (binary) representation, polynomial arithmetic offers tosystems based on the discrete logarithm problem, such as the advantages of no carry propagation and easiest paral- Diffie-Hellman key exchange [6], need fast arithmetic mod- lelization. The main contribution of this paper is the fun- ulo integers of size 1024 to roughly 15000 bits. For the damental theorem of a MNS, which provides a bound for same level of security, elliptic curves defined over prime the coefficients of the polynomials used to represent the el- fields, require operations modulo prime numbers whose size ements of Zp. This theorem is presented in Section 3. It range approximately from 160 to 500 bits [8]. uses results from lattice reduction theory [9, 11]. The sec- Classic implementations use multiprecision arithmetic, ond half of the paper focuses on the arithmetic operations; where long integers are represented in a predefined high- in Section 4, we propose algorithms for the basic operations radix (usually a power of two depending on the word size – addition, multiplication, conversions – which all require a of the targeted architecture). Arithmetic operations, namely final step, called coefficient reduction, that we present in modular reduction and multiplication, are performed using details in Section 5. A numerical example is provided in efficient algorithms, such as as Montgomery [12], or Bar- Section 6. 2. Modular number systems 1 2 3 4 1 −γ2 1 − γ2 −1 + γ + γ2 In classic positional number systems, every non-negative 5 6 7 8 integer, x, is uniquely represented in radix r as γ + γ2 −1 + γ γ 1 + γ 9 10 11 12 2 n−1 −1 − γ −γ 1 − γ −γ − γ i x = xi r , where xi ∈ {0,..., r − 1}. (1) 13 14 15 16 Xi=0 1 − γ − γ2 −1 + γ2 γ2 1 + γ2 If x − 6= 0, x is said to be a n-digit radix-r number. n 1 Z∗ Table 1. The elements of 17 in the MNS de• In most public-key cryptographic applications, compu- fined as B = MNS(17, 3, 7, 2) tations have to be done over finite rings or fields. In prime fields GF (p), we deal with representatives of equivalence classes modulo p (for simplicity we generally use the set of In example 1, we remark that the number of polynomials of positive integers {0, 1,..., p−1}), and the arithmetic oper- degree 2, with coefficients in {−1, 0, 1} is equal to 33 = 27. ations – addition and multiplication – are performed mod- Since we only have to represent 17 values, the system is ulo p. In order to represent the set of integers modulo p, we clearly redundant. For example, we have 6 = 1 + γ + γ2 = define a Modular number system, by extending the Defini- −1+γ, or 9 = 1−γ+γ2 = −1−γ. The level of redundancy tion (1) of positional number systems. depends on the parameters of the MNS. Note yet that, in this paper, we shall take advantage of the redundancy only by considering different representations of zero. Definition 1 (MNS) A Modular Number System, B, is a In a MNS, every integer, 0 ≤ x < p, is thus represented quadruple (p, n, γ, ρ), such that every positive integers, as a polynomial in γ. But; what do we know about the 0 ≤ x < p, satisfy coefficients of those polynomials? Are they bounded by some value which depends on the parameters of the MNS? In other words, given the integers and , are we able we n−1 p n x = x γi mod p, with γ > 1 and |x | < ρ. (2) determine ρ and construct a MNS? We answer these ques- i i tions in the next section. We prove the fundamental theorem Xi=0 of a MNS, using results from lattice reduction theory, and we introduce the concept of Polynomial Modular Number The vector (x0,..., xn−1)B denotes a representation of x System (PMNS). in B = MNS(p, n, γ, ρ). 3. Polynomial Modular Number Systems In the rest of the paper, we shall omit the subscript (.)B when it is clear from the context. We shall represent the in- In this section, we consider special cases of modular teger, a, either as the vector, a, or the polynomial, A, with- number systems, where γ is a root (modulo p) of a given polynomial . In the following fundamental theorem of a out distinction. We shall use ai to represent both for the ith E element of a, and the ith coefficient of A. (Note that we use MNS, we prove that if ρ is greater than a certain bound, then it is always possible to define a valid MNS. Roughly a left-to-right notation; i.e., a0, the left-most coefficient of A, is the constant term.) Hence, depending on the context, speaking, Theorem 1 says that there exitst a MNS, B = we shall use kak = kAk, to refer to the norm of the vector, MNS(p, n, γ, ρ), where one can represent every integer or the corresponding polynomial. We shall also use the no- less than p, as a polynomial of degree at most n − 1, with coefficients all less than 1/n, where is a small con- tation ai to refer to the ith vector within a set of vectors or C × p C a matrix. stant. Theorem 1 (Fundamental theorem of a MNS) Let us de- fine p, n > 1, and a polynomial E(X) = Xn + αX + β, Example 1 Let us consider a MNS defined with p = with α, β ∈ Z, such that E(γ) ≡ 0 (mod p), and E irre- 17, n = 3, γ = 7, ρ = 2. Over this system, we represent ducible in Z[X]. If the elements of Z17 as polynomials in γ, of degree at most 2, with coefficients in {−1, 0, 1} (cf. table 1). ρ ≥ (|α| + |β|) p1/n, (3) then, the parameters (p, n, γ, ρ) define a modular number 4. PMNS arithmetic system, B = MNS(p, n, γ, ρ). In this section, we propose algorithms for the classical Sketch of proof: (A complete, detailed, proof can be found operations in GF (p), namely addition and multiplication in [1].) modulo p, when the operands are represented in a PMNS. The proof is based on the theory of lattice reduction [9, We give solutions for the conversion from a classical num- lattice Rn 11]. A L is a discrete sub-group of , or equiv- ber system (binary) to PMNS, and back. For simplicity, we alently the set of all the integral combinations of d ≤ n assume that ρ = 2k and all the operands are represented in linearly independent vectors over R: B = P MNS(p, n, γ, 2k, E), with E = Xn + αX + β. At this point, it is very important to understand that L = L(A) = Z a1 + ··· + Z ad the value(s) k we must consider, depend on the way we = {λ a + ··· + λ a ; λ ∈ Z}. 1 1 n d i implement the coefficient reduction(s) presented in Sec- The matrix A = (a1,..., ad) is called a basis of L. It is tion 5. From Theorem 1, we know that every integer known that, every vector over R can be reduced, modulo the a < p can be represented in a PMNS with coefficients 1/n lattice, within the fundamental domain of L, given by |ai| ≤ (|α| + |β|) p , i.e., of size at most d 1 n log2 (|α| + |β|) + log2(p) bits.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    8 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us