Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RandomGenerator to Sui Framework (#15019)
## Description Add interfaces for fetching randomness: `RandomGenerator` is a PRG with a seed that is derived from the global randomness (which is the same between randomness rounds) and a fresh UID (which is guaranteed to be unique by the framework). In other words, the seed is unpredictable without knowing the global randomness, and different for each created generator (thus not predictable even by different functions invoked for the same tx). `RandomGenerator` manages an internal state with a buffer of random bytes derived using the PRG, and provides high level functions for deriving integers from those random bytes. ## Test Plan Unit tests --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [x] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [x] breaking change for FNs (FN binary must upgrade) - [x] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes Add Move interfaces for generating secure random values.
- Loading branch information