initial commit

Signed-off-by: Kamal Tufekcic <kamal@lo.sh>
This commit is contained in:
Kamal Tufekcic 2026-04-02 23:48:10 +03:00
commit d73755a275
No known key found for this signature in database
165830 changed files with 568244 additions and 0 deletions

View file

@ -0,0 +1,23 @@
#![no_main]
use libfuzzer_sys::fuzz_target;
use soliton::primitives::ed25519;
fuzz_target!(|data: &[u8]| {
// Need at least 32 (pk) + 64 (sig) = 96 bytes.
if data.len() < 96 {
return;
}
let pk_bytes: [u8; 32] = data[..32].try_into().unwrap();
let sig: [u8; 64] = data[32..96].try_into().unwrap();
let msg = &data[96..];
// Attempt to construct a VerifyingKey from the fuzz input — from_bytes
// rejects non-canonical encodings and points not on the curve.
let Ok(vk) = ed25519_dalek::VerifyingKey::from_bytes(&pk_bytes) else {
return;
};
// verify must never panic regardless of input.
// Exercises: Ed25519 point decompression, strict signature verification.
let _ = ed25519::verify(&vk, msg, &sig);
});