|
@ -302,7 +302,7 @@ func shareAuthSignature(sc *SecretConnection, pubKey crypto.PubKeyEd25519, signa |
|
|
// sha256
|
|
|
// sha256
|
|
|
func hash32(input []byte) (res *[32]byte) { |
|
|
func hash32(input []byte) (res *[32]byte) { |
|
|
hasher := sha256.New() |
|
|
hasher := sha256.New() |
|
|
_, _ = hasher.Write(input) // ignoring error
|
|
|
|
|
|
|
|
|
_, _ = hasher.Write(input) // error ignored
|
|
|
resSlice := hasher.Sum(nil) |
|
|
resSlice := hasher.Sum(nil) |
|
|
res = new([32]byte) |
|
|
res = new([32]byte) |
|
|
copy(res[:], resSlice) |
|
|
copy(res[:], resSlice) |
|
@ -312,7 +312,7 @@ func hash32(input []byte) (res *[32]byte) { |
|
|
// We only fill in the first 20 bytes with ripemd160
|
|
|
// We only fill in the first 20 bytes with ripemd160
|
|
|
func hash24(input []byte) (res *[24]byte) { |
|
|
func hash24(input []byte) (res *[24]byte) { |
|
|
hasher := ripemd160.New() |
|
|
hasher := ripemd160.New() |
|
|
_, _ = hasher.Write(input) // ignoring error
|
|
|
|
|
|
|
|
|
_, _ = hasher.Write(input) // error ignored
|
|
|
resSlice := hasher.Sum(nil) |
|
|
resSlice := hasher.Sum(nil) |
|
|
res = new([24]byte) |
|
|
res = new([24]byte) |
|
|
copy(res[:], resSlice) |
|
|
copy(res[:], resSlice) |
|
|