aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-06-08 15:16:14 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-06-08 15:16:17 +0300
commit90c5827e68d1a874802513efc45dc913d50a5607 (patch)
tree6f5bb11793c333f87749e46f91a7bd44d8c248ba
parent46e868e60e7fbd766ffa4a0d309b0e43d3837df7 (diff)
downloadzerobin-90c5827e68d1a874802513efc45dc913d50a5607.tar.gz
AES256 -> AES128
With recent `cryptonite` I was getting the `CryptoError_KeySizeInvalid` exception. Probably, related to https://github.com/haskell-crypto/cryptonite/commit/f5efdee75b44051bc94cb4714f310609e021093a where key size validation was added.
-rw-r--r--src/Web/ZeroBin/SJCL.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Web/ZeroBin/SJCL.hs b/src/Web/ZeroBin/SJCL.hs
index 60e8737..a27ecb7 100644
--- a/src/Web/ZeroBin/SJCL.hs
+++ b/src/Web/ZeroBin/SJCL.hs
@@ -14,7 +14,7 @@ module Web.ZeroBin.SJCL (
encrypt
) where
-import Crypto.Cipher.AES (AES256)
+import Crypto.Cipher.AES (AES128)
import Crypto.Cipher.Types (ivAdd, blockSize, cipherInit, ecbEncrypt, ctrCombine, makeIV)
import Crypto.Error (throwCryptoErrorIO)
import Crypto.Hash.Algorithms (SHA256(..))
@@ -43,7 +43,7 @@ data Content = Content {
instance JSON.ToJSON Content where
toJSON = JSON.genericToJSON JSON.defaultOptions
-makeCipher :: ByteString -> IO AES256
+makeCipher :: ByteString -> IO AES128
makeCipher = throwCryptoErrorIO . cipherInit
-- https://github.com/bitwiseshiftleft/sjcl/blob/master/core/pbkdf2.js