Function sqrNoAlias [src]
rma = a * a
rma may not alias with a.
Asserts the result fits in rma. An upper bound on the number of limbs needed by
rma is given by 2 * a.limbs.len + 1.
If allocator is provided, it will be used for temporary storage to improve
multiplication performance. error.OutOfMemory is handled with a fallback algorithm.
Prototype
pub fn sqrNoAlias(rma: *Mutable, a: Const, opt_allocator: ?Allocator) void
Parameters
rma: *Mutable
a: Const
opt_allocator: ?Allocator
Source
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;
}