Fix decryption
This commit is contained in:
parent
2518872872
commit
e5d6c550a2
@ -1,3 +1,6 @@
|
|||||||
|
# 1.3.0.0
|
||||||
|
- Fix decryption
|
||||||
|
|
||||||
# 1.2.0.0
|
# 1.2.0.0
|
||||||
- Pad plaintext before encryption, allowing encryption of payloads shorter than 128 bits
|
- Pad plaintext before encryption, allowing encryption of payloads shorter than 128 bits
|
||||||
|
|
||||||
|
|||||||
@ -66,9 +66,4 @@ decrypt :: forall a m namespace.
|
|||||||
, Binary a
|
, Binary a
|
||||||
, MonadThrow m
|
, MonadThrow m
|
||||||
) => CryptoIDKey -> CryptoUUID namespace -> m a
|
) => CryptoIDKey -> CryptoUUID namespace -> m a
|
||||||
decrypt = Poly.decrypt $ check . decodeOrFail . toByteString
|
decrypt = Poly.decrypt $ return . Lazy.ByteString.toStrict . toByteString
|
||||||
where
|
|
||||||
check (Left _) = throwM DeserializationError
|
|
||||||
check (Right (rem, _, res))
|
|
||||||
| Lazy.ByteString.all (== 0) rem = return res
|
|
||||||
| otherwise = throwM InvalidNamespaceDetected
|
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
name: uuid-crypto
|
name: uuid-crypto
|
||||||
version: 1.2.0.0
|
version: 1.3.0.0
|
||||||
synopsis: Reversable and secure encoding of object ids as uuids
|
synopsis: Reversable and secure encoding of object ids as uuids
|
||||||
license: BSD3
|
license: BSD3
|
||||||
license-file: LICENSE
|
license-file: LICENSE
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user