cryptoids 0.1.0 → 0.1.0.1
raw patch · 3 files changed
+12/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- changes.md +3/−0
- cryptoids.cabal +1/−1
- src/Data/CryptoID/Poly.hs +8/−9
changes.md view
@@ -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'
cryptoids.cabal view
@@ -1,5 +1,5 @@ name: cryptoids-version: 0.1.0+version: 0.1.0.1 cabal-version: >=1.10 build-type: Simple license: BSD3
src/Data/CryptoID/Poly.hs view
@@ -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 @@ 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 @@ 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