edIsOnCurve function

bool edIsOnCurve(
  1. EdPoint point
)

Implementation

bool edIsOnCurve(EdPoint point) {
  if (point.isInfinity) return true;
  final x2 = (point.x * point.x) % ed25519P;
  final y2 = (point.y * point.y) % ed25519P;
  final left = (ed25519P - x2 + y2) % ed25519P;
  final right = (BigInt.one + ed25519D * x2 % ed25519P * y2) % ed25519P;
  return left == right;
}