File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1919//! # use curve25519_dalek::ristretto::RistrettoPoint;
2020//! # use curve25519_dalek::scalar::Scalar;
2121//! # use group::Group;
22- //!
2322//! let mut instance = sigma_rs::LinearRelation::new();
2423//! let mut rng = rand::thread_rng();
25- //! let witness = vec![Scalar::random(&mut rng), Scalar::random(&mut rng)];
2624//!
25+ //! // Define the proof statement.
2726//! let [var_x, var_r] = instance.allocate_scalars();
2827//! let [var_G, var_H] = instance.allocate_elements();
2928//! instance.allocate_eq(var_G * var_x + var_H * var_r);
3029//! instance.set_elements([(var_G, RistrettoPoint::generator()), (var_H, RistrettoPoint::random(&mut rng))]);
30+ //!
31+ //! // Assign the image of the linear map.
32+ //! let witness = vec![Scalar::random(&mut rng), Scalar::random(&mut rng)];
3133//! instance.compute_image(&witness);
32- //! let narg_string: Vec<u8> = instance.into_nizk(b"your session identifier").unwrap().prove_batchable(&witness, &mut rng).unwrap();
34+ //!
35+ //! // Create a non-interactive argument for the instance.
36+ //! let nizk = instance.into_nizk(b"your session identifier").unwrap();
37+ //! let narg_string: Vec<u8> = nizk.prove_batchable(&witness, &mut rng).unwrap();
38+ //! // Print the narg string.
3339//! println!("{}", hex::encode(narg_string));
3440//! ```
3541//!
You can’t perform that action at this time.
0 commit comments