Correct documentation mistakes
This commit is contained in:
parent
aa2129e617
commit
3fd3fe7a73
@ -1,3 +1,6 @@
|
||||
# 0.1.0.1
|
||||
- Correct mistakes in the documentation
|
||||
|
||||
# 0.1.0
|
||||
- Switch to using 'MonadThrow' instead of 'MonadError'
|
||||
- Introduce 'readKeyFile'
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
name: cryptoids
|
||||
version: 0.1.0
|
||||
version: 0.1.0.1
|
||||
synopsis: Reversable and secure encoding of object ids as a bytestring
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
|
||||
@ -4,14 +4,13 @@
|
||||
Description: Encryption of bytestrings using a type level nonce for determinism
|
||||
License: BSD3
|
||||
|
||||
Given a value of a serializable type (like 'Int') we perform serialization and
|
||||
compute a cryptographic hash of the associated namespace (carried as a phantom
|
||||
type of kind 'Symbol').
|
||||
The serialized payload is then encrypted using the symmetric cipher in CBC mode
|
||||
using the hashed namespace as an initialization vector (IV).
|
||||
Given a strict 'ByteString' we compute a cryptographic hash of the associated
|
||||
namespace (carried as a phantom type of kind 'Symbol').
|
||||
The payload is then encrypted using the symmetric cipher in CBC mode using the
|
||||
hashed namespace as an initialization vector (IV).
|
||||
|
||||
The probability of detecting a namespace mismatch is thus \(1 - 2^{128-l}\)
|
||||
where \(l\) is the length of the serialized payload.
|
||||
The probability of detecting a namespace mismatch is thus the density of valid
|
||||
payloads within all 'ByteString's of the correct length.
|
||||
-}
|
||||
module Data.CryptoID.Poly
|
||||
( CryptoID(..)
|
||||
@ -184,7 +183,7 @@ namespace' p = case makeIV namespaceHash of
|
||||
cryptoFailable :: MonadThrow m => CryptoFailable a -> m a
|
||||
cryptoFailable = either (throwM . AlgorithmError) return . eitherCryptoError
|
||||
|
||||
-- | Encrypt an arbitrary serializable value
|
||||
-- | Encrypt a serialized value
|
||||
encrypt :: forall m namespace.
|
||||
( KnownSymbol namespace
|
||||
, MonadThrow m
|
||||
@ -195,7 +194,7 @@ encrypt (keyMaterial -> key) plaintext = do
|
||||
return . CryptoID . cbcEncrypt cipher namespace $ pad (blockSize cipher) plaintext
|
||||
|
||||
|
||||
-- | Decrypt an arbitrary serializable value
|
||||
-- | Decrypt a serialized value
|
||||
decrypt :: forall m namespace.
|
||||
( KnownSymbol namespace
|
||||
, MonadThrow m
|
||||
|
||||
Loading…
Reference in New Issue
Block a user