(t *testing.T)
| 91 | } |
| 92 | |
| 93 | func Test_mask(t *testing.T) { |
| 94 | t.Parallel() |
| 95 | |
| 96 | key := []byte{0xa, 0xb, 0xc, 0xff} |
| 97 | key32 := binary.LittleEndian.Uint32(key) |
| 98 | p := []byte{0xa, 0xb, 0xc, 0xf2, 0xc} |
| 99 | gotKey32 := mask(p, key32) |
| 100 | |
| 101 | expP := []byte{0, 0, 0, 0x0d, 0x6} |
| 102 | assert.Equal(t, "p", expP, p) |
| 103 | |
| 104 | expKey32 := bits.RotateLeft32(key32, -8) |
| 105 | assert.Equal(t, "key32", expKey32, gotKey32) |
| 106 | } |