Ed25519MoneroPrivateKey.fromBytes constructor
Factory method for creating an Ed25519MoneroPrivateKey from a byte array. It checks the length of the provided keyBytes to ensure it matches the expected length. Then, it initializes an EdDSA private key using the Ed25519 generator and the specified keyBytes.
Implementation
factory Ed25519MoneroPrivateKey.fromBytes(List<int> keyBytes) {
if (keyBytes.length != Ed25519KeysConst.privKeyByteLen) {
throw ArgumentException("invalid private key length");
}
final gn = Curves.generatorED25519;
final prv = EDDSAPrivateKey.fromKhalow(gn, keyBytes);
return Ed25519MoneroPrivateKey._(prv);
}