add rho's for proof keys and verification keys calculation, Vk.IC, add alphas input soundness when generating trusted setup

This commit is contained in:
arnaucube
2019-02-28 19:52:59 +01:00
parent a7454213a0
commit 6ac73415ab
7 changed files with 226 additions and 56 deletions

View File

@@ -131,6 +131,9 @@ func (circ *Circuit) GenerateR1CS() ([][]*big.Int, [][]*big.Int, [][]*big.Int) {
c = append(c, cConstraint)
}
circ.R1CS.A = a
circ.R1CS.B = b
circ.R1CS.C = c
return a, b, c
}
@@ -144,6 +147,11 @@ func grabVar(signals []string, w []*big.Int, vStr string) *big.Int {
}
}
type Inputs struct {
Private []*big.Int
Publics []*big.Int
}
// CalculateWitness calculates the Witness of a Circuit based on the given inputs
func (circ *Circuit) CalculateWitness(inputs []*big.Int) ([]*big.Int, error) {
if len(inputs) != len(circ.Inputs) {