summaryrefslogtreecommitdiffstats
path: root/openpgp/src/crypto/aead.rs
diff options
context:
space:
mode:
authorIgor Matuszewski <igor@sequoia-pgp.org>2020-09-09 13:33:15 +0200
committerIgor Matuszewski <igor@sequoia-pgp.org>2020-09-09 13:33:15 +0200
commitc8f36c703d6617fdab91bda6bd9fd5dcaa9f6424 (patch)
tree474893cd572a266fecba1469f4a17dfbb6198cc8 /openpgp/src/crypto/aead.rs
parent6bc14b170562d503710d643d316a26cb92aaf6b7 (diff)
openpgp: Get rid of some write_be_u64 calls
Diffstat (limited to 'openpgp/src/crypto/aead.rs')
-rw-r--r--openpgp/src/crypto/aead.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/openpgp/src/crypto/aead.rs b/openpgp/src/crypto/aead.rs
index 68595d96..19624f70 100644
--- a/openpgp/src/crypto/aead.rs
+++ b/openpgp/src/crypto/aead.rs
@@ -160,8 +160,7 @@ impl<'a> Decryptor<'a> {
fn make_aead(&mut self) -> Result<Box<dyn Aead>> {
// The chunk index is XORed into the IV.
- let mut chunk_index_be64 = vec![0u8; 8];
- write_be_u64(&mut chunk_index_be64, self.chunk_index);
+ let chunk_index_be64 = self.chunk_index.to_be_bytes();
match self.aead {
AEADAlgorithm::EAX => {
@@ -578,8 +577,7 @@ impl<W: io::Write> Encryptor<W> {
fn make_aead(&mut self) -> Result<Box<dyn Aead>> {
// The chunk index is XORed into the IV.
- let mut chunk_index_be64 = vec![0u8; 8];
- write_be_u64(&mut chunk_index_be64, self.chunk_index);
+ let chunk_index_be64 = self.chunk_index.to_be_bytes();
match self.aead {
AEADAlgorithm::EAX => {