File tree Expand file tree Collapse file tree 8 files changed +59
-6
lines changed
Expand file tree Collapse file tree 8 files changed +59
-6
lines changed Original file line number Diff line number Diff line change 11# Changelog for ` cardano-crypto-class `
22
3- ## 2.2.1.1
3+ ## 2.2.2.0
44
5- *
5+ * Add ` SHA512 ` and ` SHA3_512 ` algorithms.
66
77## 2.2.1.0
88
Original file line number Diff line number Diff line change 11cabal-version : 2.2
22name : cardano-crypto-class
3- version : 2.2.1 .0
3+ version : 2.2.2 .0
44synopsis :
55 Type classes abstracting over cryptography primitives for Cardano
66
@@ -64,6 +64,8 @@ library
6464 Cardano.Crypto.Hash.RIPEMD160
6565 Cardano.Crypto.Hash.SHA256
6666 Cardano.Crypto.Hash.SHA3_256
67+ Cardano.Crypto.Hash.SHA3_512
68+ Cardano.Crypto.Hash.SHA512
6769 Cardano.Crypto.Hash.Short
6870 Cardano.Crypto.Init
6971 Cardano.Crypto.KES
Original file line number Diff line number Diff line change @@ -10,4 +10,6 @@ import Cardano.Crypto.Hash.Keccak256 as X
1010import Cardano.Crypto.Hash.NeverUsed as X
1111import Cardano.Crypto.Hash.SHA256 as X
1212import Cardano.Crypto.Hash.SHA3_256 as X
13+ import Cardano.Crypto.Hash.SHA3_512 as X
14+ import Cardano.Crypto.Hash.SHA512 as X
1315import Cardano.Crypto.Hash.Short as X
Original file line number Diff line number Diff line change 1+ {-# LANGUAGE DataKinds #-}
2+ {-# LANGUAGE PackageImports #-}
3+ {-# LANGUAGE TypeFamilies #-}
4+
5+ -- | Implementation of the SHA3_512 hashing algorithm.
6+ module Cardano.Crypto.Hash.SHA3_512 (
7+ SHA3_512 ,
8+ )
9+ where
10+
11+ import Cardano.Crypto.Hash.Class
12+ import qualified Data.ByteArray as BA
13+ import qualified "crypton" Crypto.Hash as H
14+
15+ data SHA3_512
16+
17+ instance HashAlgorithm SHA3_512 where
18+ type SizeHash SHA3_512 = 64
19+ hashAlgorithmName _ = " sha3-512"
20+ digest _ = convert . H. hash
21+
22+ convert :: H. Digest H. SHA3_512 -> ByteString
23+ convert = BA. convert
Original file line number Diff line number Diff line change 1+ {-# LANGUAGE DataKinds #-}
2+ {-# LANGUAGE PackageImports #-}
3+ {-# LANGUAGE TypeFamilies #-}
4+
5+ -- | Implementation of the SHA512 hashing algorithm.
6+ module Cardano.Crypto.Hash.SHA512 (
7+ SHA512 ,
8+ )
9+ where
10+
11+ import Cardano.Crypto.Hash.Class
12+ import qualified Data.ByteArray as BA
13+ import qualified "crypton" Crypto.Hash as H
14+
15+ data SHA512
16+
17+ instance HashAlgorithm SHA512 where
18+ type SizeHash SHA512 = 64
19+ hashAlgorithmName _ = " sha512"
20+ digest _ = convert . H. hash
21+
22+ convert :: H. Digest H. SHA512 -> ByteString
23+ convert = BA. convert
Original file line number Diff line number Diff line change 11# Changelog for ` cardano-crypto-tests `
22
3- ## 2.2.0.1
3+ ## 2.2.1.0
44
5+ * Add test for ` SHA512 ` and ` SHA3_512 ` algorithms.
56* Add tests using standard test vectors and generated ones for Praos and PraosBatchCompat
67
78## 2.2.0.0
Original file line number Diff line number Diff line change 11cabal-version : 2.2
22name : cardano-crypto-tests
3- version : 2.2.0 .0
3+ version : 2.2.1 .0
44synopsis : Tests for cardano-crypto-class and -praos
55description : Tests for cardano-crypto-class and -praos
66license : Apache-2.0
@@ -89,7 +89,7 @@ library
8989 base16-bytestring,
9090 bytestring >= 0.10.12.0 ,
9191 cardano-binary,
92- cardano-crypto-class ^>= 2.2 ,
92+ cardano-crypto-class ^>= 2.2.2 ,
9393 cardano-crypto-praos,
9494 cborg,
9595 containers,
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ tests lock =
4242 , testHashAlgorithm (Proxy :: Proxy Keccak256 )
4343 , testSodiumHashAlgorithm lock (Proxy :: Proxy SHA256 )
4444 , testSodiumHashAlgorithm lock (Proxy :: Proxy Blake2b_256 )
45+ , testHashAlgorithm (Proxy :: Proxy SHA512 )
46+ , testHashAlgorithm (Proxy :: Proxy SHA3_512 )
4547 , testPackedBytes
4648 ]
4749
You can’t perform that action at this time.
0 commit comments