pub fn sq(self: Self, x: Fe) Fe
Squares a field element.
self: Self
x: Fe
820 821 822 823 824 825 826 827 828 829 830
pub fn sq(self: Self, x: Fe) Fe { if (x.montgomery) { return self.montgomerySq(x); } else { var out = x; self.toMontgomery(&out) catch unreachable; out = self.montgomerySq(out); self.fromMontgomery(&out) catch unreachable; return out; } }
Squares a field element.