This could be a variant of "worst case" where the Limbs are MaybeUninit or heapless::Vec which uses MaybeUninit behind the scenes.
This would allow easier portability between BoxedUint and no-alloc variant without re-writing into fixed sizes whilst avoiding global alloc ? e.g. here:
Say there is:
struct Foo {
a: HeaplessUint<2>, // U64/U128 Max
b: HeaplessUint<1>, // U32/64 Max
}
It would be more memory efficient than:
struct Foo<U: Unsigned> {
a: U
b: U
}
Where used U can be U2048 | U4096 etc. in case which it takes double the space vs optimising through worst case.
And more flexible than relying on type-aliases:
struct Foo {
a: U2048,
b: U128,
}
Arguably it is just another form of Uint<Limbs> but Heapless is essentially optimizing through [MaybeUninit<Limb>; N]
This could be a variant of "worst case" where the Limbs are MaybeUninit or heapless::Vec which uses MaybeUninit behind the scenes.
This would allow easier portability between BoxedUint and no-alloc variant without re-writing into fixed sizes whilst avoiding global alloc ? e.g. here:
no_alloc-friendly keys RSA#636 (comment)Say there is:
It would be more memory efficient than:
Where used
Ucan beU2048|U4096etc. in case which it takes double the space vs optimising through worst case.And more flexible than relying on type-aliases:
Arguably it is just another form of
Uint<Limbs>but Heapless is essentially optimizing through[MaybeUninit<Limb>; N]