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 @@ -773,6 +773,21 @@ impl<P: MlDsaParams> VerifyingKey<P> {
773773 }
774774 }
775775
776+ /// Computes µ according to FIPS 204 for use in ML-DSA.Sign and ML-DSA.Verify.
777+ ///
778+ /// # Errors
779+ ///
780+ /// Returns [`Error`] if the given `Mp` returns one.
781+ pub fn compute_mu < F : FnOnce ( & mut Shake256 ) -> Result < ( ) , Error > > (
782+ & self ,
783+ Mp : F ,
784+ ctx : & [ u8 ] ,
785+ ) -> Result < B64 , Error > {
786+ let mut mu = MuBuilder :: new ( & self . tr , ctx) ;
787+ Mp ( mu. as_mut ( ) ) ?;
788+ Ok ( mu. finish ( ) )
789+ }
790+
776791 /// This algorithm reflects the ML-DSA.Verify_internal algorithm from FIPS 204. It does not
777792 /// include the domain separator that distinguishes between the normal and pre-hashed cases,
778793 /// 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