CuEVM
Functions
ecc Namespace Reference

The secp256k1 field prime number (P) and order. More...

Functions

__host__ __device__ void cgbn_mul_mod (env_t env, bn_t &res, bn_t &a, bn_t &b, bn_t &mod)
 
__host__ __device__ void cgbn_add_mod (env_t env, bn_t &res, bn_t &a, bn_t &b, bn_t &mod)
 
__host__ __device__ void cgbn_sub_mod (env_t env, bn_t &res, bn_t &a, bn_t &b, bn_t &mod)
 
__host__ __device__ void cgbn_div_mod (env_t env, bn_t &res, bn_t &a, bn_t &b, bn_t &mod)
 helper div_mod for bn_t More...
 
__host__ __device__ bool is_on_cuve_simple (env_t env, bn_t &Px, bn_t &Py, bn_t &mod, uint32_t B)
 Check if a basic point P(x, y) is on the curve y^2 = x^3 + B. More...
 
__host__ __device__ int ec_add (ArithEnv &arith, Curve curve, bn_t &ResX, bn_t &ResY, bn_t &Px, bn_t &Py, bn_t &Qx, bn_t &Qy)
 
__host__ __device__ int ec_mul (ArithEnv &arith, Curve curve, bn_t &ResX, bn_t &ResY, bn_t &Gx, bn_t &Gy, bn_t &n)
 
__host__ __device__ void convert_point_to_address (ArithEnv &arith, bn_t &address, bn_t &X, bn_t &Y)
 
__host__ __device__ int ec_recover (ArithEnv &arith, CuEVM::EccConstants *ecc_constants_ptr, signature_t &sig, bn_t &signer)
 
__host__ __device__ int pairing_multiple (ArithEnv &arith, EccConstants *ecc_constants_ptr, uint8_t *points_data, size_t data_len)
 

Detailed Description

The secp256k1 field prime number (P) and order.

Function Documentation

◆ cgbn_add_mod()

__host__ __device__ void ecc::cgbn_add_mod ( env_t  env,
bn_t &  res,
bn_t &  a,
bn_t &  b,
bn_t &  mod 
)
Here is the caller graph for this function:

◆ cgbn_div_mod()

__host__ __device__ void ecc::cgbn_div_mod ( env_t  env,
bn_t &  res,
bn_t &  a,
bn_t &  b,
bn_t &  mod 
)

helper div_mod for bn_t

Parameters
env
res
a
b
mod
Here is the call graph for this function:

◆ cgbn_mul_mod()

__host__ __device__ void ecc::cgbn_mul_mod ( env_t  env,
bn_t &  res,
bn_t &  a,
bn_t &  b,
bn_t &  mod 
)
Here is the caller graph for this function:

◆ cgbn_sub_mod()

__host__ __device__ void ecc::cgbn_sub_mod ( env_t  env,
bn_t &  res,
bn_t &  a,
bn_t &  b,
bn_t &  mod 
)
Here is the caller graph for this function:

◆ convert_point_to_address()

__host__ __device__ void ecc::convert_point_to_address ( ArithEnv &  arith,
bn_t &  address,
bn_t &  X,
bn_t &  Y 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_add()

__host__ __device__ int ecc::ec_add ( ArithEnv &  arith,
Curve  curve,
bn_t &  ResX,
bn_t &  ResY,
bn_t &  Px,
bn_t &  Py,
bn_t &  Qx,
bn_t &  Qy 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_mul()

__host__ __device__ int ecc::ec_mul ( ArithEnv &  arith,
Curve  curve,
bn_t &  ResX,
bn_t &  ResY,
bn_t &  Gx,
bn_t &  Gy,
bn_t &  n 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_recover()

__host__ __device__ int ecc::ec_recover ( ArithEnv &  arith,
CuEVM::EccConstants *  ecc_constants_ptr,
signature_t &  sig,
bn_t &  signer 
)

Recover signer from the signature with the above structure. return the signer address in cgbn type

Parameters
arith
sig
signer
Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_on_cuve_simple()

__host__ __device__ bool ecc::is_on_cuve_simple ( env_t  env,
bn_t &  Px,
bn_t &  Py,
bn_t &  mod,
uint32_t  B 
)

Check if a basic point P(x, y) is on the curve y^2 = x^3 + B.

Parameters
env
Px
Py
mod
B
Returns
true if on curve
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pairing_multiple()

__host__ __device__ int ecc::pairing_multiple ( ArithEnv &  arith,
EccConstants *  ecc_constants_ptr,
uint8_t *  points_data,
size_t  data_len 
)
Here is the caller graph for this function: