20     printf(
"%s\n", __func__);
 
   23         p0 = 0xB9FEFFFFFFFFAAAB,
 
   24         p1 = 0x1EABFFFEB153FFFF,
 
   25         p2 = 0x6730D2A0F6B0F624,
 
   26         p3 = 0x64774B84F38512BF,
 
   27         p4 = 0x4B1BA7B6434BACD7,
 
   28         p5 = 0x1A0111EA397FE69A;
 
   63     for (
int j=0; j<64; i++,j++) { 
testval[i][0] = 1ULL << j; }
 
   64     for (
int j=0; j<64; i++,j++) { 
testval[i][1] = 1ULL << j; }
 
   65     for (
int j=0; j<64; i++,j++) { 
testval[i][2] = 1ULL << j; }
 
   66     for (
int j=0; j<64; i++,j++) { 
testval[i][3] = 1ULL << j; }
 
   67     for (
int j=0; j<64; i++,j++) { 
testval[i][4] = 1ULL << j; }
 
   68     for (
int j=0; j<64; i++,j++) { 
testval[i][5] = 1ULL << j; }
 
   70     for (
int j=2; j<386; i++,j++) {
 
   79     FILE *pf = fopen(
"/dev/urandom", 
"r");
 
   86     printf(
"Fixed/random test values: %d/%d\n", i, 
TESTVALS-i);
 
   93     X <<<1,block>>> (&testval[0]); \ 
   94     err = cudaDeviceSynchronize(); \ 
   96     if (err != cudaSuccess) printf("Error %d\n", err); \
 
   97     printf(" (%.2f s)\n", (end - start) * (1.0 / CLOCKS_PER_SEC));
 
  108 int main(
int argc, 
char **argv) {
 
  115         level = atoi(argv[1]);
 
  122     if (err != cudaSuccess) {
 
  172     err = cudaDeviceSynchronize();
 
  174     if (err != cudaSuccess)
 
  175         fprintf(stderr, 
"Error %d\n", err);
 
void init()
Variable initialization for the tests.
 
int main(int argc, char **argv)
Run tests on Fp functions.
 
__managed__ testval_t testval[TESTVALS]
 
__global__ void FpTestAssociativeAdd(testval_t *testval)
Test for the associative property of addition in Fp.
 
__global__ void FpTestAdd(testval_t *testval)
Test for addition in Fp.
 
__global__ void FpTestCommutativeAdd(testval_t *testval)
Test for the commutative property of addition in Fp.
 
__global__ void FpTestCmp(testval_t *testval)
Test for the comparison function in Fp; checks for inconsistencies in the following properties:
 
__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):
 
__global__ void FpTestFibonacci(testval_t *)
Test addition and subtraction in Fp using a fibonacci sequence (chain dependency) from 1 to ITERATION...
 
__global__ void FpTestInv(testval_t *testval)
Test for multiplicative inverse mod p in Fp.
 
__global__ void FpTestKAT(testval_t *)
Test for fp functions using KAT.
 
__global__ void FpTestMMA(testval_t *testval)
Test for multiply-multiply-add. Compare with current standalone implementation of multiplication adn ...
 
__global__ void FpTestMul(testval_t *testval)
Multiplication test, comparing with the native uint64_t multiplication.
 
__global__ void FpTestAssociativeMul(testval_t *testval)
Test for the associative property of multiplication.
 
__global__ void FpTestCommutativeMul(testval_t *testval)
Test for the commutative property of addition.
 
__global__ void FpTestMulConst(testval_t *testval)
Test self consistency in multiplication by constant:
 
__global__ void FpTestSqr2(testval_t *testval)
Test for squaring on Fp. Checks for self consistency:
 
__global__ void FpTestSqr(testval_t *testval)
Test for squaring on Fp. Checks for self consistency:
 
__global__ void FpTestSub(testval_t *testval)
Test for subtraction in Fp.
 
void testinit()
Sets a global variable to true if the STDOUT is a terminal. Needs to be done like so because while a ...