tahoe-chk-0.2.0.0: The Tahoe-LAFS' Content-Hash-Key (CHK) cryptographic protocol.
Safe HaskellNone
LanguageHaskell2010

Tahoe.CHK.Encrypt

Description

Support the encryption requirements of CHK.

Synopsis

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.