Circuit
Circuit
Class Circuit
represent a circuit in a CircomJS project.
Instances of this class shouldn't be initiated directly by the user and users should rely upon getting them from CircomJS
's getCircuit
method.
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 fromcalculateWitness
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 link for more info.verifyProof(proof)
: verifies proof generated fromgenProof
, returns a boolean indicating the status of verification.getOutputDIR()
: returns the output directory { the directory where its builds will be stored }.
Last updated