package tezos-protocol-012-Psithaca
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=43723d096307603703a1a89ed1b2eb202b365f5e7824b96b0cbf813b343a6cf7
sha512=b2a637f2e965000d3d49ad85277ca24d6cb07a1a7cf2bc69d296d8b03ad78c3eaa8e21e94b9162e62c2e11649cd03bc845b2a3dafe623b91065df69d47dc8e4f
doc/tezos-protocol-012-Psithaca.raw/Tezos_raw_protocol_012_Psithaca/Seed_repr/index.html
Module Tezos_raw_protocol_012_Psithaca.Seed_repr
Source
Tezos 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.
Random Generation
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
take_int32 s bound
generates the next random value as a bounded int32
take_int64 s bound
generates the next random value as a bounded int64
Predefined seeds
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.
Entropy
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