toEd25519Bytes method

List<int> toEd25519Bytes()

The toEd25519Bytes method converts the Schnorrkel secret key into a byte representation following the Ed25519 format, suitable for use in Ed25519 operations.

This method modifies the secret key by multiplying it by the cofactor and then combines it with the nonce to create a byte array in the Ed25519 format.

Returns: A List<int> containing the byte representation of the Schnorrkel secret key in Ed25519 format.

This byte representation is suitable for compatibility with Ed25519 operations.

Implementation

List<int> toEd25519Bytes() {
  final k = key();

  /// Multiply the secret key by the cofactor.
  _KeyUtils.multiplyScalarBytesByCofactor(k);
  return List<int>.from([...k, ...nonce()]);
}