summaryrefslogtreecommitdiffstats
path: root/openpgp/src/serialize/stream.rs
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-10-12 14:23:20 +0200
committerNeal H. Walfield <neal@pep.foundation>2019-10-22 23:03:01 +0200
commit1936b7e395304b001d0f6beb13c04c0a931ec489 (patch)
tree15442961493e640b59a275c9a2788e8ce4deb13d /openpgp/src/serialize/stream.rs
parentcb497bd7d74df0c85976ae2ed8c8afccb5070f6e (diff)
openpgp: Use a constant for the default AEAD chunk size.
Diffstat (limited to 'openpgp/src/serialize/stream.rs')
-rw-r--r--openpgp/src/serialize/stream.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/openpgp/src/serialize/stream.rs b/openpgp/src/serialize/stream.rs
index 1ed60aef..cd4ebd15 100644
--- a/openpgp/src/serialize/stream.rs
+++ b/openpgp/src/serialize/stream.rs
@@ -1010,6 +1010,11 @@ impl<'a> Encryptor<'a> {
aead_algo.into())
}
+ // The default chunk size.
+ //
+ // A page, 3 per mille overhead.
+ const AEAD_CHUNK_SIZE : usize = 4096;
+
fn make(mut inner: writer::Stack<'a, Cookie>,
passwords: Vec<&Password>,
recipients: Vec<&Recipient>,
@@ -1033,7 +1038,7 @@ impl<'a> Encryptor<'a> {
crypto::random(&mut nonce);
Some(AEADParameters {
algo: algo,
- chunk_size: 4096, // A page, 3 per mille overhead.
+ chunk_size: Self::AEAD_CHUNK_SIZE,
nonce: nonce.into_boxed_slice(),
})
} else {