CiFEr
|
Matrices of elements of an elliptic curve struct and operations on it. More...
Go to the source code of this file.
Data Structures | |
struct | cfe_mat_G1 |
struct | cfe_mat_G2 |
struct | cfe_mat_GT |
Typedefs | |
typedef struct cfe_mat_G1 | cfe_mat_G1 |
typedef struct cfe_mat_G2 | cfe_mat_G2 |
typedef struct cfe_mat_GT | cfe_mat_GT |
Matrices of elements of an elliptic curve struct and operations on it.
typedef struct cfe_mat_G1 cfe_mat_G1 |
Matrix of ECP_BN254 elements.
typedef struct cfe_mat_G2 cfe_mat_G2 |
Matrix of ECP2_BN254 elements.
typedef struct cfe_mat_GT cfe_mat_GT |
Matrix of FP12_BN254 elements.
void cfe_mat_G1_init | ( | cfe_mat_G1 * | m, |
size_t | rows, | ||
size_t | cols | ||
) |
Initializes a matrix of ECP_BN254 elements
m | A pointer to an uninitialized cfe_mat_G1 matrix |
rows | The number of rows |
cols | The number of columns |
void cfe_mat_G1_transpose | ( | cfe_mat_G1 * | res, |
cfe_mat_G1 * | m | ||
) |
Transposes the given cfe_mat_G1 matrix
res | A pointer to an initialized cfe_mat_G1 matrix |
m | A pointer to a cfe_mat_G1 matrix |
void cfe_mat_mul_G1 | ( | cfe_mat_G1 * | m, |
cfe_mat * | u | ||
) |
Creates a matrix whose i-th element equals u[i] * g, where g is the generator of ECP_BN254. The sizes of m and u must match.
m | A pointer to an initialized cfe_mat_G1 matrix |
u | A pointer to matrix of integers |
void cfe_mat_mul_G1_mat | ( | cfe_mat_G1 * | res, |
cfe_mat * | mi, | ||
cfe_mat_G1 * | m | ||
) |
Multiplication of a matrix of integers by a matrix of elements of G1
res | A pointer to an initialized cfe_mat_G1 matrix |
mi | A pointer to matrix of integers |
m | A pointer to an initialized cfe_mat_G1 matrix |
void cfe_mat_G1_mul_vec | ( | cfe_vec_G1 * | res, |
cfe_mat_G1 * | m, | ||
cfe_vec * | mi | ||
) |
Multiplication of a matrix of elements of G1 by a vector of integers.
res | A pointer to an initialized cfe_vec_G1 vector |
m | A pointer to a cfe_mat_G1 matrix |
mi | A pointer to matrix of integers |
void cfe_mat_G1_free | ( | cfe_mat_G1 * | m | ) |
Frees the memory occupied by the struct members. It does not free memory occupied by the struct itself.
m | A pointer to a matrix (initialized cfe_mat_G1 struct) |
void cfe_mat_G2_init | ( | cfe_mat_G2 * | m, |
size_t | rows, | ||
size_t | cols | ||
) |
Initializes a matrix of ECP2_BN254 elements
m | A pointer to an uninitialized cfe_mat_G2 matrix |
rows | The number of rows |
cols | The number of columns |
void cfe_mat_G2_transpose | ( | cfe_mat_G2 * | res, |
cfe_mat_G2 * | m | ||
) |
Transposes the given cfe_mat_G2 matrix.
res | A pointer to an initialized cfe_mat_G2 matrix |
m | A pointer to a cfe_mat_G2 matrix |
void cfe_mat_mul_G2 | ( | cfe_mat_G2 * | m, |
cfe_mat * | u | ||
) |
Creates a matrix whose i-th element equals u[i] * g, where g is the generator of ECP2_BN254. The sizes of m and u must match.
m | A pointer to an initialized cfe_mat_G2 matrix |
u | A pointer to matrix of integers. |
void cfe_mat_mul_G2_mat | ( | cfe_mat_G2 * | res, |
cfe_mat * | mi, | ||
cfe_mat_G2 * | m | ||
) |
Multiplication of a matrix of integers by a matrix of elements of G2
res | A pointer to an initialized cfe_mat_G2 matrix |
mi | A pointer to matrix of integers |
m | A pointer to an initialized cfe_mat_G2 matrix |
void cfe_mat_G2_mul_vec | ( | cfe_vec_G2 * | res, |
cfe_mat_G2 * | m, | ||
cfe_vec * | u | ||
) |
Multiplication of a matrix of elements of G2 by a vector of integers.
res | A pointer to an initialized cfe_vec_G2 vector |
m | A pointer to a cfe_mat_G2 matrix |
u | A pointer to matrix of integers. |
void cfe_mat_G2_free | ( | cfe_mat_G2 * | m | ) |
Frees the memory occupied by the struct members. It does not free memory occupied by the struct itself.
m | A pointer to a matrix (initialized cfe_mat_G2 struct) |
void cfe_mat_GT_init | ( | cfe_mat_GT * | m, |
size_t | rows, | ||
size_t | cols | ||
) |
Initializes a matrix of FP12_BN254 elements
m | A pointer to an uninitialized cfe_mat_GT matrix |
rows | The number of rows |
cols | The number of columns |
void cfe_mat_GT_transpose | ( | cfe_mat_GT * | res, |
cfe_mat_GT * | m | ||
) |
Transposes the given cfe_mat_GT matrix.
res | A pointer to an initialized cfe_mat_GT matrix |
m | A pointer to a cfe_mat_GT matrix |
void cfe_mat_mul_GT_mat | ( | cfe_mat_GT * | res, |
cfe_mat * | mi, | ||
cfe_mat_GT * | m | ||
) |
Multiplication of a matrix of integers by a matrix of elements of GT
res | A pointer to an initialized cfe_mat_GT matrix |
mi | A pointer to matrix of integers |
m | A pointer to an initialized cfe_mat_GT matrix |
void cfe_mat_GT_mul_vec | ( | cfe_vec_GT * | res, |
cfe_mat_GT * | m, | ||
cfe_vec * | u | ||
) |
Multiplication of a matrix of elements of GT by a vector of integers.
res | A pointer to an initialized cfe_vec_GT vector |
m | A pointer to a cfe_mat_GT matrix |
u | A pointer to matrix of integers. |
void cfe_mat_GT_pair_mat_G1 | ( | cfe_mat_GT * | res, |
cfe_mat_G1 * | m | ||
) |
Pairs a given cfe_mat_G1 matrix with the generator of G2
res | A pointer to an initialized cfe_vec_GT matrix |
m | A pointer to a cfe_mat_G1 matrix |
void cfe_mat_GT_pair_mat_G2 | ( | cfe_mat_GT * | res, |
cfe_mat_G2 * | m | ||
) |
Pairs a given cfe_mat_G2 matrix with the generator of G1
res | A pointer to an initialized cfe_vec_GT matrix |
m | A pointer to a cfe_mat_G2 matrix |
void cfe_mat_GT_free | ( | cfe_mat_GT * | m | ) |
Frees the memory occupied by the struct members. It does not free memory occupied by the struct itself.
m | A pointer to a matrix (initialized cfe_mat_GT struct) |