Some checks failed
CI / lint (push) Successful in 1m37s
CI / test-python (push) Successful in 1m49s
CI / test-zig (push) Successful in 1m39s
CI / test-wasm (push) Successful in 1m54s
CI / test (push) Successful in 14m44s
CI / miri (push) Successful in 14m18s
CI / build (push) Successful in 1m9s
CI / fuzz-regression (push) Successful in 9m9s
CI / publish (push) Failing after 1m10s
CI / publish-python (push) Failing after 1m46s
CI / publish-wasm (push) Has been cancelled
Signed-off-by: Kamal Tufekcic <kamal@lo.sh>
21 lines
686 B
Rust
21 lines
686 B
Rust
#![no_main]
|
|
use libfuzzer_sys::fuzz_target;
|
|
use soliton::identity::{hybrid_verify, HybridSignature, IdentityPublicKey};
|
|
|
|
fuzz_target!(|data: &[u8]| {
|
|
// pk (3200) + sig (3373) = 6573 minimum bytes.
|
|
if data.len() < 3200 + 3373 {
|
|
return;
|
|
}
|
|
let Ok(pk) = IdentityPublicKey::from_bytes(data[..3200].to_vec()) else {
|
|
return;
|
|
};
|
|
let Ok(sig) = HybridSignature::from_bytes(data[3200..3200 + 3373].to_vec()) else {
|
|
return;
|
|
};
|
|
let msg = &data[3200 + 3373..];
|
|
|
|
// hybrid_verify must never panic regardless of input.
|
|
// Exercises: Ed25519 verify + ML-DSA verify (pure-Rust ml-dsa crate).
|
|
let _ = hybrid_verify(&pk, msg, &sig);
|
|
});
|