(f *testing.F)
| 106 | } |
| 107 | |
| 108 | func FuzzXOR(f *testing.F) { |
| 109 | f.Add([]byte("The Quick Brown Fox Jumps over the Lazy Dog."), byte('X')) |
| 110 | f.Fuzz(func(t *testing.T, input []byte, key byte) { |
| 111 | cipherText := Encrypt(key, input) |
| 112 | result := Decrypt(key, cipherText) |
| 113 | if !bytes.Equal(input, result) { |
| 114 | t.Errorf("Before: %s, after: %s, key: %d", input, result, key) |
| 115 | } |
| 116 | }) |
| 117 | } |