Description
Currently, generate :: IO Nonce works only in IO.
This means, that if I have primitives containing nonce, generators for these primitives are bound to IO too. If I want to use deterministic generation in tests, I have to re-implement generation logic from scratch in pure environment.
See this module from Morley project as an example. It declares createChestAndChestKey generator in IO, and then has to re-implement it from scratch in pure way, see createChestAndChestKeyFromSeed.
So I want crypto-sodium to expose some MonadRandom, and let the generation of nonce work there.
Acceptance criteria
- That module from Morley defines only one
createChestAndChestKey generator.
- This generator is easy to run both in
IO and in Hedgehog tests.
Description
Currently,
generate :: IO Nonceworks only inIO.This means, that if I have primitives containing nonce, generators for these primitives are bound to
IOtoo. If I want to use deterministic generation in tests, I have to re-implement generation logic from scratch in pure environment.See this module from Morley project as an example. It declares
createChestAndChestKeygenerator inIO, and then has to re-implement it from scratch in pure way, seecreateChestAndChestKeyFromSeed.So I want crypto-sodium to expose some
MonadRandom, and let the generation of nonce work there.Acceptance criteria
createChestAndChestKeygenerator.IOand in Hedgehog tests.