Skip to content

Commit

Permalink
revert changes to rust threshold schnorr
Browse files Browse the repository at this point in the history
  • Loading branch information
altkdf committed Jan 13, 2025
1 parent 5860f80 commit a566ba5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion rust/threshold-schnorr/dfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"wasm": "https://github.com/dfinity/chainkey-testing-canister/releases/download/v0.1.0/chainkey_testing_canister.wasm.gz"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,17 +146,17 @@ async fn verify(
algorithm: SchnorrAlgorithm,
) -> Result<SignatureVerificationReply, String> {
let sig_bytes = hex::decode(&signature_hex).expect("failed to hex-decode signature");
let msg_bytes = hex::decode(&message).expect("failed to hex-decode message");
let msg_bytes = message.as_bytes();
let pk_bytes = hex::decode(&public_key_hex).expect("failed to hex-decode public key");

match algorithm {
SchnorrAlgorithm::Bip340Secp256k1 => match opt_merkle_tree_root_hex {
Some(merkle_tree_root_hex) => {
let merkle_tree_root_bytes = hex::decode(&merkle_tree_root_hex)
.expect("failed to hex-decode merkle tree root");
verify_bip341_secp256k1(&sig_bytes, &msg_bytes, &pk_bytes, &merkle_tree_root_bytes)
verify_bip341_secp256k1(&sig_bytes, msg_bytes, &pk_bytes, &merkle_tree_root_bytes)
}
None => verify_bip340_secp256k1(&sig_bytes, &msg_bytes, &pk_bytes),
None => verify_bip340_secp256k1(&sig_bytes, msg_bytes, &pk_bytes),
},
SchnorrAlgorithm::Ed25519 => {
if let Some(_) = opt_merkle_tree_root_hex {
Expand Down

0 comments on commit a566ba5

Please sign in to comment.