main.go
TEXT FILE302 B · Public source code for developers, search crawlers and AI agents
1package main
2
3import (
4 "crypto/sha256"
5 "fmt"
6)
7
8func tagged(tag string, msg []byte) [32]byte {
9 h := sha256.Sum256([]byte(tag))
10 b := append(append([]byte{}, h[:]...), h[:]...)
11 return sha256.Sum256(append(b, msg...))
12}
13func main() { fmt.Printf("%x\n", tagged("BIP0340/challenge", []byte("demo"))) }Read-only source · Select a line number to link directly · Raw download above
