Expand description
DER corruption helpers for negative test fixtures.
Provides deterministic truncation, byte-flipping, and combined corruption
strategies for DER-encoded blobs. Used by higher-level negative fixture
crates (uselesskey-core-negative) to generate invalid DER artifacts
that exercise parser error paths in tests.
Functionsยง
- corrupt_
der_ deterministic - Choose a corruption strategy deterministically from
variantand apply it toder. - flip_
byte - XOR the byte at
offsetwith0x01, returning the original ifoffsetis out of range. - truncate_
der - Truncate
derto at mostlenbytes, returning the original if already shorter.