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

Tahoe.CHK.SHA256d

Synopsis

Documentation

newtype Digest' a Source #

A newtype wrapper around Digest which comes with the string interpretation Tahoe-LAFS is accustomed to (lowercase base32 rather than lowercase base16), as well as a ToExpr instance for participation in nice diff computation.

Constructors

Digest' (Digest a) 

Instances

Instances details
Eq (Digest' a) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

(==) :: Digest' a -> Digest' a -> Bool #

(/=) :: Digest' a -> Digest' a -> Bool #

Ord (Digest' a) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

compare :: Digest' a -> Digest' a -> Ordering #

(<) :: Digest' a -> Digest' a -> Bool #

(<=) :: Digest' a -> Digest' a -> Bool #

(>) :: Digest' a -> Digest' a -> Bool #

(>=) :: Digest' a -> Digest' a -> Bool #

max :: Digest' a -> Digest' a -> Digest' a #

min :: Digest' a -> Digest' a -> Digest' a #

HashAlgorithm hash => Show (Digest' hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

showsPrec :: Int -> Digest' hash -> ShowS #

show :: Digest' hash -> String #

showList :: [Digest' hash] -> ShowS #

HashAlgorithm hash => IsString (Digest' hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

fromString :: String -> Digest' hash #

ByteArrayAccess (Digest' hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

length :: Digest' hash -> Int #

withByteArray :: Digest' hash -> (Ptr p -> IO a) -> IO a #

copyByteArrayToPtr :: Digest' hash -> Ptr p -> IO () #

ToExpr (Digest' a) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

toExpr :: Digest' a -> Expr #

listToExpr :: [Digest' a] -> Expr #

zero :: forall hash. HashAlgorithm hash => Digest' hash Source #

The all-zero digest value at a specific hash algorithm.

data DoubleHash hash Source #

A hash algorithm which computes its digest using the parameterized hash algorithm and then computes a digest of _that_ digest with the same hash algorithm.

Constructors

DoubleHash 

Instances

Instances details
Data hash => Data (DoubleHash hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> DoubleHash hash -> c (DoubleHash hash) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (DoubleHash hash) #

toConstr :: DoubleHash hash -> Constr #

dataTypeOf :: DoubleHash hash -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (DoubleHash hash)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (DoubleHash hash)) #

gmapT :: (forall b. Data b => b -> b) -> DoubleHash hash -> DoubleHash hash #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> DoubleHash hash -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> DoubleHash hash -> r #

gmapQ :: (forall d. Data d => d -> u) -> DoubleHash hash -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> DoubleHash hash -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> DoubleHash hash -> m (DoubleHash hash) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> DoubleHash hash -> m (DoubleHash hash) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> DoubleHash hash -> m (DoubleHash hash) #

Show hash => Show (DoubleHash hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Methods

showsPrec :: Int -> DoubleHash hash -> ShowS #

show :: DoubleHash hash -> String #

showList :: [DoubleHash hash] -> ShowS #

HashAlgorithm hash => HashAlgorithm (DoubleHash hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

Associated Types

type HashBlockSize (DoubleHash hash) :: Nat #

type HashDigestSize (DoubleHash hash) :: Nat #

type HashInternalContextSize (DoubleHash hash) :: Nat #

type HashInternalContextSize (DoubleHash hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

type HashDigestSize (DoubleHash hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

type HashBlockSize (DoubleHash hash) Source # 
Instance details

Defined in Tahoe.CHK.SHA256d

type SHA256d = DoubleHash SHA256 Source #

The double SHA256 hash algorithm.

toBytes :: ByteArrayAccess a => a -> ByteString Source #

Extract the bytes from a value like a Digest hash`.

digestPtrToByteString :: forall hash. HashAlgorithm hash => Ptr (Digest hash) -> IO ByteString Source #

Read the digest bytes out of a pointer to a Digest. This uses some coerce trickery. I hope it's not too broken.