edPointToBytes function

Uint8List edPointToBytes(
  1. EdPoint point
)

Implementation

Uint8List edPointToBytes(EdPoint point) {
  if (point.isInfinity) {
    final bytes = Uint8List(32);
    bytes[0] = 0x01;
    return bytes;
  }
  final bytes = edBigIntToBytes(point.y, 32);
  if (point.x.isOdd) {
    bytes[31] |= 0x80;
  }
  return bytes;
}