Fix decryption

This commit is contained in:
Gregor Kleen 2017-10-11 00:06:34 +02:00
parent 2518872872
commit e5d6c550a2
3 changed files with 5 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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