uuid-crypto 1.3.0.0 → 1.3.1.0
raw patch · 3 files changed
+13/−9 lines, 3 filesdep ~cryptoidsPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: cryptoids
API changes (from Hackage documentation)
Files
- changes.md +7/−0
- src/Data/UUID/Cryptographic.hs +4/−7
- uuid-crypto.cabal +2/−2
changes.md view
@@ -1,3 +1,10 @@+# 1.3.1.0+ - Fix documentation mistake+ - Bump @cryptoids@ to @0.4.0.*@++# 1.3.0.1+ - Fix documentation typo+ # 1.3.0.0 - Fix decryption
src/Data/UUID/Cryptographic.hs view
@@ -7,8 +7,8 @@ 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 a symmetric cipher in CBC-mode using the hashed namespace as an initialization vector (IV).+The serialized payload is then encrypted using a symmetric cipher in CBC mode+using the hashed namespace as an initialization vector (IV). Since the serialized payload is padded to the length of an UUID we can detect namespace mismatches by checking that all bytes expected to have been inserted@@ -44,16 +44,13 @@ -- | Encrypt an arbitrary serializable value -- -- We only expect to fail if the given value is not serialized in such a fashion--- that it fits within one 'CryptoCipher'-block.------ Larger values could likely not be contained wholly within 128 bits (the size--- of an 'UUID') in any case.+-- that it fits within 128 bits (the length of an 'UUID'). encrypt :: forall a m namespace. ( KnownSymbol namespace , Binary a , MonadThrow m ) => CryptoIDKey -> a -> m (CryptoUUID namespace)-encrypt = Poly.encrypt (Just 16) $ \str -> maybe (throwM $ CiphertextConversionFailed str) return . fromByteString $ Lazy.ByteString.fromStrict str+encrypt = Poly.encrypt (const . return $ Just 16) $ \str -> maybe (throwM $ CiphertextConversionFailed str) return . fromByteString $ Lazy.ByteString.fromStrict str -- | Decrypt an arbitrary serializable value
uuid-crypto.cabal view
@@ -1,5 +1,5 @@ name: uuid-crypto-version: 1.3.0.0+version: 1.3.1.0 cabal-version: >=1.10 build-type: Simple license: BSD3@@ -22,7 +22,7 @@ build-depends: base >=4.9 && <4.11, cryptoids-types ==0.0.0,- cryptoids ==0.3.0.*,+ cryptoids ==0.4.0.*, uuid >=1.3.13 && <1.4, binary >=0.8.3.0 && <0.9, bytestring >=0.10.8.1 && <0.11,