random0.ml 501 B

1234567891011121314151617
  1. (* https://raw.githubusercontent.com/aantron/dream/8612f6a661053ba4e0800c9c6c7f39bdefd5f9eb/src/cipher/random.ml *)
  2. (* This file is part of Dream, released under the MIT license. See LICENSE.md
  3. for details, or visit https://github.com/aantron/dream.
  4. Copyright 2021 Anton Bachin *)
  5. (* TODO LATER Is there something with lighter dependencies? Although perhaps
  6. these are not so bad... *)
  7. let random_buffer = Mirage_crypto_rng.generate
  8. let random n =
  9. Cstruct.to_string (random_buffer n)