implement ripemd160 just so we can validate peter todd's old examples.

This commit is contained in:
fiatjaf
2023-09-28 15:35:07 -03:00
parent 7084284622
commit ef94324f2e
2 changed files with 10 additions and 1 deletions

2
ots.go
View File

@@ -44,7 +44,7 @@ var tags = map[byte]*Operation{
0xf2: {"reverse", 0xf2, false, func(curr []byte, arg []byte) []byte { panic("reverse not implemented") }},
0xf3: {"hexlify", 0xf3, false, func(curr []byte, arg []byte) []byte { panic("hexlify not implemented") }},
0x02: {"sha1", 0x02, false, func(curr []byte, arg []byte) []byte { panic("sha1 not implemented") }},
0x03: {"ripemd160", 0x03, false, func(curr []byte, arg []byte) []byte { panic("ripemd160 not implemented") }},
0x03: {"ripemd160", 0x03, false, ripemd160},
0x08: {"sha256", 0x08, false, func(curr []byte, arg []byte) []byte {
v := sha256.Sum256(curr)
return v[:]

9
unused.go Normal file
View File

@@ -0,0 +1,9 @@
package opentimestamps
import (
deprecated_ripemd160 "golang.org/x/crypto/ripemd160"
)
func ripemd160(curr []byte, arg []byte) []byte {
return deprecated_ripemd160.New().Sum(curr)
}