Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- zfec :: Int -> Int -> ByteString -> IO [ByteString]
- zunfec :: Int -> Int -> [(Int, ByteString)] -> IO ByteString
- encode :: Key AES128 -> Parameters -> ByteString -> IO ([Share], Reader)
- decode :: Reader -> [(Int, Share)] -> IO (Either DecodeError ByteString)
- padCiphertext :: Required -> ByteString -> ByteString
- segmentCiphertext :: Parameters -> ByteString -> [ByteString]
- data DecodeError
- = SizeOverflow
- | NotEnoughShares
- | IntegrityError {
- integrityErrorInvalidShares :: [(Int, Share, InvalidShare)]
- | BlockHashError
- | CiphertextHashError
Documentation
:: Int | The number of outputs that will be required to reverse the encoding.
Also known as |
-> Int | The total number of outputs to produce. Also known as |
-> ByteString | Application data to divide into encoding inputs. |
-> IO [ByteString] |
|
Erasure encode some bytes using ZFEC.
:: Int | The |
-> Int | The |
-> [(Int, ByteString)] | The encoding outputs annotated with their position (or "share number"). |
-> IO ByteString | The bytes which were originally encoded. |
Erasure decode some bytes using ZFEC.
:: Key AES128 | The encryption/decryption key. |
-> Parameters | The ZFEC parameters for this encoding. This determines how many shares will come out of this function. |
-> ByteString | The data to encode. This is typically ciphertext. |
-> IO ([Share], Reader) | An IO which can be evaluated to get the encoded share data and the
read capability. The number of Shares will equal the |
Encode some application data (typically ciphertext, but this function only weakly assumes this is the case) into some CHK shares.
This replaces much of allmydata.immutable.encode.
:: Reader | The read capability for the application data. |
-> [(Int, Share)] | At least as many shares as are required to erasure decode the ciphertext. |
-> IO (Either DecodeError ByteString) | An action that results in Right of the ciphertext contained by the shares if it is possible to recover it, or Left with information about why it is not. |
Decode some CHK shares to recover some application data. This is roughly
the inverse of `encode`
.
padCiphertext :: Required -> ByteString -> ByteString Source #
:: Parameters | The encoding parameters which determine how to split the ciphertext. |
-> ByteString | The ciphertext. |
-> [ByteString] | The segments. |
Split a full ciphertext string into the separate ciphertext segments required by most of CHK encoding.
data DecodeError Source #
A problem was encountered during decoding.
SizeOverflow | The size of the data is greater than the limits imposed by this implementation. |
NotEnoughShares | There weren't enough shares supplied to attempt erasure decoding. |
IntegrityError | After discarding shares for which the fingerprint from the read | capability did not match the URI extension block, there weren't | enough shares left to attempt erasure decoding. |
| |
BlockHashError | The hash of one or more blocks did not match the expected value. |
CiphertextHashError | The hash of one or more ciphertext segments did not match the expected value. |
Instances
Eq DecodeError Source # | |
Defined in Tahoe.CHK (==) :: DecodeError -> DecodeError -> Bool # (/=) :: DecodeError -> DecodeError -> Bool # | |
Ord DecodeError Source # | |
Defined in Tahoe.CHK compare :: DecodeError -> DecodeError -> Ordering # (<) :: DecodeError -> DecodeError -> Bool # (<=) :: DecodeError -> DecodeError -> Bool # (>) :: DecodeError -> DecodeError -> Bool # (>=) :: DecodeError -> DecodeError -> Bool # max :: DecodeError -> DecodeError -> DecodeError # min :: DecodeError -> DecodeError -> DecodeError # | |
Show DecodeError Source # | |
Defined in Tahoe.CHK showsPrec :: Int -> DecodeError -> ShowS # show :: DecodeError -> String # showList :: [DecodeError] -> ShowS # |