VestaPoint.random constructor
VestaPoint.random()
Implementation
factory VestaPoint.random() {
while (true) {
final x = VestaFq.random();
final ySign = QuickCrypto.nextU32() % 2;
final x3 = x.square() * x;
VestaFq? y = (x3 + PastaCurveParams.vesta.b).sqrt().sqrtOrNull();
if (y == null) continue;
if (y == VestaFq.fromBytes(y.toBytes())) {
final sign = y.isOdd() ? 1 : 0;
if ((ySign ^ sign) != 0) {
y = -y;
}
return VestaAffinePoint(x: x, y: y).toCurve();
}
}
}