scopedog / gf-nishida-16

A Simple and Fast 16bit Galois Field Arithmetic Library in C
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

This library provides simple and fast arithmetic functions (macros) in GF(2^16) and GF(2^8) based on table lookup. The only programs you need are gf.c and gf.h; copy them to your directory and compile your programs with them.

For GF(2^16), call

    GF16init();

first and then call other functions (macros) such as GF16mul(), GF16div(). Similarly for GF(2^8), call

    GF8init();

first and call other functions (macros) such as GF8mul(), GF18iv().

Some techniques to accelerate region calculation such as:

    for (i = 0; i < N; i++)
        c[i] = a * b[i]; // Static coefficient * array (region fo data)

are also included. Please see gf-bench/multiplication/gf-nishida-region-{16,8}/gf-bench.c for the code examples.

All the deitais and benchmark results are described in our technical papers gf-nishida-16.pdf (English) and gf-nishida-16-ja.pdf (Japanese).

CAUTION!! Never use b = 0 for GF16div(a, b) because it causes segmentation violation. The program does not check "(a == 0 || b == 0)" for speedup.

            Hiroshi Nishida
            nishida at asusa.net