From 516fa7b411f996b9e65c723ab2a6f1e2c4cbbf03 Mon Sep 17 00:00:00 2001 From: Jesse Abramowitz Date: Fri, 18 Oct 2024 15:12:05 -0400 Subject: [PATCH] remove hash comparison --- crates/threshold-signature-server/src/validator/api.rs | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/crates/threshold-signature-server/src/validator/api.rs b/crates/threshold-signature-server/src/validator/api.rs index b64773af2..6a135ec80 100644 --- a/crates/threshold-signature-server/src/validator/api.rs +++ b/crates/threshold-signature-server/src/validator/api.rs @@ -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, @@ -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);