19 printf(
"=== RUN %s\n", __func__);
23 fr_t a, b, c, u, v, w;
50 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
61 printf(
"%ld tests\n", count);
76 printf(
"=== RUN %s\n", __func__);
106 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
117 printf(
"%ld tests\n", count);
119 printf(
"--- %s: %s\n", pass ?
"PASS" :
"FAIL", __func__);
133 printf(
"=== RUN %s\n", __func__);
137 fr_t a, b, c, u, v, w;
164 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
175 printf(
"%ld tests\n", count);
177 printf(
"--- %s: %s\n", pass ?
"PASS" :
"FAIL", __func__);
192 printf(
"=== RUN %s\n", __func__);
222 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
233 printf(
"%ld tests\n", count);
235 printf(
"--- %s: %s\n", pass ?
"PASS" :
"FAIL", __func__);
__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__ 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__ __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.
__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 FrTestSubDistributiveLeft(testval_t *testval)
Check the distributive property of multiplication in Fr (left of subtraction):
__global__ void FrTestAddDistributiveRight(testval_t *testval)
Check the distributive property of multiplication in Fr (right of addition):
__global__ void FrTestAddDistributiveLeft(testval_t *testval)
Check the distributive property of multiplication in Fr (left of addition):
__global__ void FrTestSubDistributiveRight(testval_t *testval)
Check the distributive property of multiplication in Fr (right of subtraction):