Tezos_raw_protocol_011_PtHangz2.Seed_reprSourceTezos Protocol Implementation - Random number generation
This is not expected to be a good cryptographic random number generator. In particular this is supposed to be used in situations where the seed is a globally known information.
The only expected property is: It should be difficult to find a seed such that the generated sequence is a given one.
The state of the random number generator
A random seed, to derive random sequences from
A random sequence, to derive random values from
initialize_new state ident returns a new generator
Generates the next random value as a bounded int32
Returns a new seed by hashing the one passed with a constant.
initial_seeds n generates the first n seeds for which there are no nonces. The first seed is a constant value. The kth seed is the hash of seed (k-1) concatenated with a constant.
A nonce for adding entropy to the generator
Use a byte sequence as a nonce
Compute the has of a nonce
check_hash nonce hash is true if the nonce correspond to the hash
For using nonce hashes as keys in the hierarchical database