Skip to content

Commit

Permalink
remove hash comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
JesseAbram committed Oct 18, 2024
1 parent 118fd90 commit 516fa7b
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/threshold-signature-server/src/validator/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ use crate::{
AppState,
};
use axum::{body::Bytes, extract::State, http::StatusCode};
use blake2::{Blake2s256, Digest};
use entropy_kvdb::kv_manager::{helpers::serialize as key_serialize, KvManager};
pub use entropy_protocol::{
decode_verifying_key,
Expand Down Expand Up @@ -275,14 +274,7 @@ pub async fn validate_new_reshare(
.await?
.ok_or_else(|| ValidatorErr::ChainFetch("Not Currently in a reshare"))?;

let mut hasher_chain_data = Blake2s256::new();
hasher_chain_data.update(chain_data.new_signers.encode());
let chain_data_hash = hasher_chain_data.finalize();
let mut hasher_verifying_data = Blake2s256::new();
hasher_verifying_data.update(reshare_data.new_signers.encode());
let verifying_data_hash = hasher_verifying_data.finalize();

if verifying_data_hash != chain_data_hash
if chain_data.new_signers != reshare_data.new_signers
|| chain_data.block_number != reshare_data.block_number.saturating_sub(1)
{
return Err(ValidatorErr::InvalidData);
Expand Down

0 comments on commit 516fa7b

Please sign in to comment.