Files
rosenpass/fuzzing/fuzz_targets/mceliece_encaps.rs
Morgan Hill d44793e07f Remove unwrap from fuzz targets that return errors
When fuzzing we are interested in what happens inside the target function
not necessarily what it returns. Functions returning errors with bogus
input in generally desired behaviour.
2023-11-29 11:36:07 +01:00

15 lines
373 B
Rust

#![no_main]
extern crate rosenpass;
use libfuzzer_sys::fuzz_target;
use rosenpass::pqkem::{StaticKEM, KEM};
fuzz_target!(|input: &[u8]| {
let mut ciphertext = [0u8; 188];
let mut shared_secret = [0u8; 32];
// We expect errors while fuzzing therefore we do not check the result.
let _ = StaticKEM::encaps(&mut shared_secret, &mut ciphertext, input);
});