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 | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- data ChaCha20 = ChaCha20
- data XChaCha20 = XChaCha20
- data family Key p :: Type
- data family Nounce p :: Type
- data ChaCha20Mem = ChaCha20Mem {
- keyCell :: MemoryCell (Key ChaCha20)
- ivCell :: MemoryCell (Nounce ChaCha20)
- counterCell :: MemoryCell WORD
- keyCellPtr :: ChaCha20Mem -> Ptr (Key ChaCha20)
- ivCellPtr :: ChaCha20Mem -> Ptr (Nounce ChaCha20)
- counterCellPtr :: ChaCha20Mem -> Ptr WORD
ChaCha20 cipher
This module defines the ChaCha20 ciphers and the memory element used by a typical implementation. The variant of Chacha20 that we support is the IETF version described in RFC 7538 with 32-bit (4-byte) counter and 96-bit (12-byte) IV.
The type associated with the ChaCha20 cipher.
Instances
The type associated with the XChaCha20 variant.
Instances
data family Key p :: Type Source #
The type family that captures the key of a keyed primitive.
Instances
data family Nounce p :: Type Source #
In addition to keys, certain primitives require nounces that can be public but needs to be distinct across different uses when sharing the key. The type family that captures the nounce for a primitive (if it requires one).
Instances
data ChaCha20Mem Source #
The memory element used by chacha20. This memory is an instance
of WriteAccessible
where the key portion of the memory can be
written into.
ChaCha20Mem | |
|
Instances
Memory ChaCha20Mem Source # | |
Defined in Raaz.Primitive.ChaCha20.Internal | |
WriteAccessible ChaCha20Mem Source # | Writes into the key portion. |
Defined in Raaz.Primitive.ChaCha20.Internal writeAccess :: ChaCha20Mem -> [Access] Source # afterWriteAdjustment :: ChaCha20Mem -> IO () Source # | |
Extractable ChaCha20Mem (BlockCount ChaCha20) Source # | |
Defined in Raaz.Primitive.ChaCha20.Internal extract :: ChaCha20Mem -> IO (BlockCount ChaCha20) Source # | |
Initialisable ChaCha20Mem (BlockCount ChaCha20) Source # | |
Defined in Raaz.Primitive.ChaCha20.Internal initialise :: BlockCount ChaCha20 -> ChaCha20Mem -> IO () Source # | |
Initialisable ChaCha20Mem (Key ChaCha20) Source # | |
Defined in Raaz.Primitive.ChaCha20.Internal initialise :: Key ChaCha20 -> ChaCha20Mem -> IO () Source # | |
Initialisable ChaCha20Mem (Nounce ChaCha20) Source # | |
Defined in Raaz.Primitive.ChaCha20.Internal initialise :: Nounce ChaCha20 -> ChaCha20Mem -> IO () Source # |
keyCellPtr :: ChaCha20Mem -> Ptr (Key ChaCha20) Source #
The pointer into the chacha memory where the key is stored.
ivCellPtr :: ChaCha20Mem -> Ptr (Nounce ChaCha20) Source #
The pointer into the chacha memory where the iv is stored.
counterCellPtr :: ChaCha20Mem -> Ptr WORD Source #
The pointer in the chacha memory where the counter is stored.