Professional Documents
Culture Documents
Abstract In this paper, we consider the problem of efcient computation of polynomial modular reduction: , where is a monic polynomial of degree and is a polynomial of degree not greater than , both and are dened over a commutative ring with identity. For given and the degree of , we present an algorithm to compute this problem in addition operations in and the same number of multiplication operations in , where is the Hamming weight of . Applications of the proposed algorithm to nite eld arithmetic are also discussed.
Key Word:
1.
INTRODUCTION
The recent advances in public key cryptography, especially elliptic curve cryptography, have rekindled the research in polynomial arithmetic, which is required in many nite eld operations. One example is nite eld multiplication. Let gree . Then
H.
Wu is with the Centre for Applied Cryptographic Research, Department of Combinatorics and Optimization, University of Waterloo, Waterloo, Canada N2L 3G1. E-mail:h3wu@cacr.math.uwaterloo.ca .
GF can be represented with a polynomial over GF of degree not greater than . Then a multiplication operation in GF can be realized in two steps: First we perform polynomial multiplication and obtain a product polynomial of degree not greater than ; Then the degree of this product polynomial is reduced to the proper degree range by applying to it polynomial modular operation. We consider here the problem of efcient computation of polynomial modular reduction:
, where is a monic polynomial of degree and
and
identity. One way to obtain polynomial modular reduction is to use the well known polynomial division algorithm ([2], pp 402).1 It has a complexity of operations in . Let denote the Hamming weight of
.
is also known for the second step of a standard basis nite eld multiplication as explained in the last paragraph, if
in the literature regarding to how efciently computing polynomial modular reduction tting the above complexity bound. In this paper, for given
present an algorithm to compute this problem in addition operations in and the same number of multiplication operations in , where is the Hamming weight of of this algorithm to nite eld arithmetic are also discussed. The organization of this paper is as follows: We present the algorithm in 2.1 and illustrate
.
we
Applications
how it works with an example in 2.2. The complexity issue is discussed in 2.3. Modications of the algorithm to suit for polynomials over nite eld of characteristic two are made in Section 3. The complexities of nite eld multiplication and squaring operation are respectively discussed in
2.
2.1. Algorithm
Let
and be given by
where
whose degree is to be reduced have its degree bounded by modular operation is given by
. Then polynomial
(1)
If
is a monomial, then
higher than . If
Part 1. Precomputation Input: and the upper bound of Output: Prepared coefcient lists . 1. Initialization of coefcient lists:
To , Step
For
Part 2. Main Program Input: The coefcients of Output: The coefcients of For
(ii).
To , Step
(i). Compute the product of the two terms of a pair for all the pairs in ;
, as follows:
, and the list is now referred to as a prepared CL. Part two and computation is performed on the CLs. In the
following we rst show the correctness of the algorithm with an example. Then complexity of the algorithm is analyzed.
2.2. An Example
Let the monic polynomial
be given as
(2)
and
given above.
1. Precomputation: preparing coefcient lists. (i). The coefcient lists are initialized:
(3)
4d 4c 4b 4a
4d 4c 4b 4a
This step can be explained as follows: For the terms whose degree is equal to or higher than that of lower than the bound
,
and equal to or
or:
By using (4a-4d), the coefcient lists (3) can be updated based on the following argument. For the rst expression (4a), as an example, after (4a) has been applied to
to reduce its degree, the coefcient of the term should be added to these of the terms
and , or added to the coefcient lists and . Since the term initially has
the coefcient
should be updated as
Consequently, , respectively.
and
The rest undates can be done based on the expressions (4b-4d) with similar argument. (iii). The precomputed or the prepared coefcient list can be given as
2. Main program Input:
(5)
The output is
. So we have
addition operations in
and
values of the coefcients can be variable as long as the degree and the distribution of Hamming weight of
are xed. In the above example, the precomputation step can still be performed
even if we do not know the values of coefcients that can be nonzero besides
and
and
2.3. Complexity
It can be seen that the complexity of Algorithm 1 (Part 2) depends on the size of coefcient lists. During the precomputation, each coefcient list is rst initialized to have one term . Then, in the second step in precomputation, the coefcient lists are expanded by terms. These terms are in the form of a pair. So the total number of terms in the prepared CLs is
The complexity of Algorithm 1 (Part 2) is decided by the steps (i) and (ii), where the sum of all the terms in a CL is obtained. Note that in the process of summing up, the product is used if a term is in the form of a pair. Since there are non-empty coefcient lists and they contain terms in total (of which terms are pairs), we conclude that
addition operations in and the same number of multiplication operations in are required for Algorithm 1 (Part 2). Since there are total elements of which are pairs, the amount for the required
memory for storing the prepared CLs is one element in . Note that only
memory amount can be reduced by storing only those CLs that are used in the Main program. Then the necessary memory should have
units. To further
save memory we may store in CLs the indices of the coefcients instead of their values.
3.
Then a nite
1.
where
2.
(6)
Complexity Clear, Algorithm 1 can be directly used to compute the expression (6) with
It has a complexity of addition operations in GF and constant multiplication operations in GF , where is the Hamming weight of the monic irreducible polynomial
.
If
then only operations in the ground eld are required for reduction modulo a polynomial.
since a constant in GF
or , the constant multiplication operations can be saved. Thus the step of reduction
modulo the irreducible polynomial requires only addition operations in GF. A version of Algorithm 1 over GF is given below.
Algorithm 2 Polynomial modular reduction over GF Input: . Output: , where . Part 1. Precomputation and the degree upper bound of Input: Output: Prepared coefcient lists . 1. Initialization of coefcient lists:
To , Step
For
To
Append
to .
Part 2. Main Program Input: The coefcients of Output: The coefcients of For
To , Step
Output as results:
. .
It can be seen that Algorithm 2 can be used for computing the expression (6) with
be a eld element in GF and be represented in the polynomial basis expanded from a root of
.
in GF is given by
where
In this case of application of Algorithm 1, since we have additional information on the polynomial that is to be reduced ( from that in Algorithm 2. Algorithm 3 Polynomial basis squaring in GF Input: . Output: , where Part 1. Precomputation Input: . Output: Prepared coefcient lists 1. Initialization of coefcient lists:
otherwise. To , Step To
For
Append
to .
Let If
is odd.
if
To , Step
(7) otherwise.
Then
For
10
For
To to .
Append
Part 2. Main Program Input: The coefcients of , and the prepared coefcient lists Output: The coefcients of : . For
To
Step
Output as results:
Complexity Let denote the number of terms appended to the precomputation part in Algorithm 3. Then we have
if
otherwise,
Let the number of bit additions required in Part 2 in Algorithm 3 be denoted by . Clearly,
. However, the CL with being odd was initially empty and thus in part two of the . Then is the number of the different odd values of and . If is irreducible over GF ,
algorithm one bit operation can be saved in summing up the elements in if it becomes non-empty after step 2 of part 1. Let for
if
(8)
otherwise, 11
where
Consider
be an irreducible trinomial
Then from (8) and note
,
if
is odd,
otherwise.
if if
is odd, is even.
References
[1] V. B. Afanasyev, C. Gehrmann and B. Smeets, Fast message authentication using efcient polynomial evaluation, Fast Software Encryption Workshop (E. Biham, Ed.), Lecture Notes in Computer Science, Springer-Verlag, New York, 1267 (1997) pp. 190-204. [2] D. E. Knuth, The Art of Computer Programming: Seminumerical Algorithms, AddisonWesley Publishing Company, Reading, MA (1981). [3] H. Wu, Efcient Computations in Finite Fields with Cryptographic Signicance, Ph.D Thesis, University of Waterloo, Waterloo,Ontario,Canada (1998).
12
Key Words:
Polynomial arithmetic, modular operation, nite eld arithmetic, complexity.
Postal: Huapeng Wu The Centre for Applied Cryptographic Research Dept of Combinatorics and Optimization University of Waterloo Waterloo Ontario Canada N2L 3G1 Voice: 519-888-4567 x3600 Fax: 519-725-5441 Email: h3wu@cacr.math.uwaterloo.ca
Afliation of Author: The Centre for Applied Cryptographic Research Dept of Combinatorics and Optimization University of Waterloo Footnotes:
1. In this algorithm, polynomials are required to be dened over a eld. However, if the divisor polynomial is a monic polynomial, then this method also applies to polynomials over a commutative ring with identity.
Melissa Sullivan Designs, Codes and Cryptography - Editorial Ofce Kluwer Academic Publishers 101 Philip Drive Norwell, MA 02061, U.S.A.