diff options
author | joe <joe@jerkface.net> | 2014-01-28 00:06:56 -0500 |
---|---|---|
committer | joe <joe@jerkface.net> | 2014-01-28 00:06:56 -0500 |
commit | 6a09ab840ecbcfc53394b102028efacadc0f68f3 (patch) | |
tree | d0c77c5c771d39e29ab2a4d7e897752a1da24381 | |
parent | 3146e835f11acd05fa905f56e6c365023f6ae0d6 (diff) |
Fixed wheezy build.
-rw-r--r-- | Crypto/Cipher/ThomasToVincent.hs | 11 | ||||
-rw-r--r-- | cipher-cast5.cabal | 6 |
2 files changed, 14 insertions, 3 deletions
diff --git a/Crypto/Cipher/ThomasToVincent.hs b/Crypto/Cipher/ThomasToVincent.hs index 85b0875..11cede3 100644 --- a/Crypto/Cipher/ThomasToVincent.hs +++ b/Crypto/Cipher/ThomasToVincent.hs | |||
@@ -1,3 +1,4 @@ | |||
1 | {-# LANGUAGE CPP #-} | ||
1 | {-# LANGUAGE ScopedTypeVariables #-} | 2 | {-# LANGUAGE ScopedTypeVariables #-} |
2 | module Crypto.Cipher.ThomasToVincent where | 3 | module Crypto.Cipher.ThomasToVincent where |
3 | 4 | ||
@@ -6,6 +7,10 @@ import Data.Byteable | |||
6 | 7 | ||
7 | import Data.Tagged | 8 | import Data.Tagged |
8 | import qualified Crypto.Classes as Thomas | 9 | import qualified Crypto.Classes as Thomas |
10 | #if ! MIN_VERSION_crypto_api(0,11,0) | ||
11 | import qualified Crypto.Modes as Thomas | ||
12 | #endif | ||
13 | |||
9 | 14 | ||
10 | newtype ThomasToVincent b = ThomasToVincent b | 15 | newtype ThomasToVincent b = ThomasToVincent b |
11 | 16 | ||
@@ -19,6 +24,12 @@ instance Thomas.BlockCipher b => Cipher (ThomasToVincent b) where | |||
19 | instance Thomas.BlockCipher b => BlockCipher (ThomasToVincent b) where | 24 | instance Thomas.BlockCipher b => BlockCipher (ThomasToVincent b) where |
20 | blockSize _ = bitlen `div` 8 | 25 | blockSize _ = bitlen `div` 8 |
21 | where Tagged bitlen = Thomas.blockSize :: Tagged b Int | 26 | where Tagged bitlen = Thomas.blockSize :: Tagged b Int |
27 | #if ! MIN_VERSION_crypto_api(0,11,0) | ||
28 | ecbEncrypt (ThomasToVincent k) = Thomas.ecb' k | ||
29 | ecbDecrypt (ThomasToVincent k) = Thomas.unEcb' k | ||
30 | #else | ||
22 | ecbEncrypt (ThomasToVincent k) = Thomas.ecb k | 31 | ecbEncrypt (ThomasToVincent k) = Thomas.ecb k |
23 | ecbDecrypt (ThomasToVincent k) = Thomas.unEcb k | 32 | ecbDecrypt (ThomasToVincent k) = Thomas.unEcb k |
33 | #endif | ||
34 | |||
24 | 35 | ||
diff --git a/cipher-cast5.cabal b/cipher-cast5.cabal index fd44ea3..d5f3154 100644 --- a/cipher-cast5.cabal +++ b/cipher-cast5.cabal | |||
@@ -18,8 +18,8 @@ library | |||
18 | exposed-modules: Crypto.Cipher.Feistel, Crypto.Cipher.Cast5, | 18 | exposed-modules: Crypto.Cipher.Feistel, Crypto.Cipher.Cast5, |
19 | Crypto.Cipher.SBox, Crypto.Cipher.ThomasToVincent | 19 | Crypto.Cipher.SBox, Crypto.Cipher.ThomasToVincent |
20 | -- other-modules: | 20 | -- other-modules: |
21 | build-depends: base >= 4.5, bytestring >=0.9, binary >=0.5.1.1, cpu ==0.1.*, | 21 | build-depends: base >= 4.5, bytestring >=0.9, binary >=0.5.1.0, cpu ==0.1.*, |
22 | vector >=0.9, crypto-api ==0.12.*, cereal ==0.3.*, | 22 | vector >=0.9, crypto-api >=0.10.2, cereal ==0.3.*, |
23 | tagged ==0.6.*, template-haskell >=2.7, | 23 | tagged >=0.4.2.1, template-haskell >=2.7, |
24 | ghc-prim >= 0.2, primitive >= 0.4, crypto-cipher-types, | 24 | ghc-prim >= 0.2, primitive >= 0.4, crypto-cipher-types, |
25 | byteable | 25 | byteable |