On Wed, Aug 09, 2023 at 11:50:38AM -0700, Junio C Hamano wrote: > Derrick Stolee <derrickstolee@xxxxxxxxxx> writes: > > >> Instead of using srand() and rand() (which would make sense to wrap with > >> git_rand() as you propose), we can simplify our lives by using a CSPRNG, > >> which only gets initialized once, as is already the case with > >> csprng_bytes(). > > > > So the idea is to use csprng_bytes() everywhere instead of srand()/rand(). > > > > I can adjust my local patch to still create git_rand(), but base it on > > csprng_bytes() and not collide with your patch. Mimicking rand()'s behavior > > is a simpler interface to consume. > > I am still ambivalent about wasting entropy for something that > srand() would suffice, so git_rand() interface may be an welcome > addition anyway, that serves an extra layer of indirection to > insulate the callers from the implementation. Sounds good to me, I'm not particularly attached to one implementation over another. Thanks, both. Thanks, Taylor