newhope-0.1.0.0: Library implementing the NewHope cryptographic key-exchange protocol

Copyright© Jeremy Bornstein 2019
LicenseApache 2.0
Maintainerjeremy@bornstein.org
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Crypto.NewHope.RNG

Description

Pseudorandom number generation for NewHope.

This module contains the public interface. Implementation definitions are in the Crypto.NewHope.Internal.RNG module.

Synopsis

Documentation

data Context Source #

State for pseudorandom number generation

Instances
Eq Context Source # 
Instance details

Defined in Crypto.NewHope.Internal.RNG

Methods

(==) :: Context -> Context -> Bool #

(/=) :: Context -> Context -> Bool #

NFData Context Source #

We need this instance so that we can deepseq this data while doing performance tests.

Instance details

Defined in Crypto.NewHope.Internal.RNG

Methods

rnf :: Context -> () #

class RandomSeedable a Source #

Strings or ByteStrings may be used for source data.

Minimal complete definition

makeRandomSeed

Instances
RandomSeedable String Source # 
Instance details

Defined in Crypto.NewHope.Internal.RNG

Methods

makeRandomSeed :: String -> RandomSeed Source #

RandomSeedable ByteString Source # 
Instance details

Defined in Crypto.NewHope.Internal.RNG

Methods

makeRandomSeed :: ByteString -> RandomSeed Source #

makeRandomSeed :: RandomSeedable a => a -> RandomSeed Source #

Uses external entropy (precisely 48 bytes) to create a RandomSeed, used for initializing the pseudorandom number generator

randomBytesInit Source #

Arguments

:: RandomSeed

External entropy to seed the generator

-> Maybe RandomSeed

Optional additional entropy to include

-> Integer

Security strength: unused by this implementation

-> Context

The resulting PRNG state

Creates a Context as state for the pseudorandom number generator, required for key exchange operations

randomBytes :: Context -> Int -> (ByteString, Context) Source #

Generate pseudorandom bytes from the Context.