Circuit
Last updated
Last updated
Class Circuit
represent a circuit in a CircomJS project.
Below is a description of properties
and methods
associated with instances of Circuit
class:
compile()
: compiles your circuits and produces the following artifacts:
r1cs
sym
witness generation program
zkey
vkey
calculateWitness(inp)
: calculates witness for a certain input passed as a javascript object and returns it.
checkConstraints(witness)
: takes witnesses generated from calculateWitness
and returns the result of checking the constraints of the provided witness.
getTotatlConstraints()
: returns the total constraints of the circuit.
genProof(inp)
: generates proof for the given input and returns it as a javascript object, check out the following for more info.
verifyProof(proof)
: verifies proof generated from genProof
, returns a boolean indicating the status of verification.
getOutputDIR()
: returns the output directory { the directory where its builds will be stored }.