Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support the encryption requirements of CHK.
Synopsis
- encrypt :: (BlockCipher cipher, ByteArray ba) => cipher -> ba -> ba
- encryptLazy :: forall cipher. BlockCipher cipher => cipher -> ByteString -> ByteString
- decrypt :: (BlockCipher cipher, ByteArray ba) => cipher -> ba -> ba
- decryptLazy :: BlockCipher cipher => cipher -> ByteString -> ByteString
Documentation
encrypt :: (BlockCipher cipher, ByteArray ba) => cipher -> ba -> ba Source #
CTR-mode encrypt a byte string using some block cipher.
When used for CHKv1 or CHKv2 the block cipher should be AES128.
This replaces allmydata.immutable.upload.EncryptAnUploadable
The only noteworthy piece here is that encryption starts with the zero IV.
encryptLazy :: forall cipher. BlockCipher cipher => cipher -> ByteString -> ByteString Source #
Like encrypt but operate on lazy bytestrings.
decrypt :: (BlockCipher cipher, ByteArray ba) => cipher -> ba -> ba Source #
AES128-CTR decrypt a byte string in the manner used by CHK.
decryptLazy :: BlockCipher cipher => cipher -> ByteString -> ByteString Source #
Like decrypt but operate on lazy bytestrings.