Module ntru::rand [] [src]

Rand module

This module includes all the needed structs and functions to interact with the randomness needed by NTRUEncrypt. Both, key generation and encryption need a source of randomness, for that they need a NtruRandContext, that can be generated from a NtruRandGen. The recommended RNG is the NTRU_RNG_DEFAULT. If needed, in this module random data can be generated with the generate() function. Also both random NtruTernPoly and NtruProdPoly can be generated.

Structs

NtruRandContext

A random context for key generation and encryption

NtruRandGen

Constants

NTRU_RNG_DEFAULT

default RNG (/dev/urandom on *nix)

NTRU_RNG_DEVRANDOM

Unix RNG, /dev/random

NTRU_RNG_DEVURANDOM

Unix default RNG, /dev/urandom

NTRU_RNG_IGF2

Deterministic RNG based on IGF-2

Functions

generate

Generate random data

init

Initialize a new rand context

init_det

Generate a new deterministic rand context