diff --git a/uuid-crypto/changes.md b/uuid-crypto/changes.md index b4c879b..85329de 100644 --- a/uuid-crypto/changes.md +++ b/uuid-crypto/changes.md @@ -1,3 +1,6 @@ +# 1.3.0.0 + - Fix decryption + # 1.2.0.0 - Pad plaintext before encryption, allowing encryption of payloads shorter than 128 bits diff --git a/uuid-crypto/src/Data/UUID/Cryptographic.hs b/uuid-crypto/src/Data/UUID/Cryptographic.hs index 185b07d..f8d3e52 100644 --- a/uuid-crypto/src/Data/UUID/Cryptographic.hs +++ b/uuid-crypto/src/Data/UUID/Cryptographic.hs @@ -66,9 +66,4 @@ decrypt :: forall a m namespace. , Binary a , MonadThrow m ) => CryptoIDKey -> CryptoUUID namespace -> m a -decrypt = Poly.decrypt $ check . decodeOrFail . toByteString - where - check (Left _) = throwM DeserializationError - check (Right (rem, _, res)) - | Lazy.ByteString.all (== 0) rem = return res - | otherwise = throwM InvalidNamespaceDetected +decrypt = Poly.decrypt $ return . Lazy.ByteString.toStrict . toByteString diff --git a/uuid-crypto/uuid-crypto.cabal b/uuid-crypto/uuid-crypto.cabal index 110fd7b..a0334d5 100644 --- a/uuid-crypto/uuid-crypto.cabal +++ b/uuid-crypto/uuid-crypto.cabal @@ -1,5 +1,5 @@ name: uuid-crypto -version: 1.2.0.0 +version: 1.3.0.0 synopsis: Reversable and secure encoding of object ids as uuids license: BSD3 license-file: LICENSE