y property
Get the y-coordinate of this point in projective elliptic curve coordinates.
Implementation
@override
BigInt get y {
final yCoordinate = _coords[1];
final zCoordinate = _coords[2];
final primeField = curve.p;
// Check if the z-coordinate is already one.
if (zCoordinate == BigInt.one) {
return yCoordinate;
}
// Calculate the modular inverse of z-coordinate.
final zInverse = BigintUtils.inverseMod(zCoordinate, primeField);
// Compute the normalized y-coordinate using the formula.
final normalizedY =
(yCoordinate * zInverse * zInverse * zInverse) % primeField;
return normalizedY;
}