kaspad/util/blake2b.go
Ori Newman d0511c1636
Use BLAKE2B instead of HASH160, and get rid of any usage of RIPEMD160 and SHA1 (#1618)
* Use BLAKE2B instead of HASH160, and get rid of any usage of RIPEMD160

* Change genesis coinbase payload script to OP_FALSE

* Fix tests after conflict

* Remove duplicate tests

* Change file name

* Change atomic swap to use proper hash size
2021-03-18 10:20:12 +02:00

16 lines
350 B
Go

// Copyright (c) 2013-2017 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package util
import (
"golang.org/x/crypto/blake2b"
)
// HashBlake2b calculates the hash blake2b(b).
func HashBlake2b(buf []byte) []byte {
hashedBuf := blake2b.Sum256(buf)
return hashedBuf[:]
}