Skip to content

Commit

Permalink
added fuzzing script
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlepisto committed Nov 11, 2024
1 parent 6da9e03 commit 6f13bb6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions fuzz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
#
# Usage:
# fuzz.sh <t>
#
# t: How many seconds to fuzz
set -e

# Cleanup on exit
trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT

# How many seconds to fuzz
T=${1?param missing - time to fuzz}

FUZZ="cargo +nightly fuzz"
$FUZZ build

# Fuzz all targets
targets=$($FUZZ list)
for target in $targets; do
$FUZZ run $target -- -max_total_time=$T &
done

# Stop as soon as a fuzzer job fails
wait -n
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub enum KemError {

pub type KemResult<T> = Result<T, KemError>;

// Errors that can happen during DH operations
/// Errors that can happen during DH operations
#[derive(Debug, Error, Display)]
pub enum DhError {
/// Error generating keys
Expand Down

0 comments on commit 6f13bb6

Please sign in to comment.