ECPoint? cleanPoint(ECCurve c, ECPoint p) { var cp = p.curve; if (c != cp) { throw PlatformException('Point must be on the same curve'); } return c.decodePoint(p.getEncoded(false)); }