MCPcopy Create free account
hub / github.com/chain/txvm / TestTupleHashXOFNISTSample2

Function TestTupleHashXOFNISTSample2

crypto/sha3/tuple_hash_test.go:191–205  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

189}
190
191func TestTupleHashXOFNISTSample2(t *testing.T) {
192 outputLength := 32
193 tuples := [][]byte{
194 []byte{0x00, 0x01, 0x02},
195 []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15},
196 }
197 S := []byte("My Tuple App")
198 h := TupleHashXOF128(tuples, S)
199 output := make([]byte, outputLength)
200 h.Read(output)
201 expected := strings.Replace("3F C8 AD 69 45 31 28 29 28 59 A1 8B 6C 67 D7 AD 85 F0 1B 32 81 5E 22 CE 83 9C 49 EC 37 4E 9B 9A", " ", "", -1)
202 if got := strings.ToUpper(hex.EncodeToString(output)); got != expected {
203 t.Errorf("TestTupleHashXOFNISTSample2: got %s, want %s", got, expected)
204 }
205}
206
207func TestTupleHashXOFNISTSample3(t *testing.T) {
208 outputLength := 32

Callers

nothing calls this directly

Calls 2

TupleHashXOF128Function · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected