Closed survived closed 1 year ago
I see two ways to implement this PRNG:
seed: Fn(Digest) -> Output<Digest>
\
i-th chunk of randomness would be
seed(Digest::new().chain(i))
seed: &[&[u8]]
\
i-th chunk of randomness would be
Digest::new()
.chain(i)
.chain(seed[0])
/* ... */
.chain(seed[n-1])
.finalize()
Let me know if you have other ideas @d86leader
Problem with current approach of deriving a challenge is that it truncates entropy to 256 bits. Depending on choice of security level, implementation might need a higher security level. Suggested approach to address that is to have our own implementation of PRNG (
RngCore
) that calculates i-th chunk of 32 random bytes asH(i || ..args)
.