toRawBytes method

  1. @override
Uint8List toRawBytes()
override

Return the byte array representation of the public key

Implementation

@override
Uint8List toRawBytes() {
  Uint8List buffer = encodeBigIntAsUnsigned(_bn);
  if (buffer.length == PUBLIC_KEY_SIZE) {
    return buffer;
  }

  final zeroPad = Uint8List(PUBLIC_KEY_SIZE);
  zeroPad.setAll(PUBLIC_KEY_SIZE - buffer.length, buffer);
  return zeroPad;
}