16 for (
int i=0; i<4; i++)
28 for (
int i=1; i<4; i++)
46 printf(
"%016lX%016lX%016lX%016lX\n",
49 t[3], t[2], t[1], t[0]);
101 unsigned tid = 0; tid += blockIdx.z;
102 tid *= gridDim.y; tid += blockIdx.y;
103 tid *= gridDim.x; tid += blockIdx.x;
104 tid *= blockDim.z; tid += threadIdx.z;
105 tid *= blockDim.y; tid += threadIdx.y;
106 tid *= blockDim.x; tid += threadIdx.x;
108 unsigned step = gridDim.z * gridDim.y * gridDim.x
109 * blockDim.z * blockDim.y * blockDim.x;
111 for (
unsigned i=tid; i<count; i+=step)
112 eq[i] =
fr_eq(x[i], y[i]);
__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_print(const char *s, const fr_t &x)
prints the canonical representation of x to STDOUT.
__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__ __host__ void fr_zero(fr_t &z)
Sets the value of z to zero.
__device__ void fr_toUint64(const fr_t &x, uint64_t *z)
Converts fr_t to uint64_t[4].
__device__ __host__ void fr_one(fr_t &z)
Sets the value of z to one.
__device__ bool fr_eq(const fr_t &x, const fr_t &y)
Compares two residues modulo r.
uint64_t fr_t[4]
Subgroup element stored as a 256-bit array (a 4-element little-endian array of uint64_t)....
__device__ __host__ void fr_cpy(fr_t &z, const fr_t &x)
Copy from x into z.
__device__ void fr_reduce4(fr_t &z)
Reduced the value in fr_t to the field modulus.