MCPcopy Create free account
hub / github.com/PolyhedraZK/ExpanderCompilerCollection / Prove

Method Prove

ecgo/integration/expander_exec.go:47–69  ·  view source on GitHub ↗
(witnessData []byte)

Source from the content-addressed store, hash-verified

45}
46
47func (p *Prover) Prove(witnessData []byte) ([]byte, error) {
48 if is_url(p.filename) {
49 proveReq, err := http.NewRequest("POST", p.filename+"/prove", bytes.NewBuffer(witnessData))
50 if err != nil {
51 return nil, err
52 }
53 proveReq.Header.Set("Content-Type", "application/octet-stream")
54 proveReq.Header.Set("Content-Length", fmt.Sprintf("%d", len(witnessData)))
55 client := &http.Client{}
56 proveResp, err := client.Do(proveReq)
57 if err != nil {
58 return nil, err
59 }
60 defer proveResp.Body.Close()
61
62 proof_and_claim, err := io.ReadAll(proveResp.Body)
63 if err != nil {
64 return nil, err
65 }
66 return proof_and_claim, nil
67 }
68 return rust.ProveFile(p.circuitDir, witnessData), nil
69}
70
71func (p *Prover) Verify(witnessData []byte, proof_and_claim []byte) (bool, error) {
72 if is_url(p.filename) {

Callers 1

mainFunction · 0.95

Calls 3

ProveFileFunction · 0.92
is_urlFunction · 0.85
SetMethod · 0.80

Tested by

no test coverage detected