A toolbox for fast computation in finite extension over finite rings
Many computational problems
need arithmetic operations in polynomial finite rings over
Z/nZ, where n is an integer (n>1).
Integer factorization and primality testing are examples of such
applications. To solve them, programmers either use general symbolic
mathematical software packages or write specific programs (most of the
time in C).
Symbolic mathematical software packages (e.g.
Maple, Mathematica,...) usually
handle with difficulty computations in finite fields. In the worst
cases, such programs perform computations with rationals before
finally reducing the objects modulo the characteristic n, or
such reductions are performed but extensions of a finite ring can't
be implemented. In any case, applications written with such
packages are ten to hundred times slower than an ad hoc
implementation in C. On the other hand, optimized C libraries
(PARI,
Lidia,
...) deal only with limited classes of finite fields, mainly
Z/nZ or GF(2n).
We believe it is possible to keep the efficiency of these C
libraries while working in any polynomial extension of
Z/nZ. We designed the ZEN library to perform
efficient arithmetic operations in these sets. That means one can
work not only in any polynomial extension of
Z/nZ, but also in any polynomial extension of
another finite ring even if n is not a prime or even if the
polynomial which defines the extension is not irreducible.
In addition, these functionalities are provided without loss of
simplicity. Of course, a compromise had to be made between
simplicity and efficiency. Therefore, this library can be used at
two levels.
- For a standard usage, the functions ZENFcts of the
library can be used to perform operations on elements, polynomials,
matrices, series and elliptic curves over every polynomial
extension over Z/nZ. Here, you only have to
include zen.h in your C sources and link your object files
with the library libzen.a.
- For advanced users who need to gain more efficiency, it is
possible to replace procedure calls by macros in their own
functions. Such users have to know the internal data structures
of the library and to write specific functions for each structure
if they still want to handle any finite ring. These users are then
sure that their applications are not penalized by inoportune
procedure calls.
The main features of the library are as follows:
- Basic operations on elements over any finite ring, including Karatsuba multiplication for large integers;
- Operations on polynomials over any finite ring, including Karatsuba multiplication for all polynomials;
- Operations on matrices over any finite ring, including inversion, and kernel computation;
- Operations on truncated series over any finite ring;
- Operations on elliptic curves over any finite ring, mainly the group law.
- Montgomery's representation for modular finite fields;
- Chinese remainder representations;
We have also developed high level procedures on top of ZEN : the
zenfact package.
The ZEN library is built on top
packages for big integer arithmetic. Currently, two packages can be used:
The ZEN library can be freely redistributed for non commercial usage
provided the above licenses are not violated. It is provided as is
with no warranty of correctness or efficiency. As mentioned above,
we shall in no event be liable for any indirect, incidental or
consequential damages resulting from its use. You may copy the zen
package in whole or in part as long as you don't try to make money
from it, or pretend that you wrote it, or make commercial use of it.
- Both authors are working for the
Centre d'Électronique de l'Armement, DGA.
- The first author developed part of this work during his PhD thesis
at LIENS
(GRECC).
- The second author did the same at
LIX.
Commercial use is subject to authorization.
Contact us.
We currently provide ZEN with the GMP package only.
- ZEN: The complete library. Includes all the
modules below.
- Modules
- ZEN engine (sys, Zbn, Zeg, Zed, Zer, Zext,
Zep, prgm): The engine of the library. Contains the big integers
routines, the extensions routines, and the modular operations for
unlimited sized integers. Also, contains compilation tools and some
test programs.
- Zeps: The modular operations for small
integers fitting in a computer word.
- Ze2: The characteristic 2
operations. Provides fast operations in finite fields
GF(2m).
- Zetab: Tabulated rings. Allows tabulation
of the operations in small rings (cardinality less than 256).
- Zelog: Tabulated fields. Allows
tabulation of the operations in small finite fields (cardinality less
than 65536), using a generator of the field.
- Zem: Montgomery representation of modular
finite fields. Can be used with every odd modulus.
- Zec: Chinese remainder representation of a
composed extension. Can be used as soon as a factorisation of the
modulus (integer or polynomial) is known.
- Zef: Provides basic operations on
fractions. All the other operations (polynomials, matrices, etc...)
can be used over Q but without any warranty of efficiency. Can
be used with unset denominators in order to perform operations on
relative integers.
- Applications
- Zenfact: Provides operations on integers
and polynomials such as pseudo-prime tests and factorization of
polynomials. (see the zenfact page for more
details).
The LaTeX source files
for the documentation for this library are contained in the C source
files. The command make doc produces a dvi file. You can
also download a PostScript version of the
documentation (compressed version
using gzip).
We have already used
the library intensively to implement various applications on a lot of
architectures. These examples are
listed in the ZENFACT page.
Some problems that can occur using ZEN are listed in
bugs.html
Last modified: 31 12 1998 16:28 MET