Module ntru::rand [] [src]

Rand module

This module includes all the needed structs and functions to interact with the randomness needed by NTRU. Both, key generation and encryption need a source of randomness, for that they need a RandContext, that can be generated from a RandGen. The recommended RNG is the RNG_DEFAULT. If needed, in this module random data can be generated with the generate() function. Also both random TernPoly and ProdPoly can be generated.

Structs

RandContext

A random context for key generation and encryption

RandGen

Random number generator

Constants

RNG_CTR_DRBG

Deterministic RNG based on CTR_DRBG

RNG_DEFAULT

Default RNG

RNG_DEVRANDOM

Unix RNG, /dev/random

RNG_DEVURANDOM

Unix default RNG, /dev/urandom

Functions

generate

Generate random data

init

Initialize a new rand context

init_det

Generate a new deterministic rand context