From 2e26a77e90eb6b2e842912556c6611a203c80cc9 Mon Sep 17 00:00:00 2001 From: Jaremy Creechley Date: Thu, 16 May 2024 21:46:34 +0300 Subject: [PATCH] add asynccircom backend --- codex/slots/proofs/backends/asynccircoms.nim | 12 ++++++++++-- codex/slots/proofs/backends/circomcompat.nim | 6 ++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/codex/slots/proofs/backends/asynccircoms.nim b/codex/slots/proofs/backends/asynccircoms.nim index c451395d..3c09e7c8 100644 --- a/codex/slots/proofs/backends/asynccircoms.nim +++ b/codex/slots/proofs/backends/asynccircoms.nim @@ -12,8 +12,8 @@ import ../../types import ./circomcompat const - CompletitionTimeout = 1.seconds # Maximum await time for completition after receiving a signal - CompletitionRetryDelay = 10.millis + CompletionTimeout = 1.seconds # Maximum await time for completition after receiving a signal + CompletionRetryDelay = 10.millis type AsyncCircomCompat* = object @@ -40,3 +40,11 @@ proc verify*[H]( ## Verify a proof using a ctx ## discard + +proc init*( + _: type AsyncCircomCompat, + params: CircomCompatParams +): AsyncCircomCompat = + ## Create a new async circom + ## + AsyncCircomCompat(params) diff --git a/codex/slots/proofs/backends/circomcompat.nim b/codex/slots/proofs/backends/circomcompat.nim index 49b9a2b6..6cd925dd 100644 --- a/codex/slots/proofs/backends/circomcompat.nim +++ b/codex/slots/proofs/backends/circomcompat.nim @@ -54,7 +54,8 @@ proc release*(self: CircomCompat) = proc prove*[H]( self: CircomCompat, - input: ProofInputs[H]): ?!CircomProof = + input: ProofInputs[H] +): ?!CircomProof = ## Encode buffers using a ctx ## @@ -168,7 +169,8 @@ proc prove*[H]( proc verify*[H]( self: CircomCompat, proof: CircomProof, - inputs: ProofInputs[H]): ?!bool = + inputs: ProofInputs[H] +): ?!bool = ## Verify a proof using a ctx ##