pub fn toMontgomery(self: Self, x: *Fe) RepresentationError!void UnexpectedRepresentation583
584
585
586
587
588
589
590 pub fn toMontgomery(self: Self, x: *Fe) RepresentationError!void {
if (x.montgomery) {
return error.UnexpectedRepresentation;
}
self.shrink(x) catch unreachable;
x.* = self.montgomeryMul(x.*, self.rr);
x.montgomery = true;
}
Converts a field element to the Montgomery form.