mirror of
https://github.com/ziglang/zig.git
synced 2026-01-03 03:53:20 +00:00
Work around sqrtRatioM1() issue in release-safe mode
This commit is contained in:
parent
08dfbee961
commit
ab6ffa8a3c
@ -24,11 +24,11 @@ pub const Ristretto255 = struct {
|
||||
const has_f_root = f_root_check.isZero();
|
||||
const x_sqrtm1 = x.mul(Fe.sqrtm1); // x*sqrt(-1)
|
||||
x.cMov(x_sqrtm1, @boolToInt(has_p_root) | @boolToInt(has_f_root));
|
||||
x = x.abs();
|
||||
const xa = x.abs();
|
||||
if ((@boolToInt(has_m_root) | @boolToInt(has_p_root)) == 0) {
|
||||
return error.NoRoot;
|
||||
}
|
||||
return x;
|
||||
return xa;
|
||||
}
|
||||
|
||||
fn rejectNonCanonical(s: [32]u8) !void {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user