-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcommitment.cuh
33 lines (23 loc) · 1.12 KB
/
commitment.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef COMMITMENT_CUH
#define COMMITMENT_CUH
#include "fr-tensor.cuh"
#include "g1-tensor.cuh"
#include "proof.cuh"
class Commitment: public G1TensorJacobian
{
public:
using G1TensorJacobian::G1TensorJacobian;
using G1TensorJacobian::operator+;
using G1TensorJacobian::operator-;
using G1TensorJacobian::operator*;
using G1TensorJacobian::operator*=;
G1TensorJacobian commit(const FrTensor& t) const;
Fr_t open(const FrTensor& t, const G1TensorJacobian& c, const vector<Fr_t>& u) const;
static Fr_t me_open(const FrTensor& t, const Commitment& generators, vector<Fr_t>::const_iterator begin, vector<Fr_t>::const_iterator end, vector<G1Jacobian_t>& proof);
};
KERNEL void sum_axis_n_optimized(GLOBAL G1Jacobian_t* arr, GLOBAL G1Jacobian_t* arr_out, uint n, uint m);
KERNEL void me_open_step(GLOBAL Fr_t* scalars, GLOBAL G1Jacobian_t* generators, Fr_t u, // always assume that scalars and u is in mont form
GLOBAL Fr_t* new_scalars, GLOBAL G1Jacobian_t* new_generators,
GLOBAL G1Jacobian_t* temp_out, GLOBAL G1Jacobian_t* temp_out0, GLOBAL G1Jacobian_t* temp_out1,
uint new_size);
#endif