Safe Haskell | None |
---|---|
Language | Haskell2010 |
Crypto.Random.DRBG.CTR
Synopsis
- data State a
- getCounter :: State a -> Word64
- reseedInterval :: Word64
- update :: BlockCipher a => ByteString -> State a -> Maybe (State a)
- instantiate :: BlockCipher a => Entropy -> PersonalizationString -> Maybe (State a)
- reseed :: BlockCipher a => State a -> Entropy -> AdditionalInput -> Maybe (State a)
- generate :: BlockCipher a => State a -> ByteLength -> AdditionalInput -> Maybe (RandomBits, State a)
Documentation
Instances
Serialize a => Serialize (State a) Source # | |
BlockCipher x => CryptoRandomGen (CtrDRBGWith x) # | |
Defined in Crypto.Random.DRBG Methods newGen :: ByteString -> Either GenError (CtrDRBGWith x) # genSeedLength :: Tagged (CtrDRBGWith x) ByteLength # genBytes :: ByteLength -> CtrDRBGWith x -> Either GenError (ByteString, CtrDRBGWith x) # reseedInfo :: CtrDRBGWith x -> ReseedInfo # reseedPeriod :: CtrDRBGWith x -> ReseedInfo # genBytesWithEntropy :: ByteLength -> ByteString -> CtrDRBGWith x -> Either GenError (ByteString, CtrDRBGWith x) # reseed :: ByteString -> CtrDRBGWith x -> Either GenError (CtrDRBGWith x) # newGenIO :: IO (CtrDRBGWith x) # |
getCounter :: State a -> Word64 Source #
Get a count of how many times this generator has been used since instantiation or reseed.
reseedInterval :: Word64 Source #
The reseed interval
update :: BlockCipher a => ByteString -> State a -> Maybe (State a) Source #
Update the RNG
instantiate :: BlockCipher a => Entropy -> PersonalizationString -> Maybe (State a) Source #
Instantiate a new CTR based counter. This assumes the block cipher is safe for generating 2^48 seperate bitstrings (e.g. For SP800-90 we assume AES and not 3DES)
reseed :: BlockCipher a => State a -> Entropy -> AdditionalInput -> Maybe (State a) Source #
reseed oldRNG entropy additionalInfo
Reseed a DRBG with some entropy (ent
must be at least seedlength, which is the
block length plus the key length)
generate :: BlockCipher a => State a -> ByteLength -> AdditionalInput -> Maybe (RandomBits, State a) Source #
Generate new bytes of data, stepping the generator.