(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestTupleHashNISTSample2(t *testing.T) { |
| 39 | outputLength := 32 |
| 40 | tuples := [][]byte{ |
| 41 | []byte{0x00, 0x01, 0x02}, |
| 42 | []byte{0x10, 0x11, 0x12, 0x13, 0x14, 0x15}, |
| 43 | } |
| 44 | S := []byte("My Tuple App") |
| 45 | output := make([]byte, outputLength) |
| 46 | TupleHash128(tuples, S, output) |
| 47 | expected := strings.Replace("75 CD B2 0F F4 DB 11 54 E8 41 D7 58 E2 41 60 C5 4B AE 86 EB 8C 13 E7 F5 F4 0E B3 55 88 E9 6D FB", " ", "", -1) |
| 48 | if got := strings.ToUpper(hex.EncodeToString(output)); got != expected { |
| 49 | t.Errorf("TestTupleHashNISTSample2: got %s, want %s", got, expected) |
| 50 | } |
| 51 | |
| 52 | h := NewTupleHash128(outputLength, S) |
| 53 | for _, item := range tuples { |
| 54 | h.WriteItem(item) |
| 55 | } |
| 56 | copy(output, zero[:]) |
| 57 | h.Sum(output[:0]) |
| 58 | if got := strings.ToUpper(hex.EncodeToString(output)); got != expected { |
| 59 | t.Errorf("TestTupleHashNISTSample2: got %s, want %s", got, expected) |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | func TestTupleHashNISTSample3(t *testing.T) { |
| 64 | outputLength := 32 |
nothing calls this directly
no test coverage detected