23 printf(
"=== RUN %s\n", __func__);
30 for (
int i=0; pass && i<
TESTVALS; i++) {
36 for (
int j=0; pass && j<
ITER; j++) {
48 printf(
"%d: FAILED: inconsistent result\n", j);
59 for (
int i=0; pass && i<
TESTVALS; i++) {
66 for (
int j=0; pass && j<
ITER; j++) {
87 printf(
"%d: FAILED: inconsistent result\n", j);
99 for (
int i=0; pass && i<
TESTVALS; i++) {
105 for (
int j=0; pass && j<
ITER; j++) {
117 printf(
"%d: FAILED: inconsistent result\n", j);
128 for (
int i=0; pass && i<
TESTVALS; i++) {
129 fp_t x1, x2, x3, x8, x12, l, r;
134 for (
int j=0; pass && j<
ITER; j++) {
151 printf(
"%d: FAILED: inconsistent result\n", i);
162 for (
int i=0; pass && i<
TESTVALS; i++) {
168 for (
int j=0; pass && j<
ITER; j++) {
186 printf(
"%d: FAILED: inconsistent result\n", i);
195 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.
__device__ void fp_x8(fp_t &z, const fp_t &x)
Multiplies x by 8 and stores the result into z.
__device__ void fp_x2(fp_t &z, const fp_t &x)
Multiplies x by 2 and stores the result into z.
__device__ void fp_x12(fp_t &z, const fp_t &x)
Multiplies the residue mod p x by 12 and stores the result into z.
__device__ void fp_x4(fp_t &z, const fp_t &x)
Multiplies x by 4 and stores the result into z.
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__ __host__ void fp_cpy(fp_t &z, const fp_t &x)
Copy from x into z.
__device__ void fp_x3(fp_t &z, const fp_t &x)
Multiplies x by 3 and stores the result into z.
__managed__ testval_t testval[TESTVALS]
__global__ void FpTestMulConst(testval_t *testval)
Test self consistency in multiplication by constant: