Copyright | (c) Piyush P Kurur 2019 |
---|---|
License | Apache-2.0 OR BSD-3-Clause |
Maintainer | Piyush P Kurur <ppk@iitpkd.ac.in> |
Stability | experimental |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- data HashMemory128 h
- data HashMemory64 h
- hashCellPointer :: Storable h => HashMemory64 h -> Ptr h
- hashCell128Pointer :: Storable h => HashMemory128 h -> Ptr h
- lengthCellPointer :: Storable h => HashMemory64 h -> Ptr (BYTES Word64)
- uLengthCellPointer :: Storable h => HashMemory128 h -> Ptr (BYTES Word64)
- lLengthCellPointer :: Storable h => HashMemory128 h -> Ptr (BYTES Word64)
- getLength :: HashMemory64 h -> IO (BYTES Word64)
- getULength :: HashMemory128 h -> IO (BYTES Word64)
- getLLength :: HashMemory128 h -> IO (BYTES Word64)
- updateLength :: LengthUnit len => len -> HashMemory64 h -> IO ()
- updateLength128 :: LengthUnit len => len -> HashMemory128 h -> IO ()
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
Initialisable Blake2bMem () Source # | |
Defined in Raaz.Primitive.Blake2.Internal initialise :: () -> Blake2bMem -> IO () Source # | |
Initialisable Sha512Mem () Source # | |
Defined in Raaz.Primitive.Sha2.Internal initialise :: () -> Sha512Mem -> IO () Source # | |
Storable h => Memory (HashMemory128 h) Source # | |
Defined in Raaz.Primitive.HashMemory memoryAlloc :: Alloc (HashMemory128 h) Source # unsafeToPointer :: HashMemory128 h -> Ptr Word8 Source # | |
Storable h => Extractable (HashMemory128 h) h Source # | |
Defined in Raaz.Primitive.HashMemory extract :: HashMemory128 h -> IO h Source # | |
Storable h => Initialisable (HashMemory128 h) h Source # | |
Defined in Raaz.Primitive.HashMemory initialise :: h -> HashMemory128 h -> IO () Source # |
data HashMemory64 h Source #
Similar to HashMemory128
but keeps track of length as a 64-bit quantity.
Instances
Initialisable Blake2sMem () Source # | |
Defined in Raaz.Primitive.Blake2.Internal initialise :: () -> Blake2sMem -> IO () Source # | |
Initialisable Sha256Mem () Source # | |
Defined in Raaz.Primitive.Sha2.Internal initialise :: () -> Sha256Mem -> IO () Source # | |
Storable h => Memory (HashMemory64 h) Source # | |
Defined in Raaz.Primitive.HashMemory memoryAlloc :: Alloc (HashMemory64 h) Source # unsafeToPointer :: HashMemory64 h -> Ptr Word8 Source # | |
Storable h => Extractable (HashMemory64 h) h Source # | |
Defined in Raaz.Primitive.HashMemory extract :: HashMemory64 h -> IO h Source # | |
Storable h => Initialisable (HashMemory64 h) h Source # | |
Defined in Raaz.Primitive.HashMemory 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.
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.