From b28109ecb4de4ccc45d2c2a3975a2bb2699a80d7 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Sat, 2 May 2015 15:43:49 +0100 Subject: [PATCH] [tests] re-enable poly1305 --- tests/Tests.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/Tests.hs b/tests/Tests.hs index fb77a8d..aeccc3a 100644 --- a/tests/Tests.hs +++ b/tests/Tests.hs @@ -2,12 +2,14 @@ module Main where import qualified Data.ByteString as B +import qualified Data.ByteString.Char8 as B () import Imports import qualified Crypto.Cipher.ChaCha as ChaCha import qualified Crypto.Cipher.Salsa as Salsa import qualified Crypto.MAC.Poly1305 as Poly1305 +import qualified Crypto.Internal.ByteArray as B (convert) import qualified KATHash import qualified KAT_HMAC @@ -66,19 +68,17 @@ tests = testGroup "cryptonite" [ testGroup "KAT" $ map (\(i,f) -> testCase (show (i :: Int)) f) $ zip [1..] $ map (\(r, k,i,e) -> salsaRunSimple e r k i) KATSalsa.vectors ] -{- , testGroup "Poly1305" [ testCase "V0" $ let key = "\x85\xd6\xbe\x78\x57\x55\x6d\x33\x7f\x44\x52\xfe\x42\xd5\x06\xa8\x01\x03\x80\x8a\xfb\x0d\xb2\xfd\x4a\xbf\xf6\xaf\x41\x49\xf5\x1b" :: ByteString - msg = "Cryptographic Forum Research Group" - tag = Poly1305.Auth "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9" - in tag @=? Poly1305.auth key msg + msg = "Cryptographic Forum Research Group" :: ByteString + tag = "\xa8\x06\x1d\xc1\x30\x51\x36\xc6\xc2\x2b\x8b\xaf\x0c\x01\x27\xa9" :: ByteString + in tag @=? B.convert (Poly1305.auth key msg) , testProperty "Chunking" $ \(Chunking chunkLen totalLen) -> let key = B.replicate 32 0 msg = B.pack $ take totalLen $ concat (replicate 10 [1..255]) in Poly1305.auth key msg == Poly1305.finalize (foldr (flip Poly1305.update) (Poly1305.initialize key) (chunks chunkLen msg)) ] --} , KATHash.tests , KAT_HMAC.tests , KAT_Curve25519.tests