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 1
1
# Changelog for ` cardano-crypto-class `
2
2
3
- ## 2.2.1.1
3
+ ## 2.2.2.0
4
4
5
- *
5
+ * Add ` SHA512 ` and ` SHA3_512 ` algorithms.
6
6
7
7
## 2.2.1.0
8
8
Original file line number Diff line number Diff line change 1
1
cabal-version : 2.2
2
2
name : cardano-crypto-class
3
- version : 2.2.1 .0
3
+ version : 2.2.2 .0
4
4
synopsis :
5
5
Type classes abstracting over cryptography primitives for Cardano
6
6
@@ -64,6 +64,8 @@ library
64
64
Cardano.Crypto.Hash.RIPEMD160
65
65
Cardano.Crypto.Hash.SHA256
66
66
Cardano.Crypto.Hash.SHA3_256
67
+ Cardano.Crypto.Hash.SHA3_512
68
+ Cardano.Crypto.Hash.SHA512
67
69
Cardano.Crypto.Hash.Short
68
70
Cardano.Crypto.Init
69
71
Cardano.Crypto.KES
Original file line number Diff line number Diff line change @@ -10,4 +10,6 @@ import Cardano.Crypto.Hash.Keccak256 as X
10
10
import Cardano.Crypto.Hash.NeverUsed as X
11
11
import Cardano.Crypto.Hash.SHA256 as X
12
12
import Cardano.Crypto.Hash.SHA3_256 as X
13
+ import Cardano.Crypto.Hash.SHA3_512 as X
14
+ import Cardano.Crypto.Hash.SHA512 as X
13
15
import 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 1
1
# Changelog for ` cardano-crypto-tests `
2
2
3
- ## 2.2.0.1
3
+ ## 2.2.1.0
4
4
5
+ * Add test for ` SHA512 ` and ` SHA3_512 ` algorithms.
5
6
* Add tests using standard test vectors and generated ones for Praos and PraosBatchCompat
6
7
7
8
## 2.2.0.0
Original file line number Diff line number Diff line change 1
1
cabal-version : 2.2
2
2
name : cardano-crypto-tests
3
- version : 2.2.0 .0
3
+ version : 2.2.1 .0
4
4
synopsis : Tests for cardano-crypto-class and -praos
5
5
description : Tests for cardano-crypto-class and -praos
6
6
license : Apache-2.0
@@ -89,7 +89,7 @@ library
89
89
base16-bytestring,
90
90
bytestring >= 0.10.12.0 ,
91
91
cardano-binary,
92
- cardano-crypto-class ^>= 2.2 ,
92
+ cardano-crypto-class ^>= 2.2.2 ,
93
93
cardano-crypto-praos,
94
94
cborg,
95
95
containers,
Original file line number Diff line number Diff line change @@ -42,6 +42,8 @@ tests lock =
42
42
, testHashAlgorithm (Proxy :: Proxy Keccak256 )
43
43
, testSodiumHashAlgorithm lock (Proxy :: Proxy SHA256 )
44
44
, testSodiumHashAlgorithm lock (Proxy :: Proxy Blake2b_256 )
45
+ , testHashAlgorithm (Proxy :: Proxy SHA512 )
46
+ , testHashAlgorithm (Proxy :: Proxy SHA3_512 )
45
47
, testPackedBytes
46
48
]
47
49
You can’t perform that action at this time.
0 commit comments