18 printf(
"=== RUN %s\n", __func__);
22 fp_t a, b, c, u, v, w;
49 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
60 printf(
"%ld tests\n", count);
75 printf(
"=== RUN %s\n", __func__);
105 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
116 printf(
"%ld tests\n", count);
131 printf(
"=== RUN %s\n", __func__);
135 fp_t a, b, c, u, v, w;
162 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
173 printf(
"%ld tests\n", count);
188 printf(
"=== RUN %s\n", __func__);
218 printf(
"%d,%d: FAILED: inconsistent result\n", i, j);
229 printf(
"%ld tests\n", count);
__device__ void fp_print(const char *s, const fp_t &x)
Prints the canonical representation of x to STDOUT.
__device__ bool fp_neq(const fp_t &x, const fp_t &y)
Compares two fp_t residues.
__device__ void fp_add(fp_t &z, const fp_t &x, const fp_t &y)
Computes the sum of two residues x and y modulo p and stores it in z. Device only function.
uint64_t fp_t[6]
Residue modulo p. Any 384-bit representative of each residue is allowed, and stored as a 6-element li...
__device__ void fp_mul(fp_t &z, const fp_t &x, const fp_t &y)
Multiplies two Fp residues x and y, stores in z.
__device__ __host__ void fp_cpy(fp_t &z, const fp_t &x)
Copy from x into z.
__device__ void fp_sub(fp_t &z, const fp_t &x, const fp_t &y)
Calculates the difference of two residues modulo p and stores it into z.
__managed__ testval_t testval[TESTVALS]
__global__ void FpTestSubDistributiveRight(testval_t *testval)
Check the distributive property of multiplication in Fp (right of subtraction):
__global__ void FpTestSubDistributiveLeft(testval_t *testval)
Check the distributive property of multiplication in Fp (left of subtraction):
__global__ void FpTestAddDistributiveLeft(testval_t *testval)
Check the distributive property of multiplication in Fp (left of addition):
__global__ void FpTestAddDistributiveRight(testval_t *testval)
Check the distributive property of multiplication in Fp (right of addition):