mirror of
https://github.com/saymrwulf/risc0-curve25519-dalek-source.git
synced 2026-09-05 20:10:35 +00:00
21 lines
577 B
Rust
21 lines
577 B
Rust
#![no_main]
|
|
#[macro_use] extern crate libfuzzer_sys;
|
|
extern crate curve25519_dalek;
|
|
|
|
use curve25519_dalek::curve::ValidityCheck;
|
|
use curve25519_dalek::decaf::DecafPoint;
|
|
use curve25519_dalek::field::FieldElement;
|
|
|
|
fuzz_target!(|data: &[u8]| {
|
|
if data.len() != 32 {
|
|
return;
|
|
}
|
|
let mut field_bytes = [0u8; 32];
|
|
for (by, data) in field_bytes.iter_mut().zip(data.iter()) {
|
|
*by = *data;
|
|
}
|
|
let fe = FieldElement::from_bytes(&field_bytes);
|
|
let p = DecafPoint::elligator_decaf_flavour(&fe);
|
|
assert!(p.0.is_valid());
|
|
p.compress();
|
|
});
|