diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2023-03-21 17:33:37 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2023-03-21 17:33:37 +0100 |
commit | 289f87d10454005140ba2125402301b305060e94 (patch) | |
tree | f90ee6a8aa0e12872629527d94363ce326c0b12f | |
parent | 4819abcb29a655ef285d3fc13a1f186d50375018 (diff) |
openpgp: Avoid heap allocation during fingerprint computing.
-rw-r--r-- | openpgp/src/packet/key.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/packet/key.rs b/openpgp/src/packet/key.rs index 9479caec..148061d8 100644 --- a/openpgp/src/packet/key.rs +++ b/openpgp/src/packet/key.rs @@ -1163,9 +1163,9 @@ impl<P, R> Key4<P, R> self.hash(&mut h); - let mut digest = vec![0u8; h.digest_size()]; + let mut digest = [0u8; 20]; let _ = h.digest(&mut digest); - Fingerprint::from_bytes(digest.as_slice()) + Fingerprint::V4(digest) }).clone() } |