Skip to content

Commit

Permalink
Remove unnecessary vector allocation
Browse files Browse the repository at this point in the history
  • Loading branch information
webmaster128 committed Aug 1, 2023
1 parent e15cf41 commit 8b674e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ Results on an Apple M1 Pro with Rust 1.72.0-nightly:

| BLS implementation | Classic mainnet | Fastnet |
| ------------------ | --------------- | -------- |
| zkcrypto | 1.958 ms | 1.489 ms |
| arkworks | 1.748 ms | 1.452 ms |
| zkcrypto | 1.956 ms | 1.489 ms |
| arkworks | 1.714 ms | 1.425 ms |

## License

Expand Down
4 changes: 2 additions & 2 deletions src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,11 @@ impl fmt::Display for VerificationError {

impl Error for VerificationError {}

fn message(current_round: u64, prev_sig: &[u8]) -> Vec<u8> {
fn message(current_round: u64, prev_sig: &[u8]) -> [u8; 32] {
let mut hasher = Sha256::default();
hasher.update(prev_sig);
hasher.update(round_to_bytes(current_round));
hasher.finalize().to_vec()
hasher.finalize().into()
}

/// https://github.com/drand/drand-client/blob/master/wasm/chain/verify.go#L28-L33
Expand Down

0 comments on commit 8b674e4

Please sign in to comment.