main_test.go
TEXT FILE320 B · Public source code for developers, search crawlers and AI agents
1package main
2
3import (
4 "crypto/sha256"
5 "testing"
6)
7
8func TestTagged(t *testing.T) {
9 h := sha256.Sum256([]byte("tag"))
10 b := append(append(h[:0:0], h[:]...), h[:]...)
11 b = append(b, 1)
12 if tagged("tag", []byte{1}) != sha256.Sum256(b) || tagged("tag", nil) == tagged("other", nil) {
13 t.Fatal("domain separation")
14 }
15}Read-only source · Select a line number to link directly · Raw download above
