Skip to content

Commit

Permalink
Add acl contract address and chainid for input handle calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
david-zk committed Sep 24, 2024
1 parent 5cf033d commit 3a92474
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions fhevm-engine/coprocessor/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ impl coprocessor::fhevm_coprocessor_server::FhevmCoprocessor for CoprocessorServ
.map_err(|e| tonic::Status::from_error(e))?
};
let chain_id = fetch_key_response.chain_id;
let chain_id_be = (chain_id as u64).to_be_bytes();
let server_key = fetch_key_response.server_key;
let verifying_contract_address = fetch_key_response.verifying_contract_address;
let verifying_contract_address =
Expand Down Expand Up @@ -323,6 +324,8 @@ impl coprocessor::fhevm_coprocessor_server::FhevmCoprocessor for CoprocessorServ
let mut handle_hash = Keccak256::new();
handle_hash.update(&blob_hash);
handle_hash.update(&[ct_idx as u8]);
handle_hash.update(acl_contract_address.as_slice());
handle_hash.update(&chain_id_be);
let mut handle = handle_hash.finalize().to_vec();
assert_eq!(handle.len(), 32);
// idx cast to u8 must succeed because we don't allow
Expand Down

0 comments on commit 3a92474

Please sign in to comment.