Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(crypto): CRP-2609 Introduce master key ID variant for vetKD #2108

Merged
merged 16 commits into from
Oct 29, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fix compilation errors
fspreiss committed Oct 18, 2024
commit e81bf6424d0b650949fd1a54e781e373ab10c323
2 changes: 1 addition & 1 deletion rs/consensus/src/idkg/utils.rs
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ use ic_interfaces::consensus_pool::ConsensusBlockChain;
use ic_interfaces::idkg::{IDkgChangeAction, IDkgChangeSet, IDkgPool};
use ic_interfaces_registry::RegistryClient;
use ic_logger::{warn, ReplicaLogger};
use ic_management_canister_types::{EcdsaCurve, MasterPublicKeyId, SchnorrAlgorithm, VetKdCurve};
use ic_management_canister_types::{EcdsaCurve, MasterPublicKeyId, SchnorrAlgorithm};
use ic_protobuf::registry::subnet::v1 as pb;
use ic_registry_client_helpers::subnet::SubnetRegistry;
use ic_registry_subnet_features::ChainKeyConfig;
3 changes: 3 additions & 0 deletions rs/registry/canister/tests/common/test_helpers.rs
Original file line number Diff line number Diff line change
@@ -346,6 +346,9 @@ pub async fn wait_for_chain_key_setup(
MasterPublicKeyId::Schnorr(key_id) => {
wait_for_schnorr_setup(runtime, calling_canister, key_id).await;
}
MasterPublicKeyId::VetKd(_key_id) => {
todo!("CRP-YYYY Extend registry canister tests")
fspreiss marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

Original file line number Diff line number Diff line change
@@ -67,6 +67,7 @@ fn test(env: TestEnv) {
let method_name = match key_id {
MasterPublicKeyId::Ecdsa(_) => "sign_with_ecdsa",
MasterPublicKeyId::Schnorr(_) => "sign_with_schnorr",
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
};
assert_eq!(
error,
Original file line number Diff line number Diff line change
@@ -215,6 +215,7 @@ fn test(env: TestEnv) {
let method_name = match key_id {
MasterPublicKeyId::Ecdsa(_) => "sign_with_ecdsa",
MasterPublicKeyId::Schnorr(_) => "sign_with_schnorr",
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
};
if let Err(sig_err) = sig_result {
assert_eq!(
5 changes: 5 additions & 0 deletions rs/tests/consensus/tecdsa/utils/src/lib.rs
Original file line number Diff line number Diff line change
@@ -301,6 +301,7 @@ pub async fn get_public_key_with_retries(
MasterPublicKeyId::Schnorr(key_id) => {
get_schnorr_public_key_with_retries(key_id, msg_can, logger, retries).await
}
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
}
}

@@ -507,6 +508,7 @@ pub async fn get_signature_with_logger(
MasterPublicKeyId::Schnorr(key_id) => {
get_schnorr_signature_with_logger(message, cycles, key_id, msg_can, logger).await
}
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
}
}

@@ -809,6 +811,7 @@ pub fn verify_signature(key_id: &MasterPublicKeyId, msg: &[u8], pk: &[u8], sig:
SchnorrAlgorithm::Bip340Secp256k1 => verify_bip340_signature(pk, sig, msg),
SchnorrAlgorithm::Ed25519 => verify_ed25519_signature(pk, sig, msg),
},
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
};
assert!(res);
}
@@ -837,6 +840,7 @@ impl ChainSignatureRequest {
MasterPublicKeyId::Schnorr(schnorr_key_id) => {
Self::schnorr_params(schnorr_key_id, schnorr_message_size)
}
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
};
let payload = Encode!(&params).unwrap();

@@ -901,6 +905,7 @@ impl Request<SignWithChainKeyReply> for ChainSignatureRequest {
MasterPublicKeyId::Schnorr(_) => {
SignWithChainKeyReply::Schnorr(SignWithSchnorrReply::decode(raw_response)?)
}
MasterPublicKeyId::VetKd(_) => panic!("not applicable to vetKD"),
})
}
}