add an instance of Eq for IV

This commit is contained in:
Vincent Hanquez 2015-04-08 20:41:34 +01:00
parent 28e64ec8d3
commit 21c4c1befb

View File

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