MCPcopy
hub / github.com/OpenNHP/opennhp / FuzzHeaderTypeToDeviceType

Function FuzzHeaderTypeToDeviceType

nhp/test/fuzz_test.go:65–79  ·  view source on GitHub ↗

FuzzHeaderTypeToDeviceType tests header type to device type mapping.

(f *testing.F)

Source from the content-addressed store, hash-verified

63
64// FuzzHeaderTypeToDeviceType tests header type to device type mapping.
65func 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.

Callers

nothing calls this directly

Calls 1

AddMethod · 0.65

Tested by

no test coverage detected