#random #run-time #getrandom #instance #set #cha-cha-rng

getrandom-runtime-seeded

A collection of standardized messages, state structs, and helper functions a contract can use to implement contract migration

2 releases (1 stable)

1.0.0 Feb 27, 2024
0.1.0 Feb 27, 2024

#1243 in Cryptography

Custom license

3KB

getrandom-runtime-seeded

A custom getrandom implementation that uses a ChaChaRng instance set at runtime.

Setup

To register the function, we first depend on getrandom-runtime-seeded and getrandom with the custom feature in Cargo.toml:

[dependencies]
getrandom-runtime-seeded = "0.1"
getrandom = { version = "0.2", features = ["custom"] }
``

Then, we register the function in src/lb.rs:

use getrandom-runtime-seeded::always_fail;
use getrandom::register_custom_getrandom;

register_custom_getrandom!(always_fail);

Dependencies

~1.1–2MB
~35K SLoC