PublicKey constructor

PublicKey(
  1. Uint8List x,
  2. Uint8List y,
  3. Curve? curve
)

Implementation

PublicKey(Uint8List this.x, Uint8List this.y, this.curve) {
  this.xLength = x!.lengthInBytes;
  this.yLength = y!.lengthInBytes;
  if (this.xLength > this.curve!.xylPublicKey() ||
      this.yLength > curve!.xylPublicKey(getYLength: true)) {
    throw Exception('Invalid x and/or y length for curve ${this.curve!.name} - ' +
        'expected <= X${curve!.xylPublicKey()}:Y${curve!.xylPublicKey(getYLength: true)}, ' +
        'got X${this.xLength}:Y${this.yLength}');
  }
}