From a693d741ec7a8c5ba0ec5ddff487b25fcb534b80 Mon Sep 17 00:00:00 2001 From: Kevaundray Wedderburn Date: Wed, 10 May 2023 19:44:18 +0100 Subject: [PATCH] modify test --- crates/nargo_cli/tests/test_data/ecdsa_secp256k1/Prover.toml | 2 +- crates/nargo_cli/tests/test_data/ecdsa_secp256k1/src/main.nr | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/Prover.toml b/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/Prover.toml index c5421a9258a..02d14112587 100644 --- a/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/Prover.toml +++ b/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/Prover.toml @@ -1,4 +1,4 @@ -hashed_message = [ +message = [ 0x49, 0x6e, 0x73, diff --git a/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/src/main.nr b/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/src/main.nr index 62bf738d385..700a7defa00 100644 --- a/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/src/main.nr +++ b/crates/nargo_cli/tests/test_data/ecdsa_secp256k1/src/main.nr @@ -9,9 +9,10 @@ use dep::std; // - Noir should be agnostic to backends, so even though // the only backend implemented does not work properly for this, // we can still implement it on the frontend. -fn main(hashed_message : [u8;38], pub_key_x : [u8;32], pub_key_y : [u8;32], signature : [u8;64]) { +fn main(message : [u8;38], pub_key_x : [u8;32], pub_key_y : [u8;32], signature : [u8;64]) { // Is there ever a situation where someone would want // to ensure that a signature was invalid? - let x = std::ecdsa_secp256k1::verify_signature(pub_key_x, pub_key_y, signature, hashed_message,); + let hashed_message = std::hash::sha256(message); + let x = std::ecdsa_secp256k1::verify_signature(pub_key_x, pub_key_y, signature, hashed_message); assert(x == 1); } \ No newline at end of file