From 21c4c1befbecf026968700780af248a59b2df723 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Wed, 8 Apr 2015 20:41:34 +0100 Subject: [PATCH] add an instance of Eq for IV --- Crypto/Cipher/Types/Block.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Crypto/Cipher/Types/Block.hs b/Crypto/Cipher/Types/Block.hs index 917287b..c9bd869 100644 --- a/Crypto/Cipher/Types/Block.hs +++ b/Crypto/Cipher/Types/Block.hs @@ -52,6 +52,8 @@ data IV c = forall byteArray . ByteArray byteArray => IV byteArray instance BlockCipher c => ByteArrayAccess (IV c) where withByteArray (IV z) f = withByteArray z f byteArrayLength (IV z) = byteArrayLength z +instance Eq (IV c) where + (IV a) == (IV b) = byteArrayEq a b type XTS cipher = (cipher, cipher) -> IV cipher -- ^ Usually represent the Data Unit (e.g. disk sector)