From e241b1a85adc799422a8d87187020d79de1395a3 Mon Sep 17 00:00:00 2001 From: Gabriel Barreto Date: Wed, 23 Aug 2023 10:46:38 -0300 Subject: [PATCH] fixed `secret` --- src/lem/eval.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/lem/eval.rs b/src/lem/eval.rs index b89f7f2f62..828e178bce 100644 --- a/src/lem/eval.rs +++ b/src/lem/eval.rs @@ -696,8 +696,18 @@ fn apply_cont() -> Func { return(result, env, err, errctrl) } Symbol("secret") => { - let (secret, _payload) = open(result); - return(secret, env, continuation, makethunk) + match result.tag { + Expr::Num => { + let result = cast(result, Expr::Comm); + let (secret, _payload) = open(result); + return(secret, env, continuation, makethunk) + } + Expr::Comm => { + let (secret, _payload) = open(result); + return(secret, env, continuation, makethunk) + } + }; + return(result, env, err, errctrl) } Symbol("commit") => { let comm = hide(zero, result); @@ -1067,8 +1077,8 @@ mod tests { use blstrs::Scalar as Fr; const NUM_INPUTS: usize = 1; - const NUM_AUX: usize = 10777; - const NUM_CONSTRAINTS: usize = 13235; + const NUM_AUX: usize = 10785; + const NUM_CONSTRAINTS: usize = 13264; const NUM_SLOTS: SlotsCounter = SlotsCounter { hash2: 16, hash3: 4,