pub fn sqrNoAlias(rma: *Mutable, a: Const, opt_allocator: ?Allocator) void 1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095 pub fn sqrNoAlias(rma: *Mutable, a: Const, opt_allocator: ?Allocator) void {
_ = opt_allocator;
assert(rma.limbs.ptr != a.limbs.ptr); // illegal aliasing
@memset(rma.limbs, 0);
llsquareBasecase(rma.limbs, a.limbs);
rma.normalize(2 * a.limbs.len + 1);
rma.positive = true;
}
rma = a * a
rmamay not alias witha.Asserts the result fits in
rma. An upper bound on the number of limbs needed by rma is given by2 * a.limbs.len + 1.If
allocatoris provided, it will be used for temporary storage to improve multiplication performance.error.OutOfMemoryis handled with a fallback algorithm.