23 printf(
"=== RUN %s\n", __func__);
46 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
68 for (
int k=0; k<
ITER; k++) {
81 printf(
"%d,%d,%d: FAILED: inconsistent result\n", i, j, k);
93 printf(
"%ld tests\n", count);
__managed__ testval_t testval[TESTVALS]
__device__ void fr_print(const char *s, const fr_t &x)
prints the canonical representation of x to STDOUT.
__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_x2(fr_t &z)
Multiply z by 2, and stores in z, with weak reduction.
__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__ void fr_addsub(fr_t &x, fr_t &y)
Computes the sum and the difference of the arguments, storing back into the arguments: (x,...
__device__ __host__ void fr_cpy(fr_t &z, const fr_t &x)
Copy from x into z.
__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.
__global__ void FrTestAddSub(testval_t *testval)
Test for the fr_addsub kernel.