Class Ed25519Signer
java.lang.Object
org.mariadb.jdbc.plugin.authentication.standard.Ed25519Signer
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
FieldsModifier and TypeFieldDescriptionprivate static final Ed25519ScalarOpsprivate static final EdDSAParameterSpec -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(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 MessageDigestsha512()(package private) static byte[]sign(byte[] expandedKey, byte[] publicKey, byte[] message) Sign a message.
-
Field Details
-
SPEC
-
SCALAR_OPS
-
-
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 fromexpand(byte[])- Returns:
- 32-byte encoded public key
-
sign
static byte[] sign(byte[] expandedKey, byte[] publicKey, byte[] message) Sign a message.- Parameters:
expandedKey- expanded key fromexpand(byte[])publicKey- public key frompublicKey(byte[])message- message to sign- Returns:
- 64-byte signature R || S
-
sha512
-