This significantly reduces the number of allocations needed to create a vector of exponential DC-net pads by reusing a digest slice prior to converting the result to a big integer.
Specifically, it reduces the allocations for the digest calculation from quadratic in the number of participants to a single alloc. The big integers themselves are still predominantly linear in the number of participants, however, they are not entirely linear because the big ints involve multiple allocations as the numbers grow larger prior to the modular reduction.
For a concrete example, with 15 participants, the total number of overall allocations with this change is reduced from 257 down to 47.
This significantly reduces the number of allocations needed to create a vector of exponential DC-net pads by reusing a digest slice prior to converting the result to a big integer.
Specifically, it reduces the allocations for the digest calculation from quadratic in the number of participants to a single alloc. The big integers themselves are still predominantly linear in the number of participants, however, they are not entirely linear because the big ints involve multiple allocations as the numbers grow larger prior to the modular reduction.
For a concrete example, with 15 participants, the total number of overall allocations with this change is reduced from 257 down to 47.