Re: [kvm-unit-tests PATCH v3 1/7] lib: Add pseudo random functions

Andrew Jones
2024-10-10T08:37:57Z

On Thu, Oct 10, 2024 at 10:25:47AM GMT, Nico Boehr wrote:
> Quoting Nina Schoetterl-Glausch (2024-06-20 16:16:54)
> > Add functions for generating pseudo random 32 and 64 bit values.
> > The implementation uses SHA-256 and so the randomness should have good
> > quality.
> > Implement the necessary subset of SHA-256.
> > The PRNG algorithm is equivalent to the following python snippet:
> >
> > def prng32(seed):
> > from hashlib import sha256
> > state = seed.to_bytes(8, byteorder="big")
> > while True:
> > state = sha256(state).digest()
> > for i in range(8):
> > yield int.from_bytes(state[i*4:(i+1)*4], byteorder="big")
>
> Thomas, Andrew,
> do you want to take this patch or is it OK it if comes with the whole
> series via s390x tree?

It's already merged, commit e83373301c43 ("lib: Add pseudo random functions")

Thanks,
drew