# # create "fake" circuit-specific trusted setup for testing purposes # # by fake here I mean that no actual ceremoney is done, we just generate # some random toxic waste # import sugar import std/tables import constantine/math/arithmetic except Fp, Fr import groth16/bn128 import groth16/math/domain import groth16/math/poly import groth16/zkey_types import groth16/files/r1cs import groth16/misc #------------------------------------------------------------------------------- type ToxicWaste* = object alpha*: Fr beta*: Fr gamma*: Fr delta*: Fr tau*: Fr proc randomToxicWaste*(): ToxicWaste = let a = randFr() let b = randFr() let c = randFr() let d = randFr() let t = randFr() # intToFr(106) return ToxicWaste( alpha: a , beta: b , gamma: c , delta: d , tau: t ) #------------------------------------------------------------------------------- func r1csToCoeffs*(r1cs: R1CS): seq[Coeff] = var coeffs : seq[Coeff] let n = r1cs.constraints.len let p = r1cs.cfg.nPubIn + r1cs.cfg.nPubOut for i in 0..