Przeglądaj źródła

Match new sigma-rs API for ComposedWitness::Or

Ian Goldberg 3 miesięcy temu
rodzic
commit
9e77a03656
2 zmienionych plików z 6 dodań i 4 usunięć
  1. 5 4
      sigma_compiler_core/src/sigma/codegen.rs
  2. 1 0
      src/lib.rs

+ 5 - 4
sigma_compiler_core/src/sigma/codegen.rs

@@ -508,11 +508,11 @@ impl<'a> CodeGen<'a> {
                             #(#proto.map_err(|e| -> SigmaError { e })?,)*
                         ]))
                     },
-                    // TODO: Choose the correct branch for the witness
-                    // (currently hardcoded at 0)
                     quote! {
-                        Ok(ComposedWitness::Or(0, vec![
-                            #(#witness.map_err(|e| -> SigmaError { e })?,)*
+                        Ok(ComposedWitness::Or(vec![
+                            #(CtOption::new(
+                                #witness.map_err(|e| -> SigmaError { e })?,
+                                1u8.into()),)*
                         ]))
                     },
                 )
@@ -724,6 +724,7 @@ impl<'a> CodeGen<'a> {
                 };
                 use sigma_compiler::rand::{CryptoRng, RngCore};
                 use sigma_compiler::group::ff::PrimeField;
+                use sigma_compiler::subtle::CtOption;
                 use std::ops::Neg;
                 #dump_use
 

+ 1 - 0
src/lib.rs

@@ -2,5 +2,6 @@ pub use group;
 pub use rand;
 pub use sigma_compiler_derive::{sigma_compiler, sigma_compiler_prover, sigma_compiler_verifier};
 pub use sigma_rs;
+pub use subtle;
 
 pub mod rangeutils;