Noise-C
 All Data Structures Files Functions Variables Typedefs Macros Groups Pages
Functions
rand_os.c File Reference

Access to the system random number generator. More...

#include "internal.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>

Go to the source code of this file.

Functions

void noise_rand_bytes (void *bytes, size_t size)
 Gets cryptographically-strong random bytes from the operating system. More...
 

Detailed Description

Access to the system random number generator.

This module provides access to the system random number generator for obtaining random data to generate ephemeral keys during a session and static keys for permanent storage.

This module will require modification when porting to new systems.

Definition in file rand_os.c.

Function Documentation

void noise_rand_bytes ( void *  bytes,
size_t  size 
)

Gets cryptographically-strong random bytes from the operating system.

Parameters
bytesThe buffer to fill with random bytes.
sizeThe number of random bytes to obtain.

This function should not block waiting for entropy.

Note
Not part of the public API.

Definition at line 68 of file rand_os.c.