pairing_init_inp_str(pairing, stdin);
The largest changes involve pairing initialization and pairing parameters.
For pairing initialization, supply a buffer containing pairing parameters instead of a FILE * stream. For example, rather than:
pairing_init_inp_str(pairing, stdin);
write something like:
char s[1024];
size_t count = fread(s, 1, 1024, stdin);
if (!count) pbc_die("input error");
if (pairing_init_set_buf(pairing, s, count)) pbc_die("pairing init failed");
For file reads, personally I like to use mmap() which suits pairing_init_set_buf().
The pbc_param_t data type for pairing parameters replaces a_param_t, …, g_param_t. Having the same data type for all pairing parameter types simplifies the library, though some functions had to be changed slightly.
At last, one can initialize a pairing_t from a pbc_param_t:
pairing_t p; pbc_param_t par; pbc_param_init_a_gen(par, 160, 512); pairing_init_pbc_param(p, par); pbc_param_clear(par);
Minor differences:
I trimmed the API. The file stream operations are gone. I removed the fetch_ops_t and tracker_t types: the standard C library already provides routines for reading from disk to memory.
I refactored to avoid exposing symtab_t and darray_t, and undocumented routines such as poly_alloc(). I mostly preserved the headers that define these functions, but they are no longer included by pbc.h.
I replaced the CMake files with simple.make, which I use during development, though I test the autotools build before release.
To reduce symbol pollution, all official functions and variables of the PBC now start with pbc_, field_, element_ or pairing_. Other names mostly have hidden visibility in a shared library. Watch out for renamed functions.
I added a convenience wrapper element_pp_pow_zn(), and cleaned up a few source files.
Stefan Weber fixed a bug in Yulian Kalev’s random number generator code for Windows.
Yulian Kalev contributed a random number generator for Windows, using the Microsoft Crypto API.
A minor bugfix, and an API change for curve finding functions.