[Blowfish] Stop using ecb{Encrypt,Decrypt}Legacy stop gap call.
This commit is contained in:
parent
d4213ca731
commit
f686733fc6
@ -50,8 +50,8 @@ instance Cipher CSTR where \
|
|||||||
}; \
|
}; \
|
||||||
instance BlockCipher CSTR where \
|
instance BlockCipher CSTR where \
|
||||||
{ blockSize _ = 8 \
|
{ blockSize _ = 8 \
|
||||||
; ecbEncrypt (CSTR bf) = ecbEncryptLegacy encrypt bf \
|
; ecbEncrypt (CSTR bf) = encrypt bf \
|
||||||
; ecbDecrypt (CSTR bf) = ecbDecryptLegacy decrypt bf \
|
; ecbDecrypt (CSTR bf) = decrypt bf \
|
||||||
};
|
};
|
||||||
|
|
||||||
INSTANCE_CIPHER(Blowfish64, "blowfish64", 8)
|
INSTANCE_CIPHER(Blowfish64, "blowfish64", 8)
|
||||||
|
|||||||
@ -14,8 +14,6 @@ module Crypto.Cipher.Types
|
|||||||
Cipher(..)
|
Cipher(..)
|
||||||
, BlockCipher(..)
|
, BlockCipher(..)
|
||||||
, BlockCipher128(..)
|
, BlockCipher128(..)
|
||||||
, ecbEncryptLegacy
|
|
||||||
, ecbDecryptLegacy
|
|
||||||
, StreamCipher(..)
|
, StreamCipher(..)
|
||||||
, DataUnitOffset
|
, DataUnitOffset
|
||||||
, KeySizeSpecifier(..)
|
, KeySizeSpecifier(..)
|
||||||
|
|||||||
@ -15,8 +15,6 @@ module Crypto.Cipher.Types.Block
|
|||||||
-- * BlockCipher
|
-- * BlockCipher
|
||||||
BlockCipher(..)
|
BlockCipher(..)
|
||||||
, BlockCipher128(..)
|
, BlockCipher128(..)
|
||||||
, ecbEncryptLegacy
|
|
||||||
, ecbDecryptLegacy
|
|
||||||
-- * initialization vector (IV)
|
-- * initialization vector (IV)
|
||||||
, IV(..)
|
, IV(..)
|
||||||
, makeIV
|
, makeIV
|
||||||
@ -115,18 +113,6 @@ class Cipher cipher => BlockCipher cipher where
|
|||||||
aeadInit :: Byteable iv => AEADMode -> cipher -> iv -> Maybe (AEAD cipher)
|
aeadInit :: Byteable iv => AEADMode -> cipher -> iv -> Maybe (AEAD cipher)
|
||||||
aeadInit _ _ _ = Nothing
|
aeadInit _ _ _ = Nothing
|
||||||
|
|
||||||
ecbEncryptLegacy :: ByteArray ba
|
|
||||||
=> (cipher -> ByteString -> ByteString)
|
|
||||||
-> cipher -> ba -> ba
|
|
||||||
ecbEncryptLegacy f cipher input =
|
|
||||||
byteArrayFromBS $ f cipher (byteArrayToBS input)
|
|
||||||
|
|
||||||
ecbDecryptLegacy :: ByteArray ba
|
|
||||||
=> (cipher -> ByteString -> ByteString)
|
|
||||||
-> cipher -> ba -> ba
|
|
||||||
ecbDecryptLegacy f cipher input =
|
|
||||||
byteArrayFromBS $ f cipher (byteArrayToBS input)
|
|
||||||
|
|
||||||
-- | class of block cipher with a 128 bits block size
|
-- | class of block cipher with a 128 bits block size
|
||||||
class BlockCipher cipher => BlockCipher128 cipher where
|
class BlockCipher cipher => BlockCipher128 cipher where
|
||||||
-- | encrypt using the XTS mode.
|
-- | encrypt using the XTS mode.
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user