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

Function TestTupleHashXOFNISTSample3

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

Source from the content-addressed store, hash-verified

205}
206
207func TestTupleHashXOFNISTSample3(t *testing.T) {
208 outputLength := 32
209 tuples := [][]byte{
210 []byte{0x00, 0x01, 0x02},
211 []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15},
212 []byte{0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28},
213 }
214 S := []byte("My Tuple App")
215 h := TupleHashXOF128(tuples, S)
216 output := make([]byte, outputLength)
217 h.Read(output)
218 expected := strings.Replace("90 0F E1 6C AD 09 8D 28 E7 4D 63 2E D8 52 F9 9D AA B7 F7 DF 4D 99 E7 75 65 78 85 B4 BF 76 D6 F8", " ", "", -1)
219 if got := strings.ToUpper(hex.EncodeToString(output)); got != expected {
220 t.Errorf("TestTupleHashXOFNISTSample3: got %s, want %s", got, expected)
221 }
222}
223
224func TestTupleHashXOFNISTSample4(t *testing.T) {
225 outputLength := 64

Callers

nothing calls this directly

Calls 2

TupleHashXOF128Function · 0.85
ReadMethod · 0.45

Tested by

no test coverage detected