mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 06:42:16 +00:00
* crypto: revert to mainline Go crypto lib We used to use a fork for a modified bcrypt so we could pass our own randomness but this was largely unecessary, unused, and a burden. So now we just use the mainline Go crypto lib. * changelog * fix tests * version and changelog
20 lines
298 B
Go
20 lines
298 B
Go
package crypto
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
|
|
"golang.org/x/crypto/ripemd160"
|
|
)
|
|
|
|
func Sha256(bytes []byte) []byte {
|
|
hasher := sha256.New()
|
|
hasher.Write(bytes)
|
|
return hasher.Sum(nil)
|
|
}
|
|
|
|
func Ripemd160(bytes []byte) []byte {
|
|
hasher := ripemd160.New()
|
|
hasher.Write(bytes)
|
|
return hasher.Sum(nil)
|
|
}
|