1 diff --git a/Crypto/KDF/Argon2.hs b/Crypto/KDF/Argon2.hs
2 index 044ba00..31dc6f1 100644
3 --- a/Crypto/KDF/Argon2.hs
4 +++ b/Crypto/KDF/Argon2.hs
6 -- File started from Argon2.hs, from Oliver Charles
7 -- at https://github.com/ocharles/argon2
9 +{-# LANGUAGE DataKinds #-}
10 module Crypto.KDF.Argon2
13 @@ -32,6 +33,7 @@ import Control.Monad (when)
19 -- | Which variant of Argon2 to use. You should choose the variant that is most
20 -- applicable to your intention to hash inputs.
21 @@ -100,33 +102,12 @@ defaultOptions =
24 hash :: (ByteArrayAccess password, ByteArrayAccess salt, ByteArray out)
26 + => [Proxy "cryptonite:Crypto.KDF.Argon2.hash is known to be broken on this architecture. See https://github.com/haskell-crypto/cryptonite/issues/360"]
31 -hash options password salt outLen
32 - | saltLen < saltMinLength = CryptoFailed CryptoError_SaltTooSmall
33 - | outLen < outputMinLength = CryptoFailed CryptoError_OutputLengthTooSmall
34 - | outLen > outputMaxLength = CryptoFailed CryptoError_OutputLengthTooBig
35 - | otherwise = CryptoPassed $ B.allocAndFreeze outLen $ \out -> do
36 - res <- B.withByteArray password $ \pPass ->
37 - B.withByteArray salt $ \pSalt ->
38 - argon2_hash (iterations options)
40 - (parallelism options)
42 - (csizeOfInt passwordLen)
44 - (csizeOfInt saltLen)
47 - (cOfVariant $ variant options)
48 - (cOfVersion $ version options)
49 - when (res /= 0) $ error "argon2: hash: internal error"
51 - saltLen = B.length salt
52 - passwordLen = B.length password
53 +hash options password salt outLen = error "cryptonite:Crypto.KDF.Argon2.hash is known to be broken on this architecture. See https://github.com/haskell-crypto/cryptonite/issues/360"
57 diff --git a/tests/KAT_Argon2.hs b/tests/KAT_Argon2.hs
58 index a347fc5..fdba079 100644
59 --- a/tests/KAT_Argon2.hs
60 +++ b/tests/KAT_Argon2.hs
61 @@ -32,7 +32,7 @@ kdfTests = zipWith toKDFTest is vectors
65 - (CryptoPassed (kdfResult v) @=? Argon2.hash (kdfOptions v) (kdfPass v) (kdfSalt v) (B.length $ kdfResult v))