CiFEr
vec_curve.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 XLAB d.o.o.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef CIFER_VECTOR_CURVE_H
18 #define CIFER_VECTOR_CURVE_H
19 
20 #include <amcl/ecp_BN254.h>
21 #include <amcl/ecp2_BN254.h>
22 #include <amcl/fp12_BN254.h>
23 #include "cifer/data/vec.h"
24 
34 typedef struct cfe_vec_G1 {
35  ECP_BN254 *vec;
36  size_t size;
37 } cfe_vec_G1;
38 
42 typedef struct cfe_vec_G2 {
43  ECP2_BN254 *vec;
44  size_t size;
45 } cfe_vec_G2;
46 
50 typedef struct cfe_vec_GT {
51  FP12_BN254 *vec;
52  size_t size;
53 } cfe_vec_GT;
54 
58 typedef struct cfe_vec_octet {
59  octet *vec;
60  size_t size;
62 
69 void cfe_vec_G1_init(cfe_vec_G1 *v, size_t size);
70 
76 void cfe_vec_G1_inf(cfe_vec_G1 *v);
77 
86 void cfe_vec_mul_G1(cfe_vec_G1 *v, cfe_vec *u);
87 
99 
106 void cfe_vec_G2_init(cfe_vec_G2 *v, size_t size);
107 
113 void cfe_vec_G2_inf(cfe_vec_G2 *v);
114 
123 void cfe_vec_mul_G2(cfe_vec_G2 *v, cfe_vec *u);
124 
136 
143 void cfe_vec_GT_init(cfe_vec_GT *v, size_t size);
144 
150 void cfe_vec_GT_inf(cfe_vec_GT *v);
151 
160 void cfe_vec_mul_GT(cfe_vec_GT *v, cfe_vec *u);
161 
169 void cfe_vec_G1_free(cfe_vec_G1 *v);
170 
178 void cfe_vec_G2_free(cfe_vec_G2 *v);
179 
187 void cfe_vec_GT_free(cfe_vec_GT *v);
188 
195 void cfe_vec_octet_init(cfe_vec_octet *v, size_t size);
196 
205 
206 #endif
cfe_vec_G1
Definition: vec_curve.h:34
cfe_vec_octet
Definition: vec_curve.h:58
cfe_vec_GT_inf
void cfe_vec_GT_inf(cfe_vec_GT *v)
cfe_vec
Definition: vec.h:41
cfe_vec_mul_G1
void cfe_vec_mul_G1(cfe_vec_G1 *v, cfe_vec *u)
cfe_vec_octet::size
size_t size
Definition: vec_curve.h:60
cfe_vec_G2_init
void cfe_vec_G2_init(cfe_vec_G2 *v, size_t size)
cfe_vec_G1
struct cfe_vec_G1 cfe_vec_G1
cfe_vec_G2
struct cfe_vec_G2 cfe_vec_G2
cfe_vec_octet_init
void cfe_vec_octet_init(cfe_vec_octet *v, size_t size)
cfe_vec_GT
struct cfe_vec_GT cfe_vec_GT
cfe_vec_mul_G2
void cfe_vec_mul_G2(cfe_vec_G2 *v, cfe_vec *u)
cfe_vec_GT
Definition: vec_curve.h:50
cfe_vec_GT_free
void cfe_vec_GT_free(cfe_vec_GT *v)
cfe_vec_G2_free
void cfe_vec_G2_free(cfe_vec_G2 *v)
cfe_vec_octet
struct cfe_vec_octet cfe_vec_octet
cfe_vec_G2_inf
void cfe_vec_G2_inf(cfe_vec_G2 *v)
cfe_vec_G1_inf
void cfe_vec_G1_inf(cfe_vec_G1 *v)
cfe_vec_mul_vec_G2
void cfe_vec_mul_vec_G2(cfe_vec_G2 *res, cfe_vec *u, cfe_vec_G2 *v)
cfe_vec_G1::size
size_t size
Definition: vec_curve.h:36
cfe_vec_G1_free
void cfe_vec_G1_free(cfe_vec_G1 *v)
cfe_vec_octet_free
void cfe_vec_octet_free(cfe_vec_octet *v)
vec.h
Vector struct and operations.
cfe_vec_GT_init
void cfe_vec_GT_init(cfe_vec_GT *v, size_t size)
cfe_vec_G2
Definition: vec_curve.h:42
cfe_vec_mul_GT
void cfe_vec_mul_GT(cfe_vec_GT *v, cfe_vec *u)
cfe_vec_G2::size
size_t size
Definition: vec_curve.h:44
cfe_vec_GT::size
size_t size
Definition: vec_curve.h:52
cfe_vec_G1_init
void cfe_vec_G1_init(cfe_vec_G1 *v, size_t size)
cfe_vec_mul_vec_G1
void cfe_vec_mul_vec_G1(cfe_vec_G1 *res, cfe_vec *u, cfe_vec_G1 *v)