License | BSD-style |
---|---|
Maintainer | Brandon Hamilton <brandon.hamilton@gmail.com> |
Stability | stable |
Portability | good |
Safe Haskell | None |
Language | Haskell2010 |
Implementation of XSalsa20 algorithm https://cr.yp.to/snuffle/xsalsa-20081128.pdf Based on the Salsa20 algorithm with 256 bit key extended with 192 bit nonce
Synopsis
- initialize :: (ByteArrayAccess key, ByteArrayAccess nonce) => Int -> key -> nonce -> State
- combine :: ByteArray ba => State -> ba -> (ba, State)
- generate :: ByteArray ba => State -> Int -> (ba, State)
- data State
Documentation
:: (ByteArrayAccess key, ByteArrayAccess nonce) | |
=> Int | number of rounds (8,12,20) |
-> key | the key (256 bits) |
-> nonce | the nonce (192 bits) |
-> State | the initial XSalsa state |
Initialize a new XSalsa context with the number of rounds, the key and the nonce associated.
:: ByteArray ba | |
=> State | the current Salsa state |
-> ba | the source to xor with the generator |
-> (ba, State) |
Combine the salsa output and an arbitrary message with a xor, and return the combined output and the new state.
Generate a number of bytes from the Salsa output directly