raaz-0.3.10: Fast and type safe cryptography.
Copyright(c) Piyush P Kurur 2019
LicenseApache-2.0 OR BSD-3-Clause
MaintainerPiyush P Kurur <ppk@iitpkd.ac.in>
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageHaskell2010

Raaz.Primitive.HashMemory

Description

 
Synopsis

Documentation

data HashMemory128 h Source #

Memory element that keeps track of a hash and the total bytes processed (as a 128 bit quantity). Such a memory element is useful for building the memory element for cryptographic hashes.

Instances

Instances details
Initialisable Blake2bMem () Source # 
Instance details

Defined in Raaz.Primitive.Blake2.Internal

Methods

initialise :: () -> Blake2bMem -> IO () Source #

Initialisable Sha512Mem () Source # 
Instance details

Defined in Raaz.Primitive.Sha2.Internal

Methods

initialise :: () -> Sha512Mem -> IO () Source #

Storable h => Memory (HashMemory128 h) Source # 
Instance details

Defined in Raaz.Primitive.HashMemory

Storable h => Extractable (HashMemory128 h) h Source # 
Instance details

Defined in Raaz.Primitive.HashMemory

Methods

extract :: HashMemory128 h -> IO h Source #

Storable h => Initialisable (HashMemory128 h) h Source # 
Instance details

Defined in Raaz.Primitive.HashMemory

Methods

initialise :: h -> HashMemory128 h -> IO () Source #

data HashMemory64 h Source #

Similar to HashMemory128 but keeps track of length as a 64-bit quantity.

Instances

Instances details
Initialisable Blake2sMem () Source # 
Instance details

Defined in Raaz.Primitive.Blake2.Internal

Methods

initialise :: () -> Blake2sMem -> IO () Source #

Initialisable Sha256Mem () Source # 
Instance details

Defined in Raaz.Primitive.Sha2.Internal

Methods

initialise :: () -> Sha256Mem -> IO () Source #

Storable h => Memory (HashMemory64 h) Source # 
Instance details

Defined in Raaz.Primitive.HashMemory

Storable h => Extractable (HashMemory64 h) h Source # 
Instance details

Defined in Raaz.Primitive.HashMemory

Methods

extract :: HashMemory64 h -> IO h Source #

Storable h => Initialisable (HashMemory64 h) h Source # 
Instance details

Defined in Raaz.Primitive.HashMemory

Methods

initialise :: h -> HashMemory64 h -> IO () Source #

hashCellPointer :: Storable h => HashMemory64 h -> Ptr h Source #

Get the pointer to the hash.

hashCell128Pointer :: Storable h => HashMemory128 h -> Ptr h Source #

Get the pointer to the array which stores the digest

lengthCellPointer :: Storable h => HashMemory64 h -> Ptr (BYTES Word64) Source #

Get the pointer to upper half of the length bytes.

uLengthCellPointer :: Storable h => HashMemory128 h -> Ptr (BYTES Word64) Source #

Get the pointer to upper half of the length bytes.

lLengthCellPointer :: Storable h => HashMemory128 h -> Ptr (BYTES Word64) Source #

Get the pointer to the lower half of the length bytes.

getLength :: HashMemory64 h -> IO (BYTES Word64) Source #

Get the length.

getULength :: HashMemory128 h -> IO (BYTES Word64) Source #

Get the higher order 64-bits.

getLLength :: HashMemory128 h -> IO (BYTES Word64) Source #

Get the lower order 64-bits

updateLength :: LengthUnit len => len -> HashMemory64 h -> IO () Source #

Update the 64-bit length stored in the hash memory.

updateLength128 :: LengthUnit len => len -> HashMemory128 h -> IO () Source #

Update the 128 bit length stored in the hash memory.