galois_init_default_field returns an errno(3) code in case of error
instead of exiting. This is handy when the caller needs to perform
cleanup or error reporting when an error occurs instead of exit(2).
The exit(2) based error handling is preserved in the static
galois_init() function which is used in galois.c instead and is based on
galois_init_default_field to avoid code duplication.
Signed-off-by: Loic Dachary <loic@dachary.org>
So that the application can initialize gfp_array and gfp_is_composite
instead of relying on initialization happening implicitly when the
multiply or xor functions are called. The init function can be called
once when the application guarantees thread safety. And the multiply and
xor functions can be called from multiple threads without risking races.
Signed-off-by: Loic Dachary <loic@dachary.org>