File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -772,6 +772,21 @@ impl<P: MlDsaParams> VerifyingKey<P> {
772
772
}
773
773
}
774
774
775
+ /// Computes µ according to FIPS 204 for use in ML-DSA.Sign and ML-DSA.Verify.
776
+ ///
777
+ /// # Errors
778
+ ///
779
+ /// Returns [`Error`] if the given `Mp` returns one.
780
+ pub fn compute_mu < F : FnOnce ( & mut Shake256 ) -> Result < ( ) , Error > > (
781
+ & self ,
782
+ Mp : F ,
783
+ ctx : & [ u8 ] ,
784
+ ) -> Result < B64 , Error > {
785
+ let mut mu = MuBuilder :: new ( & self . tr , ctx) ;
786
+ Mp ( mu. as_mut ( ) ) ?;
787
+ Ok ( mu. finish ( ) )
788
+ }
789
+
775
790
/// This algorithm reflects the ML-DSA.Verify_internal algorithm from FIPS 204. It does not
776
791
/// include the domain separator that distinguishes between the normal and pre-hashed cases,
777
792
/// and it does not separate the context string from the rest of the message.
You can’t perform that action at this time.
0 commit comments