Documentation ¶
Index ¶
- func CkFold(result *Ck, x mcl.Fr, xInv mcl.Fr, ck *Ck)
- func IPPSave(ck *Ck, folderPath string)
- func IPPSaveCmKzg(ck *Ck, kzg1 *kzg.KZG1Settings, kzg2 *kzg.KZG2Settings, folderPath string)
- type Ck
- func IPPCMLoad(M uint64, folderPath string) Ck
- func IPPCMLoadCmKzg(M uint64, folderPath string) (Ck, kzg.KZG1Settings, kzg.KZG2Settings)
- func IPPSetup(m uint64, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) *Ck
- func IPPSetupKZG(mn uint64, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (*Ck, *kzg.KZG1Settings, *kzg.KZG2Settings)
- func LoadKeys(M uint64, folderPath string) (Ck, kzg.KZG1Settings, kzg.KZG2Settings)
- type Com
- type KZGPk
- type KZGVk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CkFold ¶
CkFold computes the new Ck for the next level of recursion. Given ck.V_L, ck.V_R, ck.W_L, ck.W_R computes ck' = (V', W') as follows: V' = xInv * V_R + V_L W' = x * W_R + W_L Parameters ---------- result: Pointer to Ck type. x : Fr, the exponent xInv : Fr, the exponent. x and xInv should be inverse of each other. ck: pointer to Ck object.
Returns ------- None. Call by reference, thus output is stored in variable result
func IPPSave ¶
Saves the commitment keys to a folder. Input: ck, folderPath Files are saved in folderPath/CK.data
func IPPSaveCmKzg ¶
func IPPSaveCmKzg(ck *Ck, kzg1 *kzg.KZG1Settings, kzg2 *kzg.KZG2Settings, folderPath string)
Saves the commitment keys to a folder. Input: ck, kzg1, kzg2, folderPath Files are saved in folderPath/CK.data
Types ¶
type Ck ¶
type Ck struct { M uint64 V []mcl.G2 // Ck_1 W []mcl.G1 // Ck_2 }
Ck is a struct to hold LMR19 commitment keys. Note: Since ck_3 is 1_{\F_p}, it is ignored
func IPPCMLoad ¶
Loads the commitment keys from a folder. Input: M, folderPath Files are saved in folderPath/CK.data M needs to be a power of 2
func IPPCMLoadCmKzg ¶
func IPPCMLoadCmKzg(M uint64, folderPath string) (Ck, kzg.KZG1Settings, kzg.KZG2Settings)
Loads the commitment keys and KZG keys from a folder. Input: M, folderPath Files are saved in folderPath/CK.data M needs to be a power of 2
func IPPSetup ¶
Computes the commitment keys V and W Squares the alpha and beta while generating the commitment keys
func IPPSetupKZG ¶
func IPPSetupKZG(mn uint64, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (*Ck, *kzg.KZG1Settings, *kzg.KZG2Settings)
Computes the keys of size 2mn - 1 Computes the commitment keys V and W ck *Ck, kzg1 *kzg.KZG1Settings, kzg2 *kzg.KZG2Settings,
func LoadKeys ¶
func LoadKeys(M uint64, folderPath string) (Ck, kzg.KZG1Settings, kzg.KZG2Settings)
func (*Ck) New ¶
New is a constructor for the Ck struct. Assigns default values to the data members Parameters ---------- m: Size of the commitment keys
Size of the commitment key should be same as the size of the message This code works only when the size if a power of 2
Returns ------- None
func (*Ck) Transform ¶
Transform is a member of Ck. Given a ck of size m, it returns two m/2 sized ck which are cross-connected (illustrated below). Example: Given ck.V, ck.W Ck1 = (ck.V[:m/2], ck.W[m/2:]) Ck2 = (ck.V[m/2:], ck.W[:m/2]) TODO: Take in Ck1 and Ck1 as references in the function call to reduce overheads Parameters ---------- None
Returns ------- - Ck1 m/2 sized commitment key - Ck2 m/2 sized commitment key
type Com ¶
type Com struct {
Com [3]mcl.GT
}
Com is a struct to hold AFGHO16 commitments. This hold the commitment decribed in Page 14 of https://eprint.iacr.org/2019/1177/20200212:182642 com[0] holds the inner product of vector A and ck_1 aka \textbf{v} com[1] holds the inner product of vector B and ck_2 aka \textbf{w} com[2] holds the inner product of vector A and B
func ComFold ¶
ComFold computes the new commitment for the next level of recursion. Given com, ComL, ComR computes com' = ComL^x * com * ComR^(x^-1)
Parameters ---------- result: Pointer to Com type. x : Fr, the exponent xInv : Fr, the exponent. x and xInv should be inverse of each other. ComL: Pointer to Com type. com: Pointer to Com type. ComR: Pointer to Com type.
Returns ------- None. Call by reference, thus output is stored in variable result