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

Tahoe.CHK.Share

Description

A share is a single data object comprising some erasure-encoded data and some cryptographic hashes which allow certain determinations to be made about that that data. One or more shares can be interpreted together, typically to recover a particular ciphertext object.

This modules exposes a structured representation of the share object along with an encoder to and decoder from the canonical serialized representation.

Synopsis

Documentation

type Crypttext = ByteString Source #

A byte string of encrypted data.

data Share Source #

Structured representation of a single CHK share.

Constructors

Share 

Fields

Instances

Instances details
Eq Share Source # 
Instance details

Defined in Tahoe.CHK.Share

Methods

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

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

Ord Share Source # 
Instance details

Defined in Tahoe.CHK.Share

Methods

compare :: Share -> Share -> Ordering #

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

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

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

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

max :: Share -> Share -> Share #

min :: Share -> Share -> Share #

Show Share Source # 
Instance details

Defined in Tahoe.CHK.Share

Methods

showsPrec :: Int -> Share -> ShowS #

show :: Share -> String #

showList :: [Share] -> ShowS #

Generic Share Source # 
Instance details

Defined in Tahoe.CHK.Share

Associated Types

type Rep Share :: Type -> Type #

Methods

from :: Share -> Rep Share x #

to :: Rep Share x -> Share #

Binary Share Source # 
Instance details

Defined in Tahoe.CHK.Share

Methods

put :: Share -> Put #

get :: Get Share #

putList :: [Share] -> Put #

ToExpr Share Source # 
Instance details

Defined in Tahoe.CHK.Share

Methods

toExpr :: Share -> Expr #

listToExpr :: [Share] -> Expr #

type Rep Share Source # 
Instance details

Defined in Tahoe.CHK.Share

serializeNeededShares :: HashAlgorithm hash => [(ShareNum, Digest' hash)] -> ByteString Source #

Serialize the list of (share number, block tree root hash) pairs for inclusion in the serialized form of a Share. The inverse of unserializeNeededShares.

unserializeNeededShares :: forall hash. HashAlgorithm hash => ByteString -> Maybe [(ShareNum, Digest' hash)] Source #

Unserialize a a list of (share number, block tree root hash) pairs from their form in a serialized Share. The inverse of serializeNeededShares.

word64To4BytesPartial :: Word64 -> ByteString Source #

Serialize a Word64 to 4 bytes or throw an exception if the value can not fit.