From 507a8f8cea28b77dbbc3834c868debed6c38d195 Mon Sep 17 00:00:00 2001 From: Joachim Breitner Date: Thu, 27 Aug 2015 14:51:30 +0200 Subject: [PATCH] Use mkLE, not LE to make sure the conversion to little endian is actually happening. This fixes a test failure in ChaChaPoly1305. Fixes #31. --- Crypto/Cipher/ChaChaPoly1305.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Crypto/Cipher/ChaChaPoly1305.hs b/Crypto/Cipher/ChaChaPoly1305.hs index a2db972..cb16929 100644 --- a/Crypto/Cipher/ChaChaPoly1305.hs +++ b/Crypto/Cipher/ChaChaPoly1305.hs @@ -117,5 +117,5 @@ finalize :: State -> Poly1305.Auth finalize (State _ macState aadLength plainLength) = Poly1305.finalize $ Poly1305.updates macState [ pad16 plainLength - , either (error "finalize: internal error") id $ P.fill 16 (P.putStorable (LE aadLength) >> P.putStorable (LE plainLength)) + , either (error "finalize: internal error") id $ P.fill 16 (P.putStorable (toLE aadLength) >> P.putStorable (toLE plainLength)) ]