Documentation ¶
Index ¶
- func ComputePadding(M, N uint32) (uint64, uint64)
- func FrPow(a mcl.Fr, n int64) mcl.Fr
- func G1Fold(x mcl.Fr, vec1 []mcl.G1, vec2 []mcl.G1) []mcl.G1
- func G1SliceIsEqual(a, b []mcl.G1) bool
- func G1VecRandExpo(A []mcl.G1, r mcl.Fr, m int) []mcl.G1
- func G2Fold(x mcl.Fr, vec1 []mcl.G2, vec2 []mcl.G2) []mcl.G2
- func G2SliceIsEqual(a, b []mcl.G2) bool
- func G2VecRandExpo(A []mcl.G2, r mcl.Fr, m int) []mcl.G2
- func GenerateBatchingData(m uint32, n uint32) ([]mcl.G1, []mcl.G2, []mcl.G1, []mcl.G2)
- func GenerateData(m uint64) ([]mcl.G1, []mcl.G2)
- func GetFrByteSize() int
- func GetG1ByteSize() int
- func GetG2ByteSize() int
- func GetGTByteSize() int
- func InnerProd(A []mcl.G1, B []mcl.G2) mcl.GT
- func InstanceSizeChecker(M uint64, msg string)
- func IsPow2(m uint64) bool
- func MinUint64(a uint64, b uint64) uint64
- func NextPowOf2(v uint64) uint64
- func RunMPC() (mcl.Fr, mcl.Fr, mcl.G1, mcl.G2)
- func SizeMismatchCheck(a, b uint64, msg string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputePadding ¶
func FrPow ¶
func FrPow(a mcl.Fr, n int64) mcl.Fr
Computes the a^x, where a is mcl.Fr and x is int64
func G1Fold ¶
func G1Fold(x mcl.Fr, vec1 []mcl.G1, vec2 []mcl.G1) []mcl.G1
G1Fold performs element wise: result = x * vec1 + vec2 Ex: result[0] = x * vec1[0] + vec2[0] vec1 and vec2 has to be same size Parameters ---------- result: G1 slice where the results are stored x : Fr, the exponent vec1: slice of mcl.G1 vec2: slice of mcl.G1 Returns -------
func G1SliceIsEqual ¶
func G1SliceIsEqual(a, b []mcl.G1) bool
func G1VecRandExpo ¶
func G1VecRandExpo(A []mcl.G1, r mcl.Fr, m int) []mcl.G1
// Add the randomness to the vector // a_0, a_1, a_2, a_3, a_4, a_5will become // a_0, a_1, a_2^r, a_3^r, a_4^{r^2}, a_5^{r^2}.
func G2Fold ¶
func G2Fold(x mcl.Fr, vec1 []mcl.G2, vec2 []mcl.G2) []mcl.G2
G2Fold performs element wise: result = x * vec1 + vec2 Ex: result[0] = x * vec1[0] + vec2[0] vec1 and vec2 has to be same size Parameters ---------- result: G2 slice where the results are stored x : Fr, the exponent vec1: slice of mcl.G2 vec2: slice of mcl.G2 Returns ------- None. Call by reference, thus output is stored in variable result
func G2SliceIsEqual ¶
func G2SliceIsEqual(a, b []mcl.G2) bool
func G2VecRandExpo ¶
func G2VecRandExpo(A []mcl.G2, r mcl.Fr, m int) []mcl.G2
// Add the randomness to the vector // a_0, a_1, a_2, a_3, a_4, a_5will become // a_0, a_1, a_2^r, a_3^r, a_4^{r^2}, a_5^{r^2}.
func GenerateBatchingData ¶
e(P_i, Q_i) = e(A_i, B_i)...e(A_m, B_m) This will keep Q_i's and B_i's the same This will allows us to test both batch.Verify and batch.VerifyEdrax
func GenerateData ¶
func GenerateData(m uint64) ([]mcl.G1, []mcl.G2)
func GetFrByteSize ¶
func GetFrByteSize() int
func GetG1ByteSize ¶
func GetG1ByteSize() int
func GetG2ByteSize ¶
func GetG2ByteSize() int
func GetGTByteSize ¶
func GetGTByteSize() int
func InnerProd ¶
func InnerProd(A []mcl.G1, B []mcl.G2) mcl.GT
InnerProd computes the inner product of vector A and vector B
func InstanceSizeChecker ¶
Check if anywhere we are dealing with instance size which not a power of 2. Works with Init() Of course, someone can directly change M or any exported parameters of any argument system.
func SizeMismatchCheck ¶
Types ¶
This section is empty.