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 /Crypto | |
parent | 3146e835f11acd05fa905f56e6c365023f6ae0d6 (diff) |
Fixed wheezy build.
Diffstat (limited to 'Crypto')
-rw-r--r-- | Crypto/Cipher/ThomasToVincent.hs | 11 |
1 files changed, 11 insertions, 0 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 | ||