From 4832f53ab5fee85c0cf8a76b0c26a5b926aa13ae Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 17 Dec 2019 08:45:20 +0100 Subject: [PATCH] cipherbench: be conform with rfc7539, use 12 byte nonce else we get an error from this call, using a 16 byte (128 bit) nonce is currently only supported by the still in draft XChaCha20-Poly1305, not the current default specified by RFC 7539[0], which uses a 12 byte (96 bit) nonce. Fixes the following error: > thread 'main' panicked at 'called `Result::unwrap()` on an `Err` > value: ErrorStack([])', src/libcore/result.rs:1165:5 [0]: https://tools.ietf.org/html/rfc7539 Signed-off-by: Thomas Lamprecht --- src/bin/cipherbench.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/cipherbench.rs b/src/bin/cipherbench.rs index 590c1024..7238c09b 100644 --- a/src/bin/cipherbench.rs +++ b/src/bin/cipherbench.rs @@ -69,7 +69,7 @@ fn main() -> Result<(), Error> { openssl::symm::encrypt_aead( cipher, &key, - Some(&iv), + Some(&iv[..12]), b"", &input, &mut tag).unwrap();