FK20 CUDA
|
Go to the source code of this file.
Functions | |
__device__ __host__ void | fr_zero (fr_t &z) |
Sets the value of z to zero. More... | |
__device__ __host__ void | fr_one (fr_t &z) |
Sets the value of z to one. More... | |
__device__ void | fr_print (const char *s, const fr_t &x) |
prints the canonical representation of x to STDOUT. More... | |
__device__ __host__ void | fr_fromUint64 (fr_t &z, const uint64_t *x) |
Converts from uint64_t[4] to a residue modulo r, without reduction. More... | |
__device__ void | fr_toUint64 (const fr_t &x, uint64_t *z) |
Converts fr_t to uint64_t[4]. More... | |
__global__ void | fr_eq_wrapper (uint8_t *eq, int count, const fr_t *x, const fr_t *y) |
Checks equality of two arrays of fr_t, element wise, and store in a byte array. More... | |
Checks equality of two arrays of fr_t, element wise, and store in a byte array.
Uses the CUDA device to perform a fast comparision between two arrays of fr_t. This function has no limitation on the number and size of blocks.
[out] | eq | Array of count bytes, such that eq[i]==1 if x[i] == y[i], zero otherwise. |
[in] | count | Number of elements to be compared |
[in] | x | First array |
[in] | y | Second array |
Definition at line 99 of file fr.cu.
__device__ __host__ void fr_fromUint64 | ( | fr_t & | z, |
const uint64_t * | x | ||
) |
__device__ __host__ void fr_one | ( | fr_t & | z | ) |
__device__ void fr_print | ( | const char * | s, |
const fr_t & | x | ||
) |
prints the canonical representation of x to STDOUT.
Prints the canonical hexadecimal representation of x to stdout, followed by linefeed; prints with leading zeros, and without the hex prefix.
[in] | s | Description string |
[in] | x |
Definition at line 41 of file fr.cu.
__device__ void fr_toUint64 | ( | const fr_t & | x, |
uint64_t * | z | ||
) |
Converts fr_t to uint64_t[4].
Converts uint64_t[4] to fr_t. The 256-bit value in x is reduced to the canonical residue before being stored into z. The original value of x is unchanged.
[out] | z | Pointer to destination array. |
[in] | x | fr_t to be converted. |
Definition at line 76 of file fr.cu.