mirage / mirage-crypto

Cryptographic primitives for OCaml, in OCaml (also used in MirageOS)
ISC License
77 stars 43 forks source link

mirage-crypto-rng-mirage: provide a module type S (to overcome the mirage-random opam package) #234

Closed hannesm closed 5 months ago

hannesm commented 5 months ago

The idea is to not be complete (otherwise, we could make Mirage_crypto_rng a module type), but to focus on the useful and used functions, which are:

If there are any remaining functions that are used in the wild, please let me know. I also ensured to provide type equality, thus the full Mirage_crypto_rng can be used. Let me know what you think of it. I tested it locally with the unikernel example and a hardcoded new entropy source.

hannesm commented 5 months ago

I've to admit that I'm a bit uncertain - the context being https://github.com/mirage/mirage/issues/1513 I guess the whole "(R : Mirage_random.S)" or now "(R : Mirage_crypto_rng_mirage.S)" (or "(R : module type of Mirage_crypto_rng)") will vanish, the question is what do we want in the intermediate:

I'm fine with the ❤️, which is what this PR proposes. The reasoning is that once we have 1513 in place, we only need to very locally remove the module type S (in mirage-crypto-rng-mirage), and move on.