Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions crates/contract-interface/src/types/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ pub enum SignatureScheme {
Secp256k1,
Ed25519,
Bls12381,
/// Robust ECDSA variant.
V2Secp256k1,
}

/// The purpose that a domain serves.
Expand Down
3 changes: 1 addition & 2 deletions crates/contract/src/dto_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,6 @@ impl IntoInterfaceType<dtos::SignatureScheme> for Curve {
Curve::Secp256k1 => dtos::SignatureScheme::Secp256k1,
Curve::Edwards25519 => dtos::SignatureScheme::Ed25519,
Curve::Bls12381 => dtos::SignatureScheme::Bls12381,
Curve::V2Secp256k1 => dtos::SignatureScheme::V2Secp256k1,
}
}
}
Expand All @@ -526,7 +525,7 @@ impl IntoInterfaceType<dtos::DomainConfig> for &DomainConfig {
fn into_dto_type(self) -> dtos::DomainConfig {
dtos::DomainConfig {
id: self.id.into_dto_type(),
scheme: self.curve.into_dto_type(),
scheme: self.key_config.curve.into_dto_type(),
purpose: Some(self.purpose),
}
}
Expand Down
12 changes: 6 additions & 6 deletions crates/contract/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ impl MpcContract {
// ensure the signer sent a valid signature request
// It's important we fail here because the MPC nodes will fail in an identical way.
// This allows users to get the error message
match domain_config.curve {
Curve::Secp256k1 | Curve::V2Secp256k1 => {
match domain_config.key_config.curve {
Curve::Secp256k1 => {
let hash = *request.payload.as_ecdsa().expect("Payload is not Ecdsa");
k256::Scalar::from_repr(hash.into())
.into_option()
Expand Down Expand Up @@ -2064,7 +2064,7 @@ mod tests {
NUM_CURVES,
};
use crate::primitives::{
domain::{infer_purpose_from_curve, Curve, DomainConfig, DomainId},
domain::{infer_key_config_from_curve, infer_purpose_from_curve, Curve, DomainConfig, DomainId},
participants::Participants,
signature::{Payload, Tweak},
test_utils::gen_participants,
Expand Down Expand Up @@ -2170,7 +2170,7 @@ mod tests {
rng: &mut impl CryptoRngCore,
) -> (dtos::PublicKey, SharedSecretKey) {
match domain_curve {
Curve::Secp256k1 | Curve::V2Secp256k1 => {
Curve::Secp256k1 => {
let (pk, sk) = new_secp256k1(rng);
(pk.into(), SharedSecretKey::Secp256k1(sk))
}
Expand Down Expand Up @@ -2207,7 +2207,7 @@ mod tests {
let domain_id = DomainId::default();
let domains = vec![DomainConfig {
id: domain_id,
curve,
key_config: infer_key_config_from_curve(curve),
purpose,
}];
let epoch_id = EpochId::new(0);
Expand Down Expand Up @@ -4065,7 +4065,7 @@ mod tests {
let domain_id = DomainId::default();
let domains = vec![DomainConfig {
id: domain_id,
curve: Curve::Secp256k1,
key_config: infer_key_config_from_curve(Curve::Secp256k1),
purpose: DomainPurpose::Sign,
}];
let (pk, _) = make_public_key_for_domain(Curve::Secp256k1, &mut OsRng);
Expand Down
Loading
Loading