49 extern __device__ __host__
void fr_one(
fr_t &z);
57 extern __device__
void fr_print(
const char *s,
const fr_t &x);
__device__ void fr_sub(fr_t &z, const fr_t &x)
Calculates the difference of two residues modulo p and stores it into z.
__device__ void fr_x12(fr_t &z)
Multiply the residue mod r z by 12 with weak reduction.
__device__ void fr_x4(fr_t &z)
Multiply z by 4, and stores in z, with weak reduction.
__device__ __host__ void fr_fromUint64(fr_t &z, const uint64_t *x)
Converts from uint64_t[4] to a residue modulo r, without reduction.
__device__ void fr_sqr(fr_t &z)
Squares the value in z as a residue modulo r, and stores back into z.
__device__ void fr_x2(fr_t &z)
Multiply z by 2, and stores in z, with weak reduction.
__device__ void fr_print(const char *s, const fr_t &x)
prints the canonical representation of x to STDOUT.
__device__ void fr_x8(fr_t &z)
Multiply z by 8, and stores in z, with weak reduction.
__device__ bool fr_eq(const fr_t &x, const fr_t &y)
Compares two residues modulo r.
__device__ bool fr_neq(const fr_t &x, const fr_t &y)
Compares two fr_t residues.
uint64_t fr_t[4]
Subgroup element stored as a 256-bit array (a 4-element little-endian array of uint64_t)....
__device__ bool fr_nonzero(const fr_t &x)
Check if the reduced input x is different from zero.
__device__ void fr_x3(fr_t &z)
Multiply z by 3, and stores in z, with weak reduction.
__device__ bool fr_iszero(const fr_t &x)
Checks if the residue x modulo f is congruent to zero.
__device__ void fr_neg(fr_t &z)
Compute an additive inverse of a residue x modulo r. Stores in x. Subtracts x from the highest multip...
__global__ void fr_eq_wrapper(uint8_t *eq, int count, const fr_t *x, const fr_t *y)
Checks equality of two arrays of fr_t, element wise, and store in a byte array.
__device__ void fr_addsub(fr_t &x, fr_t &y)
Computes the sum and the difference of the arguments, storing back into the arguments: (x,...
__constant__ fr_t fr_roots[515]
Table for the precomputed root-of-unity values.
__device__ __host__ void fr_zero(fr_t &z)
Sets the value of z to zero.
__device__ __host__ void fr_cpy(fr_t &z, const fr_t &x)
Copy from x into z.
__device__ bool fr_isone(const fr_t &x)
Checks if the residue x modulo f is congruent to one.
__device__ void fr_toUint64(const fr_t &x, uint64_t *z)
Converts fr_t to uint64_t[4].
__device__ void fr_reduce4(fr_t &z)
Reduced the value in fr_t to the field modulus.
__device__ void fr_add(fr_t &z, const fr_t &x)
Computes the sum of two residues x and z modulo r and stores it in z. Device only function.
__device__ __host__ void fr_one(fr_t &z)
Sets the value of z to one.
__device__ void fr_mul(fr_t &z, const fr_t &x)
Multiply two residues module r z and x, stores back into z.
__global__ void fr_fft_wrapper(fr_t *output, const fr_t *input)
wrapper for fr_fft: FFT for fr_t[512]
__device__ void fr_inv(fr_t &z)
Calculates the multiplicative inverse of z, and stores back.
__global__ void fr_ift_wrapper(fr_t *output, const fr_t *input)
wrapper for fr_ift: inverse FFT for fr_t[512]
__device__ void fr_ift(fr_t *output, const fr_t *input)
Inverse FFT for fr_t[512].
__device__ void fr_fft(fr_t *output, const fr_t *input)
FFT over Fr.