Skip to content

Commit

Permalink
expand schnorr tests for both slice and array messages
Browse files Browse the repository at this point in the history
  • Loading branch information
vezenovm committed Aug 25, 2023
1 parent 51bca48 commit b9b04e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ unconstrained fn main(message: [u8; 10], message_field: Field, pub_key_x: Field,
}
// Is there ever a situation where someone would want
// to ensure that a signature was invalid?
// Check that passing a slice is valid
let valid_signature = std::schnorr::verify_signature(pub_key_x,pub_key_y,signature, message_field_bytes);
assert(valid_signature);

// Check that passing an array is valid
let valid_signature = std::schnorr::verify_signature(pub_key_x,pub_key_y,signature, message);
assert(valid_signature);
}
5 changes: 5 additions & 0 deletions crates/nargo_cli/tests/execution_success/schnorr/src/main.nr
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ fn main(message: [u8; 10], message_field: Field, pub_key_x: Field, pub_key_y: Fi
}
// Is there ever a situation where someone would want
// to ensure that a signature was invalid?
// Check that passing a slice as the message is valid
let valid_signature = std::schnorr::verify_signature(pub_key_x,pub_key_y,signature, message_field_bytes);
assert(valid_signature);

// Check that passing an array as the message is valid
let valid_signature = std::schnorr::verify_signature(pub_key_x,pub_key_y,signature, message);
assert(valid_signature);
}

0 comments on commit b9b04e6

Please sign in to comment.