Portability | Excellent |
---|---|
Stability | Stable |
Maintainer | Vincent Hanquez <vincent@snarc.org> |
Safe Haskell | None |
mutable and unsafe interface for Block ciphers. export a BlockCipherIO class
- class BlockCipher cipher => BlockCipherIO cipher where
- ecbEncryptMutable :: cipher -> PtrDest -> PtrSource -> BufferLength -> IO ()
- ecbDecryptMutable :: cipher -> PtrDest -> PtrSource -> BufferLength -> IO ()
- cbcEncryptMutable :: cipher -> PtrIV -> PtrDest -> PtrSource -> BufferLength -> IO ()
- cbcDecryptMutable :: cipher -> PtrIV -> PtrDest -> PtrSource -> BufferLength -> IO ()
- type BufferLength = Word32
- type PtrDest = Ptr Word8
- type PtrSource = Ptr Word8
- type PtrIV = Ptr Word8
- onBlock :: BlockCipherIO cipher => cipher -> (ByteString -> ByteString) -> PtrDest -> PtrSource -> BufferLength -> IO ()
Documentation
class BlockCipher cipher => BlockCipherIO cipher whereSource
Symmetric block cipher class, mutable API
ecbEncryptMutable :: cipher -> PtrDest -> PtrSource -> BufferLength -> IO ()Source
Encrypt using the ECB mode.
input need to be a multiple of the blocksize
ecbDecryptMutable :: cipher -> PtrDest -> PtrSource -> BufferLength -> IO ()Source
Decrypt using the ECB mode.
input need to be a multiple of the blocksize
cbcEncryptMutable :: cipher -> PtrIV -> PtrDest -> PtrSource -> BufferLength -> IO ()Source
encrypt using the CBC mode.
input need to be a multiple of the blocksize
cbcDecryptMutable :: cipher -> PtrIV -> PtrDest -> PtrSource -> BufferLength -> IO ()Source
decrypt using the CBC mode.
input need to be a multiple of the blocksize
type BufferLength = Word32Source
Length of the pointed data
onBlock :: BlockCipherIO cipher => cipher -> (ByteString -> ByteString) -> PtrDest -> PtrSource -> BufferLength -> IO ()Source
Helper to use a purer interface