Safe Haskell | None |
---|---|
Language | Haskell2010 |
Expose the library's public interface.
Synopsis
- data Share = Share {
- shareSequenceNumber :: Word64
- shareRootHash :: ByteString
- shareIV :: SDMF_IV
- shareTotalShares :: Word8
- shareRequiredShares :: Word8
- shareSegmentSize :: Word64
- shareDataLength :: Word64
- shareVerificationKey :: Verification
- shareSignature :: ByteString
- shareHashChain :: HashChain
- shareBlockHashTree :: MerkleTree ByteString SHA256d
- shareData :: ByteString
- shareEncryptedPrivateKey :: ByteString
- data Writer = Writer {}
- data Reader = Reader {}
- data Verifier = Verifier {}
- data SDMF
- pCapability :: Parser SDMF
- pVerifier :: Parser Verifier
- pReader :: Parser Reader
- pWriter :: Parser Writer
- dangerRealShow :: SDMF -> Text
- encode :: (MonadFail m, MonadIO m, MonadRandom m) => KeyPair -> SDMF_IV -> Word64 -> Word16 -> Word16 -> ByteString -> m ([Share], Writer)
- decode :: (MonadFail m, MonadIO m) => Reader -> [(Word16, Share)] -> m ByteString
- randomIV :: MonadRandom m => m (Maybe SDMF_IV)
- encrypt :: KeyPair -> SDMF_IV -> ByteString -> ByteString
- decrypt :: Read -> SDMF_IV -> ByteString -> ByteString
Documentation
Structured representation of a single version SDMF share.
See Tahoe-LAFS "mutable" specification document, section title "SDMF Slot Format".
Since the only version of SDMF that is specified uses version 0, this implicitly represents a version 0 SDMF. If new versions of SDMF are specified then new constructors may be added.
Share | |
|
Instances
A write capability for an SDMF object.
A read capability for an SDMF object.
A verify capability for an SDMF object.
Any kind of SDMF capability.
pCapability :: Parser SDMF Source #
A parser for any kind of SDMF capability type.
dangerRealShow :: SDMF -> Text Source #
Deprecated: Use the ConfidentialShowable instance
Show an SDMF capability, including all secret information.
encode :: (MonadFail m, MonadIO m, MonadRandom m) => KeyPair -> SDMF_IV -> Word64 -> Word16 -> Word16 -> ByteString -> m ([Share], Writer) Source #
Given a pre-determined key pair and sequence number, encode some ciphertext into a collection of SDMF shares.
A key pair *uniquely identifies* a "slot" (the storage location for the shares). Thus they cannot be re-used for "different" data. Any shares created with a given key pair are part of the same logical data object.
decode :: (MonadFail m, MonadIO m) => Reader -> [(Word16, Share)] -> m ByteString Source #
Decode some SDMF shares to recover the original ciphertext.
TODO: Use the read capability to verify the shares were constructed with information from the matching write capability.
randomIV :: MonadRandom m => m (Maybe SDMF_IV) Source #
Randomly generate a new IV suitable for use with the block cipher used by SDMF.
encrypt :: KeyPair -> SDMF_IV -> ByteString -> ByteString Source #
Encrypt plaintext bytes according to the scheme used for SDMF share construction.
decrypt :: Read -> SDMF_IV -> ByteString -> ByteString Source #
Decrypt ciphertext bytes according to the scheme used for SDMF share construction.