FK20 CUDA
g1p.cu File Reference
#include <stdio.h>
#include "fp.cuh"
#include "g1.cuh"
Include dependency graph for g1p.cu:

Go to the source code of this file.

Functions

__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 validate if the coordinates are a valid point in the curve. More...
 
__device__ __host__ void g1p_fromUint64 (g1p_t &p, uint64_t *x, uint64_t *y, uint64_t *z)
 Converts arrays of uint64_t into a G1 point. Each array must be uint64_t[6] This function does not validate if the coordinates are a valid point in the curve. More...
 
__device__ void g1p_fromG1a (g1p_t &p, const g1a_t &a)
 Convert a point in affine coordinates to projective coordinates. More...
 
__device__ __host__ void g1p_cpy (g1p_t &p, const g1p_t &q)
 Copy from q into p. More...
 
__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. More...
 
__device__ __host__ void g1p_inf (g1p_t &p)
 Set p to the point-at-infinity (0,1,0) More...
 
__device__ __host__ void g1p_gen (g1p_t &p)
 Sets p to the generator point G1 of bls12_381. More...
 
__global__ void g1p_eq_wrapper (uint8_t *eq, size_t count, const g1p_t *p, const g1p_t *q)
 Kernel wrapper, host-callable comparison of arrays of g1p_t. More...
 
__global__ void g1a_fromG1p_wrapper (g1a_t *a, size_t count, const g1p_t *p)
 Kernel wrappers, host-callable conversion of points in projective coordinates into affine coordinates. More...
 

Function Documentation

◆ g1a_fromG1p_wrapper()

__global__ void g1a_fromG1p_wrapper ( g1a_t a,
size_t  count,
const g1p_t p 
)

Kernel wrappers, host-callable conversion of points in projective coordinates into affine coordinates.

Parameters
[out]aArray g1a_t[count]
[in]countnumber of elements in the array
[in]pArray g1p_t[count]
Returns
void

Definition at line 166 of file g1p.cu.

◆ g1p_cpy()

__device__ __host__ void g1p_cpy ( g1p_t p,
const g1p_t q 
)

Copy from q into p.

Parameters
[out]p
[in]q
Returns
void

Definition at line 67 of file g1p.cu.

Here is the caller graph for this function:

◆ g1p_eq_wrapper()

__global__ void g1p_eq_wrapper ( uint8_t *  eq,
size_t  count,
const g1p_t p,
const g1p_t q 
)

Kernel wrapper, host-callable comparison of arrays of g1p_t.

Parameters
[out]eqArray of size count, will store the result of the comparison. eq[i]==1 iff p[i]==q[i]
[in]countnumber of elements to be compared
[in]pArray g1p_t[count]
[in]qArray g1p_t[count]
Returns
void

Definition at line 140 of file g1p.cu.

◆ g1p_fromG1a()

__device__ void g1p_fromG1a ( g1p_t p,
const g1a_t a 
)

Convert a point in affine coordinates to projective coordinates.

Parameters
[out]ppoint in projective coordinates
[in]apoint in affine coordinates
Returns
void

Definition at line 51 of file g1p.cu.

◆ g1p_fromUint64()

__device__ __host__ void g1p_fromUint64 ( g1p_t p,
uint64_t *  x,
uint64_t *  y,
uint64_t *  z 
)

Converts arrays of uint64_t into a G1 point. Each array must be uint64_t[6] This function does not validate if the coordinates are a valid point in the curve.

Parameters
[out]ppoint in G1
[in]xArray with the x coordinate
[in]yArray with the y coordinate
[in]zArray with the z coordinate
Returns
void

Definition at line 38 of file g1p.cu.

Here is the call graph for this function:

◆ g1p_gen()

__device__ __host__ void g1p_gen ( g1p_t p)

Sets p to the generator point G1 of bls12_381.

Parameters
p
Returns
void

Definition at line 106 of file g1p.cu.

Here is the caller graph for this function:

◆ g1p_inf()

__device__ __host__ void g1p_inf ( g1p_t p)

Set p to the point-at-infinity (0,1,0)

Parameters
[in]p
Returns
void

Definition at line 93 of file g1p.cu.

Here is the caller graph for this function:

◆ g1p_print()

__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.

Parameters
[out]sDescription string
[out]pPoint in g1
Returns
void

Definition at line 80 of file g1p.cu.

Here is the caller graph for this function:

◆ g1p_toUint64()

__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 validate if the coordinates are a valid point in the curve.

Parameters
[in]ppoint in G1
[out]xArray with the x coordinate
[out]yArray with the y coordinate
[out]zArray with the z coordinate
Returns
void

Definition at line 21 of file g1p.cu.

Here is the call graph for this function: