ed448GenerateKey function

Uint8List ed448GenerateKey()

Generates a random 57-byte Ed448 private key.

Implementation

Uint8List ed448GenerateKey() {
  final privateKey = Uint8List(ed448.KEY_LENGTH);
  final random = Random.secure();
  for (var i = 0; i < privateKey.length; i++) {
    privateKey[i] = random.nextInt(256);
  }
  privateKey[ed448.KEY_LENGTH - 1] &= 0x7f;
  return privateKey;
}