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 fr_t x1, x2, x3, x8, x12, l, r;
134 for (
int j=0; pass && j<
ITER; j++) {
158 printf(
"%d: FAILED: inconsistent result\n", i);
169 for (
int i=0; pass && i<
TESTVALS; i++) {
175 for (
int j=0; pass && j<
ITER; j++) {
193 printf(
"%d: FAILED: inconsistent result\n", i);
202 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_x12(fr_t &z)
Multiply the residue mod r z by 12 with weak reduction.
__device__ void fr_x4(fr_t &z)
Multiply z by 4, and stores in z, with weak reduction.
__device__ void fr_x2(fr_t &z)
Multiply z by 2, and stores in z, with weak reduction.
__device__ void fr_x8(fr_t &z)
Multiply z by 8, 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_x3(fr_t &z)
Multiply z by 3, and stores in z, with weak reduction.
__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 FrTestMulConst(testval_t *testval)
Test multiply by constant on Fr: