FuzzHeaderTypeToDeviceType tests header type to device type mapping.
(f *testing.F)
| 63 | |
| 64 | // FuzzHeaderTypeToDeviceType tests header type to device type mapping. |
| 65 | func FuzzHeaderTypeToDeviceType(f *testing.F) { |
| 66 | // Seed with known valid types |
| 67 | f.Add(0) // NHP_KPL |
| 68 | f.Add(1) // NHP_KNK |
| 69 | f.Add(10) // NHP_AOL |
| 70 | f.Add(100) |
| 71 | f.Add(-1) |
| 72 | f.Add(1000000) |
| 73 | |
| 74 | f.Fuzz(func(t *testing.T, headerType int) { |
| 75 | // Should not panic on any input |
| 76 | _ = core.HeaderTypeToDeviceType(headerType) |
| 77 | _ = core.HeaderTypeToString(headerType) |
| 78 | }) |
| 79 | } |
| 80 | |
| 81 | // FuzzCBCDecryption tests CBC decryption with random inputs. |
| 82 | // Tests both AES256 and SM4 cipher modes. |