#random #esdm #rand #cargo-toml

rand-esdm

provides interface to ESDM RNG server

11 releases

0.1.5 Jul 23, 2024
0.1.4 Jun 7, 2024
0.1.3 May 30, 2024
0.1.1 Mar 22, 2024
0.0.2 Aug 10, 2023

#563 in Cryptography

Download history 13/week @ 2024-07-29 7/week @ 2024-08-12 17/week @ 2024-09-16 29/week @ 2024-09-23 10/week @ 2024-09-30 80/week @ 2024-10-14 51/week @ 2024-10-21 19/week @ 2024-10-28 7/week @ 2024-11-04 7/week @ 2024-11-11

86 downloads per month
Used in esdm-tool

MIT license

20KB
395 lines

rand-esdm

crates.io

About

A small library for interfacing Rust with the ESDM user-space random server.

It currently provides the minimal amount of bindings necessary to use ESDM together with the rand crate.

Usage Example

Add rand-esdm to your Cargo.toml

rand-esdm = "0.0.3"

Generate Random Numbers with rand crate

Choose type of rng:

  • Only usable when fully seeded: let mut rng = EsdmRng::new(EsdmRngType::FullySeeded);
  • Only usable with fresh entropy: let mut rng = EsdmRng::new(EsdmRngType::PredictionResistant);

Include Rng utility trait from rand:

use rand::Rng;

Draw random numbers as needed, e.g.:

let rnd: u64 = rng.gen();

Dependencies

~2.2–5MB
~89K SLoC