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 |
Raaz.Primitive.ChaCha20.Internal
Contents
Description
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.
Constructors
ChaCha20 |
Instances
The type associated with the XChaCha20 variant.
Constructors
XChaCha20 |
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.
Constructors
ChaCha20Mem | |
Fields
|
Instances
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.