Skip to content
This repository has been archived by the owner on Nov 23, 2023. It is now read-only.

Commit

Permalink
fix: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
brech1 committed Sep 7, 2023
1 parent 5313c78 commit 5b76523
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions eigentrust-zk/src/ecdsa/native.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ where
let rev_y: Vec<u8> = y.iter().rev().cloned().collect();
let pub_key = [rev_x, rev_y].concat();

// Hash and get first 20 bytes.
let hashed_public_key = Keccak256::digest(&pub_key);
let original_address_slice: &[u8] = &hashed_public_key[hashed_public_key.len() - 20..];
// Hash and get the last 20 bytes.
let pub_key_hash = Keccak256::digest(pub_key);
let address: &[u8] = &pub_key_hash[pub_key_hash.len() - 20..];

// Get little endian address
let le_address: Vec<u8> = original_address_slice.iter().rev().cloned().collect();
let le_address: Vec<u8> = address.iter().rev().cloned().collect();

// Build fixed-size array.
let mut address = [0u8; 64];
Expand Down

0 comments on commit 5b76523

Please sign in to comment.