Class Ed25519Signer


  • final class Ed25519Signer
    extends java.lang.Object
    Ed25519 signing (RFC 8032) on top of the vendored ref10 implementation, shared by the client_ed25519 and parsec authentication plugins so that neither depends on a JCA provider.

    The secret is expanded once with SHA-512 as in RFC 8032 section 5.1.5. parsec passes the 32-byte PBKDF2-derived seed, which yields standard signatures; client_ed25519 passes the raw password in place of the seed, which is the only difference of that scheme with RFC 8032.

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Ed25519Signer()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static byte[] expand​(byte[] secret)
      Expand a secret into the 64-byte private key material: SHA-512 of the secret, whose first 32 bytes are clamped into the scalar and whose last 32 bytes are the nonce prefix.
      (package private) static byte[] publicKey​(byte[] expandedKey)
      Public key A = a·B for the expanded key.
      private static java.security.MessageDigest sha512()  
      (package private) static byte[] sign​(byte[] expandedKey, byte[] publicKey, byte[] message)
      Sign a message.
      • Methods inherited from class java.lang.Object

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

      • Ed25519Signer

        private Ed25519Signer()
    • Method Detail

      • expand

        static byte[] expand​(byte[] secret)
        Expand a secret into the 64-byte private key material: SHA-512 of the secret, whose first 32 bytes are clamped into the scalar and whose last 32 bytes are the nonce prefix.
        Parameters:
        secret - seed (RFC 8032) or raw password (client_ed25519)
        Returns:
        64-byte expanded key
      • publicKey

        static byte[] publicKey​(byte[] expandedKey)
        Public key A = a·B for the expanded key.
        Parameters:
        expandedKey - expanded key from expand(byte[])
        Returns:
        32-byte encoded public key
      • sign

        static byte[] sign​(byte[] expandedKey,
                           byte[] publicKey,
                           byte[] message)
        Sign a message.
        Parameters:
        expandedKey - expanded key from expand(byte[])
        publicKey - public key from publicKey(byte[])
        message - message to sign
        Returns:
        64-byte signature R || S
      • sha512

        private static java.security.MessageDigest sha512()