Copyright | Dong Han 2021 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Several different RNG types are implemented. Some access hardware RNGs, which are only available on certain platforms. Others are mostly useful in specific situations.
RNG
RNG types.
Instances
Eq RNGType Source # | |
Ord RNGType Source # | |
Show RNGType Source # | |
Generic RNGType Source # | |
JSON RNGType Source # | |
Print RNGType Source # | |
Defined in Z.Crypto.RNG toUTF8BuilderP :: Int -> RNGType -> Builder () # | |
type Rep RNGType Source # | |
Defined in Z.Crypto.RNG type Rep RNGType = D1 ('MetaData "RNGType" "Z.Crypto.RNG" "Z-Botan-0.1.1.2-9fVnt3owi1vE69mjWqPaAt" 'False) (C1 ('MetaCons "SystemRNG" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "AutoSeededRNG" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ProcessorRNG" 'PrefixI 'False) (U1 :: Type -> Type))) |
Opaque botan RNG type.
Instances
Show RNG Source # | |
Generic RNG Source # | |
Print RNG Source # | |
Defined in Z.Crypto.RNG toUTF8BuilderP :: Int -> RNG -> Builder () # | |
type Rep RNG Source # | |
Defined in Z.Crypto.RNG type Rep RNG = D1 ('MetaData "RNG" "Z.Crypto.RNG" "Z-Botan-0.1.1.2-9fVnt3owi1vE69mjWqPaAt" 'True) (C1 ('MetaCons "RNG" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BotanStruct))) |
newRNG :: RNGType -> IO RNG Source #
Initialize a random number generator object from the given RNGType
Get an autoseeded RNG from a global RNG pool divide by haskell capability.
Botan internal use a lock to protect user-space RNG, which may cause contention if shared. This function will fetch an autoseeded RNG from a global RNG pool, which is recommended under concurrent settings.
reseedRNG :: RNG -> Int -> IO () Source #
Reseeds the random number generator with bits number of bits from the SystemRNG
.
reseedRNGFromRNG :: RNG -> RNG -> Int -> IO () Source #
Reseeds the random number generator with bits number of bits from the given source RNG.
addEntropyRNG :: RNG -> Bytes -> IO () Source #
Adds the provided seed material to the internal RNG state.
This call may be ignored by certain RNG instances (such as ProcessorRNG
or, on some systems, the SystemRNG
).