pointFromScalar method

Uint8List pointFromScalar(
  1. Uint8List d
)

Implementation

Uint8List pointFromScalar(Uint8List d) {
  if (!isPrivate(d)) {
    throw ArgumentError('The argument must be a private key');
  }

  final dd = d.toBigInt();
  final pp = Bip32._secp256k1.G * dd;

  if (pp!.isInfinity) {
    throw Exception('Derived infinity');
  }

  return pp.getEncoded(true);
}