File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,6 @@ package wire
6
6
7
7
import (
8
8
"bytes"
9
- "crypto/sha512"
10
9
"encoding/hex"
11
10
"encoding/json"
12
11
"fmt"
@@ -115,14 +114,11 @@ func (l *LeafData) UnmarshalJSON(data []byte) error {
115
114
116
115
// LeafHash concats and hashes all the data in LeafData.
117
116
func (l * LeafData ) LeafHash () [32 ]byte {
118
- digest := sha512 .New512_256 ()
119
- l .Serialize (digest )
120
-
121
- // TODO go 1.17 support slice to array conversion so we
122
- // can avoid this extra copy.
123
- hash := [32 ]byte {}
124
- copy (hash [:], digest .Sum (nil ))
125
- return hash
117
+ return * chainhash .TaggedHash512_256 (chainhash .TagUtreexoV1 ,
118
+ func (w io.Writer ) {
119
+ l .Serialize (w )
120
+ },
121
+ )
126
122
}
127
123
128
124
// ToString turns a LeafData into a string for logging.
You can’t perform that action at this time.
0 commit comments