Class MlDsaUtils


  • public final class MlDsaUtils
    extends java.lang.Object
    Public utility methods
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] computeMu​(java.security.PublicKey publicKey, byte[] message)
      Computes mu as defined on line 6 of Algorithm 7 and line 7 of Algorithm 8 in NIST FIPS 204.
      static byte[] expandPrivateKey​(java.security.PrivateKey key)
      Returns an expanded ML-DSA private key, whether the key passed in is based on a seed or expanded.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • computeMu

        public static byte[] computeMu​(java.security.PublicKey publicKey,
                                       byte[] message)
        Computes mu as defined on line 6 of Algorithm 7 and line 7 of Algorithm 8 in NIST FIPS 204.

        See FIPS 204

        Parameters:
        publicKey - ML-DSA public key
        message - byte array of the message over which to compute mu
        Returns:
        a byte[] of length 64 containing mu
      • expandPrivateKey

        public static byte[] expandPrivateKey​(java.security.PrivateKey key)
        Returns an expanded ML-DSA private key, whether the key passed in is based on a seed or expanded. It returns the PKCS8-encoded expanded key.
        Parameters:
        key - an ML-DSA private key
        Returns:
        a byte[] containing the PKCS8-encoded seed private key