Ed25519Keypair.fromSeed constructor

Ed25519Keypair.fromSeed(
  1. Uint8List seed
)

Generate a Ed25519 keypair from a 32 byte seed.

Implementation

factory Ed25519Keypair.fromSeed(Uint8List seed) {
  if (seed.length != 32) throw ArgumentError("Wrong secretKey size. Expected 32 bytes, got ${seed.length}.");

  final privateKey = ed25519.newKeyFromSeed(seed);
  return Ed25519Keypair(Uint8List.fromList(privateKey.bytes));
}