aboutsummaryrefslogtreecommitdiff
path: root/src/BTLS
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@google.com>2018-09-04 12:27:10 -0500
committerGravatar Benjamin Barenblat <bbaren@google.com>2018-09-04 12:27:10 -0500
commit67b5043c69648f0e4b9d9138a03cce154c20e38d (patch)
tree9c73bceb27205c112fe97fad14eae6683e2d8d41 /src/BTLS
parentfadd7434be6bfc11483dc188aa6e4267e01d5c40 (diff)
Documentation improvements
Diffstat (limited to 'src/BTLS')
-rw-r--r--src/BTLS/Result.hs1
-rw-r--r--src/BTLS/Types.hs6
2 files changed, 6 insertions, 1 deletions
diff --git a/src/BTLS/Result.hs b/src/BTLS/Result.hs
index 63626bd..4f0238a 100644
--- a/src/BTLS/Result.hs
+++ b/src/BTLS/Result.hs
@@ -40,6 +40,7 @@ requireSuccess r = when (r /= 1) $ ioError (userError "BoringSSL failure")
type Result = Either [Error]
+-- | An error which occurred during processing.
data Error = Error
{ err :: Err
, file :: FilePath
diff --git a/src/BTLS/Types.hs b/src/BTLS/Types.hs
index 06b5173..44b29bc 100644
--- a/src/BTLS/Types.hs
+++ b/src/BTLS/Types.hs
@@ -31,7 +31,10 @@ newtype Algorithm = Algorithm (Ptr EVPMD)
newtype AssociatedData = AssociatedData ByteString
deriving (Eq, Ord, Show)
--- | The result of a hash operation.
+-- | The result of a hash operation. Equality comparisons on this type are
+-- variable-time.
+--
+-- The 'Show' instance for this type displays the digest as a hexadecimal string.
newtype Digest = Digest ByteString
deriving (Eq, Ord)
@@ -46,6 +49,7 @@ instance Show Digest where
newtype Salt = Salt ByteString
deriving (Eq, Ord, Show)
+-- | A special value used to request that no salt be used.
noSalt :: Salt
noSalt = Salt ByteString.empty