Skip to content

Commit

Permalink
Fixed test
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidM-D committed Jul 19, 2024
1 parent e4a081a commit b7c6ef9
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions chain-signatures/contract/tests/tests.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use crypto_shared::kdf::{check_ec_signature, derive_secret_key};
use crypto_shared::{
derive_epsilon, derive_key, SerializableAffinePoint, SerializableScalar, SignatureResponse,
derive_epsilon, derive_key, ScalarExt as _, SerializableAffinePoint, SerializableScalar,
SignatureResponse,
};
use ecdsa::signature::Verifier;
use k256::elliptic_curve::ops::Reduce;
use k256::elliptic_curve::point::DecompressPoint;
use k256::elliptic_curve::sec1::ToEncodedPoint;
use k256::{AffinePoint, FieldBytes, Secp256k1};
use k256::{AffinePoint, FieldBytes, Scalar, Secp256k1};
use mpc_contract::primitives::{CandidateInfo, ParticipantInfo, SignRequest};
use mpc_contract::SignatureRequest;
use near_sdk::NearToken;
Expand Down Expand Up @@ -135,8 +136,8 @@ async fn create_response(

let s = signature.s();
let (r_bytes, _s_bytes) = signature.split_bytes();

let respond_req = SignatureRequest::new(payload_hash, predecessor_id, path);
let payload_hash_s = Scalar::from_bytes(payload_hash).unwrap();
let respond_req = SignatureRequest::new(payload_hash_s, predecessor_id, path);
let big_r =
AffinePoint::decompress(&r_bytes, k256::elliptic_curve::subtle::Choice::from(0)).unwrap();
let s: k256::Scalar = *s.as_ref();
Expand Down

0 comments on commit b7c6ef9

Please sign in to comment.