Function recoverY [src]
Recover the Y coordinate from the X coordinate.
Prototype
pub fn recoverY(x: Fe, is_odd: bool) NotSquareError!Fe
Parameters
x: Fe
is_odd: bool
Possible Errors
Source
pub fn recoverY(x: Fe, is_odd: bool) NotSquareError!Fe {
const x3AxB = x.sq().mul(x).sub(x).sub(x).sub(x).add(B);
var y = try x3AxB.sqrt();
const yn = y.neg();
y.cMov(yn, @intFromBool(is_odd) ^ @intFromBool(y.isOdd()));
return y;
}