isPointOnEd25519Curve function

bool isPointOnEd25519Curve(
  1. Iterable<int> data
)

Implementation

bool isPointOnEd25519Curve(Iterable<int> data) {
  if (data.length != 32) {
    throw const FormatException(
      'invalid length, decoded address is not 32 bytes long',
    );
  }
  try {
    final compressed = CompressedEdwardsY(data.map(BigInt.from).toList());
    final point = compressed.decompress();

    return !point.isSmallOrder();
  } on FormatException {
    return false;
  }
}