Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eranrund committed Sep 22, 2023
1 parent b0bec37 commit c0e4975
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions contracts/multisig/src/ed25519.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// TODO: Logic specific to secp256k1 will most likely be handled by core in the future.
use crate::ContractError;

const ECDSA_SIGNATURE_LEN: usize = 64;
const ED25519_SIGNATURE_LEN: usize = 64;

pub fn ed25519_verify(msg_hash: &[u8], sig: &[u8], pub_key: &[u8]) -> Result<bool, ContractError> {
cosmwasm_crypto::ed25519_verify(msg_hash, &sig[0..ECDSA_SIGNATURE_LEN], pub_key).map_err(|e| {
ContractError::SignatureVerificationFailed {
cosmwasm_crypto::ed25519_verify(msg_hash, &sig[0..ED25519_SIGNATURE_LEN], pub_key).map_err(
|e| ContractError::SignatureVerificationFailed {
reason: e.to_string(),
}
})
},
)
}

0 comments on commit c0e4975

Please sign in to comment.