Class Ed25519Signer

java.lang.Object
org.mariadb.jdbc.plugin.authentication.standard.Ed25519Signer

final class Ed25519Signer extends 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.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final Ed25519ScalarOps
     
    private static final EdDSAParameterSpec
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
     
  • Method Summary

    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 MessageDigest
     
    (package private) static byte[]
    sign(byte[] expandedKey, byte[] publicKey, byte[] message)
    Sign a message.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Ed25519Signer

      private Ed25519Signer()
  • Method Details

    • 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 MessageDigest sha512()