rustls 0.5.0

Rustls is a modern TLS library written in Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14

/// The single place where we generate random material
/// for our own use.  These functions never fail,
/// they panic on error.

use ring;

/// Fill the whole slice with random material.
pub fn fill_random(bytes: &mut [u8]) {
  ring::rand::SystemRandom::new()
    .fill(bytes)
    .unwrap();
}