aes_ctr_drbg

Crates.ioaes_ctr_drbg
lib.rsaes_ctr_drbg
version0.0.2
sourcesrc
created_at2021-04-13 09:11:03.161792
updated_at2021-04-13 09:37:50.771356
descriptionImplementation of CTR DRBG based on AES-256.
homepage
repositoryhttps://github.com/henrydcase/aes_ctr_drbg
max_upload_size
id382793
size4,463
Kris Kwiatkowski (kriskwiatkowski)

documentation

README

AES-CTR-DRBG

DRBG implementation based on AES-256.

Usage:

use aes_ctr_drbg::DrbgCtx;

fn main() {


	// personalization string must be min. 48 bytes long
	let p = vec![48, 0];

	// get entropy from somewhere, f.e. /dev/random
	let entropy: [u8; 48] = [0x04; 48]; // don't use that!

	let mut drbg = DrbgCtx::new();
	drbg.init(&entropy, p);

	// get 10 bytes
	let mut out = Vec::new();
	out.resize(10, 0);
	drbg.get_random(&mut out);

    println!("{:?}", out);
}
Commit count: 4

cargo fmt