From 812b5d1aed0dc7a8c819714c1394198e1bfe65e2 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Thu, 19 Nov 2015 14:24:54 +0000 Subject: [PATCH] [blake2] uncapitalize the modules and types as it's not abbreviation. --- Crypto/Hash/Algorithms.hs | 16 ++++++++-------- Crypto/Hash/{BLAKE2b.hs => Blake2b.hs} | 14 +++++++------- Crypto/Hash/{BLAKE2bp.hs => Blake2bp.hs} | 14 +++++++------- Crypto/Hash/{BLAKE2s.hs => Blake2s.hs} | 14 +++++++------- Crypto/Hash/{BLAKE2sp.hs => Blake2sp.hs} | 14 +++++++------- cryptonite.cabal | 8 ++++---- gen/Gen.hs | 8 ++++---- tests/Hash.hs | 2 +- 8 files changed, 45 insertions(+), 45 deletions(-) rename Crypto/Hash/{BLAKE2b.hs => Blake2b.hs} (80%) rename Crypto/Hash/{BLAKE2bp.hs => Blake2bp.hs} (80%) rename Crypto/Hash/{BLAKE2s.hs => Blake2s.hs} (80%) rename Crypto/Hash/{BLAKE2sp.hs => Blake2sp.hs} (80%) diff --git a/Crypto/Hash/Algorithms.hs b/Crypto/Hash/Algorithms.hs index 216110d..d32b1a5 100644 --- a/Crypto/Hash/Algorithms.hs +++ b/Crypto/Hash/Algorithms.hs @@ -10,10 +10,10 @@ module Crypto.Hash.Algorithms ( HashAlgorithm -- * hash algorithms - , BLAKE2s_256(..) - , BLAKE2sp_256(..) - , BLAKE2b_512(..) - , BLAKE2bp_512(..) + , Blake2s_256(..) + , Blake2sp_256(..) + , Blake2b_512(..) + , Blake2bp_512(..) , MD2(..) , MD4(..) , MD5(..) @@ -44,10 +44,10 @@ module Crypto.Hash.Algorithms ) where import Crypto.Hash.Types (HashAlgorithm) -import Crypto.Hash.BLAKE2s -import Crypto.Hash.BLAKE2sp -import Crypto.Hash.BLAKE2b -import Crypto.Hash.BLAKE2bp +import Crypto.Hash.Blake2s +import Crypto.Hash.Blake2sp +import Crypto.Hash.Blake2b +import Crypto.Hash.Blake2bp import Crypto.Hash.MD2 import Crypto.Hash.MD4 import Crypto.Hash.MD5 diff --git a/Crypto/Hash/BLAKE2b.hs b/Crypto/Hash/Blake2b.hs similarity index 80% rename from Crypto/Hash/BLAKE2b.hs rename to Crypto/Hash/Blake2b.hs index 02e16ca..7ef8515 100644 --- a/Crypto/Hash/BLAKE2b.hs +++ b/Crypto/Hash/Blake2b.hs @@ -1,16 +1,16 @@ -- | --- Module : Crypto.Hash.BLAKE2b +-- Module : Crypto.Hash.Blake2b -- License : BSD-style -- Maintainer : Vincent Hanquez -- Stability : experimental -- Portability : unknown -- -- module containing the binding functions to work with the --- BLAKE2b cryptographic hash. +-- Blake2b cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} -module Crypto.Hash.BLAKE2b - ( BLAKE2b_512 (..) +module Crypto.Hash.Blake2b + ( Blake2b_512 (..) ) where import Crypto.Hash.Types @@ -18,11 +18,11 @@ import Foreign.Ptr (Ptr) import Data.Word (Word8, Word32) --- | BLAKE2b (512 bits) cryptographic hash algorithm -data BLAKE2b_512 = BLAKE2b_512 +-- | Blake2b (512 bits) cryptographic hash algorithm +data Blake2b_512 = Blake2b_512 deriving (Show) -instance HashAlgorithm BLAKE2b_512 where +instance HashAlgorithm Blake2b_512 where hashBlockSize _ = 128 hashDigestSize _ = 64 hashInternalContextSize _ = 361 diff --git a/Crypto/Hash/BLAKE2bp.hs b/Crypto/Hash/Blake2bp.hs similarity index 80% rename from Crypto/Hash/BLAKE2bp.hs rename to Crypto/Hash/Blake2bp.hs index 44fbd66..395c532 100644 --- a/Crypto/Hash/BLAKE2bp.hs +++ b/Crypto/Hash/Blake2bp.hs @@ -1,16 +1,16 @@ -- | --- Module : Crypto.Hash.BLAKE2bp +-- Module : Crypto.Hash.Blake2bp -- License : BSD-style -- Maintainer : Vincent Hanquez -- Stability : experimental -- Portability : unknown -- -- module containing the binding functions to work with the --- BLAKE2bp cryptographic hash. +-- Blake2bp cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} -module Crypto.Hash.BLAKE2bp - ( BLAKE2bp_512 (..) +module Crypto.Hash.Blake2bp + ( Blake2bp_512 (..) ) where import Crypto.Hash.Types @@ -18,11 +18,11 @@ import Foreign.Ptr (Ptr) import Data.Word (Word8, Word32) --- | BLAKE2bp (512 bits) cryptographic hash algorithm -data BLAKE2bp_512 = BLAKE2bp_512 +-- | Blake2bp (512 bits) cryptographic hash algorithm +data Blake2bp_512 = Blake2bp_512 deriving (Show) -instance HashAlgorithm BLAKE2bp_512 where +instance HashAlgorithm Blake2bp_512 where hashBlockSize _ = 128 hashDigestSize _ = 64 hashInternalContextSize _ = 2325 diff --git a/Crypto/Hash/BLAKE2s.hs b/Crypto/Hash/Blake2s.hs similarity index 80% rename from Crypto/Hash/BLAKE2s.hs rename to Crypto/Hash/Blake2s.hs index 8430016..21e97e2 100644 --- a/Crypto/Hash/BLAKE2s.hs +++ b/Crypto/Hash/Blake2s.hs @@ -1,16 +1,16 @@ -- | --- Module : Crypto.Hash.BLAKE2s +-- Module : Crypto.Hash.Blake2s -- License : BSD-style -- Maintainer : Vincent Hanquez -- Stability : experimental -- Portability : unknown -- -- module containing the binding functions to work with the --- BLAKE2s cryptographic hash. +-- Blake2s cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} -module Crypto.Hash.BLAKE2s - ( BLAKE2s_256 (..) +module Crypto.Hash.Blake2s + ( Blake2s_256 (..) ) where import Crypto.Hash.Types @@ -18,11 +18,11 @@ import Foreign.Ptr (Ptr) import Data.Word (Word8, Word32) --- | BLAKE2s (256 bits) cryptographic hash algorithm -data BLAKE2s_256 = BLAKE2s_256 +-- | Blake2s (256 bits) cryptographic hash algorithm +data Blake2s_256 = Blake2s_256 deriving (Show) -instance HashAlgorithm BLAKE2s_256 where +instance HashAlgorithm Blake2s_256 where hashBlockSize _ = 64 hashDigestSize _ = 32 hashInternalContextSize _ = 185 diff --git a/Crypto/Hash/BLAKE2sp.hs b/Crypto/Hash/Blake2sp.hs similarity index 80% rename from Crypto/Hash/BLAKE2sp.hs rename to Crypto/Hash/Blake2sp.hs index a903b3d..4dd04d6 100644 --- a/Crypto/Hash/BLAKE2sp.hs +++ b/Crypto/Hash/Blake2sp.hs @@ -1,16 +1,16 @@ -- | --- Module : Crypto.Hash.BLAKE2sp +-- Module : Crypto.Hash.Blake2sp -- License : BSD-style -- Maintainer : Vincent Hanquez -- Stability : experimental -- Portability : unknown -- -- module containing the binding functions to work with the --- BLAKE2sp cryptographic hash. +-- Blake2sp cryptographic hash. -- {-# LANGUAGE ForeignFunctionInterface #-} -module Crypto.Hash.BLAKE2sp - ( BLAKE2sp_256 (..) +module Crypto.Hash.Blake2sp + ( Blake2sp_256 (..) ) where import Crypto.Hash.Types @@ -18,11 +18,11 @@ import Foreign.Ptr (Ptr) import Data.Word (Word8, Word32) --- | BLAKE2sp (256 bits) cryptographic hash algorithm -data BLAKE2sp_256 = BLAKE2sp_256 +-- | Blake2sp (256 bits) cryptographic hash algorithm +data Blake2sp_256 = Blake2sp_256 deriving (Show) -instance HashAlgorithm BLAKE2sp_256 where +instance HashAlgorithm Blake2sp_256 where hashBlockSize _ = 64 hashDigestSize _ = 32 hashInternalContextSize _ = 2185 diff --git a/cryptonite.cabal b/cryptonite.cabal index 76fd3b5..583445a 100644 --- a/cryptonite.cabal +++ b/cryptonite.cabal @@ -149,10 +149,10 @@ Library Crypto.Hash.MD2 Crypto.Hash.MD4 Crypto.Hash.MD5 - Crypto.Hash.BLAKE2s - Crypto.Hash.BLAKE2sp - Crypto.Hash.BLAKE2b - Crypto.Hash.BLAKE2bp + Crypto.Hash.Blake2s + Crypto.Hash.Blake2sp + Crypto.Hash.Blake2b + Crypto.Hash.Blake2bp Crypto.Hash.RIPEMD160 Crypto.Hash.Skein256 Crypto.Hash.Skein512 diff --git a/gen/Gen.hs b/gen/Gen.hs index 6a32ed5..c5d681d 100644 --- a/gen/Gen.hs +++ b/gen/Gen.hs @@ -53,10 +53,10 @@ data HashCustom = hashModules = -- module header hash ctx dg blk - [ GenHashModule "BLAKE2s" "blake2.h" "blake2s" 185 (HashMulti [(256,64)]) - , GenHashModule "BLAKE2sp" "blake2.h" "blake2sp" 2185 (HashMulti [(256,64)]) - , GenHashModule "BLAKE2b" "blake2.h" "blake2b" 361 (HashMulti [(512,128)]) - , GenHashModule "BLAKE2bp" "blake2.h" "blake2sp" 2325 (HashMulti [(512,128)]) + [ GenHashModule "Blake2s" "blake2.h" "blake2s" 185 (HashMulti [(256,64)]) + , GenHashModule "Blake2sp" "blake2.h" "blake2sp" 2185 (HashMulti [(256,64)]) + , GenHashModule "Blake2b" "blake2.h" "blake2b" 361 (HashMulti [(512,128)]) + , GenHashModule "Blake2bp" "blake2.h" "blake2sp" 2325 (HashMulti [(512,128)]) , GenHashModule "MD2" "md2.h" "md2" 96 (HashSimple 128 16) , GenHashModule "MD4" "md4.h" "md4" 96 (HashSimple 128 64) , GenHashModule "MD5" "md5.h" "md5" 96 (HashSimple 128 64) diff --git a/tests/Hash.hs b/tests/Hash.hs index f72c406..f8fe8a5 100644 --- a/tests/Hash.hs +++ b/tests/Hash.hs @@ -138,7 +138,7 @@ expected = [ "a69f73cca23a9ac5c8b567dc185a756e97c982164fe25859e0d1dcc1475c80a615b2123af1f5f94c11e3e9402c3ac558f500199d95b6d3e301758586281dcd26", "01dedd5de4ef14642445ba5f5b97c15e47b9ad931326e4b0727cd94cefc44fff23f07bf543139939b49128caf436dc1bdee54fcb24023a08d9403f9b4bf0d450", "28e361fe8c56e617caa56c28c7c36e5c13be552b77081be82b642f08bb7ef085b9a81910fe98269386b9aacfd2349076c9506126e198f6f6ad44c12017ca77b1" ]) - , ("BLAKE2b-512", HashAlg BLAKE2b_512, [ + , ("Blake2b-512", HashAlg Blake2b_512, [ "786a02f742015903c6c6fd852552d272912f4740e15847618a86e217f71f5419d25e1031afee585313896444934eb04b903a685b1448b755d56f701afe9be2ce", "a8add4bdddfd93e4877d2746e62817b116364a1fa7bc148d95090bc7333b3673f82401cf7aa2e4cb1ecd90296e3f14cb5413f8ed77be73045b13914cdcd6a918", "af438eea5d8cdb209336a7e85bf58090dc21b49d823f89a7d064c119f127bd361af9c7d109edda0f0e91bdce078d1d86b8e6f25727c98f6d3bb6f50acb2dd376" ])