Ed25519MathPlatform

scalus.crypto.ed25519.Ed25519MathPlatform

JVM implementation of Ed25519 mathematical operations using BouncyCastle.

WARNING: This implementation uses reflection to access BouncyCastle's internal scalarMultBaseEncoded method because the public API only exposes key derivation that hashes the seed first (standard Ed25519), whereas BIP32-Ed25519 requires direct scalar multiplication with an already-clamped scalar.

This approach is fragile and may break with future BouncyCastle updates. If BouncyCastle exposes a public scalar multiplication API in the future, this should be updated to use it instead.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def scalarMultiplyBase(scalar: Array[Byte]): Array[Byte]

Multiply the Ed25519 base point by a scalar to derive the public key.

Multiply the Ed25519 base point by a scalar to derive the public key.

For BIP32-Ed25519, the scalar is already clamped and we need direct scalar*base multiplication, not the standard Ed25519 key derivation which hashes the seed first.

Uses reflection to call BouncyCastle's internal scalarMultBaseEncoded method.

Value parameters

scalar

32-byte clamped scalar in little-endian format

Attributes

Returns

32-byte compressed public key point