File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,9 @@ use sha3::Digest;
2424use sha3:: Sha3_256 ;
2525
2626use crate :: {
27+ codec:: Shake128DuplexSponge ,
2728 errors:: Error ,
29+ fiat_shamir:: Nizk ,
2830 linear_relation:: LinearRelation ,
2931 schnorr_protocol:: SchnorrProof ,
3032 serialization:: { deserialize_scalars, serialize_scalars} ,
@@ -523,3 +525,23 @@ impl<G: PrimeGroup> SigmaProtocolSimulator for Protocol<G> {
523525 }
524526 }
525527}
528+
529+ impl < G : PrimeGroup > Protocol < G > {
530+ /// Convert this Protocol into a non-interactive zero-knowledge proof
531+ /// using the Shake128DuplexSponge codec and a specified session identifier.
532+ ///
533+ /// This method provides a convenient way to create a NIZK from a Protocol
534+ /// without exposing the specific codec type to the API caller.
535+ ///
536+ /// # Parameters
537+ /// - `session_identifier`: Domain separator bytes for the Fiat-Shamir transform
538+ ///
539+ /// # Returns
540+ /// A `Nizk` instance ready for proving and verification
541+ pub fn into_nizk (
542+ self ,
543+ session_identifier : & [ u8 ] ,
544+ ) -> Nizk < Protocol < G > , Shake128DuplexSponge < G > > {
545+ Nizk :: new ( session_identifier, self )
546+ }
547+ }
You can’t perform that action at this time.
0 commit comments