Loading...
Searching...
No Matches
f_generic.c File Reference

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.

## Detailed Description

Generic arithmetic which has to be compiled per field.

Author
  Mike Hamburg

Copyright
  Copyright (c) 2015-2016 Cryptography Research, Inc.
  Released under the MIT License. See LICENSE.txt for license information.

Warning
  This file was automatically generated in Python. Please do not edit it.

## Function Documentation

## gf_eq()

mask_t gf_eq | ( | const gf | a,
|  | const gf | b
| ) |  |

Compare a==b.

a^2 x = 1, QNR, or 0 if x=0.