tahoe-ssk-0.3.0.0: An implementation of the Tahoe-LAFS SSK cryptographic protocols
Safe HaskellNone
LanguageHaskell2010

Tahoe.SDMF

Description

Expose the library's public interface.

Synopsis

Documentation

data Share Source #

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.

Constructors

Share 

Fields

Instances

Instances details
Eq Share Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Share

Methods

(==) :: Share -> Share -> Bool #

(/=) :: Share -> Share -> Bool #

Show Share Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Share

Methods

showsPrec :: Int -> Share -> ShowS #

show :: Share -> String #

showList :: [Share] -> ShowS #

Binary Share Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Share

Methods

put :: Share -> Put #

get :: Get Share #

putList :: [Share] -> Put #

data Writer Source #

A write capability for an SDMF object.

Constructors

Writer 

Instances

Instances details
Eq Writer Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

Methods

(==) :: Writer -> Writer -> Bool #

(/=) :: Writer -> Writer -> Bool #

Ord Writer Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

Show Writer Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

ConfidentialShowable Writer Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

data Reader Source #

A read capability for an SDMF object.

Constructors

Reader 

Instances

Instances details
Eq Reader Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

Methods

(==) :: Reader -> Reader -> Bool #

(/=) :: Reader -> Reader -> Bool #

Ord Reader Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

Show Reader Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

ConfidentialShowable Reader Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

data Verifier Source #

A verify capability for an SDMF object.

data SDMF Source #

Any kind of SDMF capability.

Instances

Instances details
Eq SDMF Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

Methods

(==) :: SDMF -> SDMF -> Bool #

(/=) :: SDMF -> SDMF -> Bool #

Show SDMF Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

Methods

showsPrec :: Int -> SDMF -> ShowS #

show :: SDMF -> String #

showList :: [SDMF] -> ShowS #

ConfidentialShowable SDMF Source # 
Instance details

Defined in Tahoe.SDMF.Internal.Capability

pCapability :: Parser SDMF Source #

A parser for any kind of SDMF capability type.

pVerifier :: Parser Verifier Source #

A parser for an SDMF verifier capability.

pReader :: Parser Reader Source #

A parser for an SDMF reader capability.

pWriter :: Parser Writer Source #

A parser for an SDMF writer capability.

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.