31 extern __device__ __host__
void g1a_fromUint64(
g1a_t &a,
const uint64_t *x,
const uint64_t *y);
34 extern __device__ __host__
void g1a_print(
const char *s,
const g1a_t &a);
37 extern __device__
void g1p_toUint64(
const g1p_t &p, uint64_t *x, uint64_t *y, uint64_t *z);
38 extern __device__ __host__
void g1p_fromUint64(
g1p_t &p,
const uint64_t *x,
const uint64_t *y,
const uint64_t *z);
43 extern __device__ __host__
void g1p_print(
const char *s,
const g1p_t &p);
uint64_t fp_t[6]
Residue modulo p. Any 384-bit representative of each residue is allowed, and stored as a 6-element li...
uint64_t fr_t[4]
Subgroup element stored as a 256-bit array (a 4-element little-endian array of uint64_t)....
__device__ void g1p_fromG1a(g1p_t &p, const g1a_t &a)
Convert a point in affine coordinates to projective coordinates.
__device__ void g1p_ift(g1p_t *output, const g1p_t *input)
Inverse FFT of size 512 over G1 with projective coordinates. Input and output arrays may overlap....
__device__ __host__ void g1p_fromFp(g1p_t &p, fp_t &x, fp_t &y, fp_t &z)
__device__ void g1p_addsub(g1p_t &p, g1p_t &q)
Stores the sum and difference of p and q into p and q. Projective p and q, p,q ← p+q,...
__device__ __host__ void g1p_inf(g1p_t &p)
Set p to the point-at-infinity (0,1,0)
__device__ __host__ void g1a_fromUint64(g1a_t &a, const uint64_t *x, const uint64_t *y)
Converts arrays of uint64_t into a G1 point in affine coordinates. Each array must be uint64_t....
__device__ bool g1p_eq(const g1p_t &p, const g1p_t &q)
Compares two projective points returns true when equal. This function compares if both parameters rep...
__device__ void g1p_scale(g1p_t &p, const fp_t &s)
Scale the coordinates of a projective point. This operation multiplies each coordinate of p by s: (x,...
__global__ void g1p_fft_wrapper(g1p_t *output, const g1p_t *input)
wrapper for g1p_fft: FFT for arrays of g1p_t with length 512
__device__ void g1p_sub(g1p_t &p, const g1p_t &q)
Point subtraction using projective coordinates. p ← p-q.
__device__ void g1p_toUint64(const g1p_t &p, uint64_t *x, uint64_t *y, uint64_t *z)
Converts G1 point into arrays of uint64_t. Each array must be uint64_t[6] This function does not vali...
__device__ __host__ void g1a_fromFp(g1a_t &a, const fp_t &x, const fp_t &y)
Converts Fp values into a point in G1 in affine coordinates. This function does not validate if the c...
__device__ __host__ void g1a_inf(g1a_t &a)
Set a to the point-at-infinity (0,0)
__device__ bool g1p_neq(const g1p_t &p, const g1p_t &q)
Compares two projective points, returns true when not equal. This function compares if both parameter...
__device__ void g1p_add(g1p_t &p, const g1p_t &q)
Computes the sum of two points q into p, using projective coordinates. and stores in p.
__device__ __host__ void g1a_print(const char *s, const g1a_t &a)
Print a standard representation of a, preceded by the user-set string s.
__device__ void g1p_fft(g1p_t *output, const g1p_t *input)
FFT of size 512 over G1 with projective coordinates. Input and output arrays may overlap....
__device__ void g1p_dbl(g1p_t &p)
G1 point doubling, with write back: p=2*p.
__global__ void g1a_fromG1p_wrapper(g1a_t *a, size_t len, const g1p_t *p)
Kernel wrappers, host-callable conversion of points in projective coordinates into affine coordinates...
__device__ void g1a_fromG1p(g1a_t &a, const g1p_t &p)
Converts a point in projective coordinates into affine coordinates.
__device__ __host__ void g1p_gen(g1p_t &p)
Sets p to the generator point G1 of bls12_381.
__device__ void g1p_mul(g1p_t &p, const fr_t &x)
p ← k·p Point multiplication by scalar, in projective coordinates. That result is stored back into p.
__device__ void g1p_neg(g1p_t &p)
Computes the negative of the point p. Due to negation map automorphism on Elliptic Curves in Weierstr...
__device__ __host__ void g1p_cpy(g1p_t &p, const g1p_t &q)
Copy from q into p.
__global__ void g1p_ift_wrapper(g1p_t *output, const g1p_t *input)
wrapper for g1p_ift: inverse FFT for arrays of g1p_t with length 512
__device__ bool g1p_isPoint(const g1p_t &p)
Check if the value stored in p is a valid point on the G1 curve.
__device__ __host__ void g1p_print(const char *s, const g1p_t &p)
Print a standard representation of p, preceded by the user-set string s.
__global__ void g1p_eq_wrapper(uint8_t *output, size_t len, const g1p_t *p, const g1p_t *q)
Kernel wrapper, host-callable comparison of arrays of g1p_t.
__device__ __host__ void g1p_fromUint64(g1p_t &p, const uint64_t *x, const uint64_t *y, const uint64_t *z)
__device__ bool g1p_isInf(const g1p_t &p)
Check if the value stored in p is the the/any point at infinity. This implementation uses (0,...
__device__ __host__ void g1a_gen(g1a_t &a)
Sets a to the generator point G1 of bls12_381.
__device__ __host__ void g1a_cpy(g1a_t &a, const g1a_t &b)
Copy from b into a.
G1 point in affine coordinates.
G1 point in projective coordinates.