License | BSD-style |
---|---|
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Stability | stable |
Portability | good |
Safe Haskell | None |
Language | Haskell2010 |
A simple AEAD scheme using ChaCha20 and Poly1305.
See RFC7539.
- data State
- data Nonce
- nonce12 :: ByteArrayAccess iv => iv -> CryptoFailable Nonce
- nonce8 :: ByteArrayAccess ba => ba -> ba -> CryptoFailable Nonce
- initialize :: ByteArrayAccess key => key -> Nonce -> CryptoFailable State
- appendAAD :: ByteArrayAccess ba => ba -> State -> State
- finalizeAAD :: State -> State
- encrypt :: ByteArray ba => ba -> State -> (ba, State)
- decrypt :: ByteArray ba => ba -> State -> (ba, State)
- finalize :: State -> Auth
Documentation
nonce12 :: ByteArrayAccess iv => iv -> CryptoFailable Nonce Source
Nonce smart constructor 12 bytes IV, nonce constructor
:: ByteArrayAccess ba | |
=> ba | 4 bytes constant |
-> ba | 8 bytes IV |
-> CryptoFailable Nonce |
8 bytes IV, nonce constructor
initialize :: ByteArrayAccess key => key -> Nonce -> CryptoFailable State Source
appendAAD :: ByteArrayAccess ba => ba -> State -> State Source
finalizeAAD :: State -> State Source