libdecaf
|
Generic arithmetic which has to be compiled per field. More...
Functions | |
void | gf_serialize (uint8_t serial[SER_BYTES], const gf x) |
Serialize to wire format. | |
mask_t | gf_lobit (const gf x) |
Return high bit of x = low bit of 2x mod p. | |
mask_t | gf_deserialize (gf x, const uint8_t serial[SER_BYTES], uint8_t hi_nmask) |
Deserialize from wire format; return -1 on success and 0 on failure. | |
void | gf_strong_reduce (gf a) |
Reduce to canonical form. | |
void | gf_sub (gf d, const gf a, const gf b) |
Subtract two gf elements d=a-b. | |
void | gf_add (gf d, const gf a, const gf b) |
Add two field elements d = a+b. | |
mask_t | gf_eq (const gf a, const gf b) |
Compare a==b. More... | |
Generic arithmetic which has to be compiled per field.
mask_t gf_eq | ( | const gf | a, |
const gf | b | ||
) |
Compare a==b.
a^2 x = 1, QNR, or 0 if x=0.