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 <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2019-12-17 08:45:20 +01:00
parent b5907d8ad8
commit 4832f53ab5

View File

@ -69,7 +69,7 @@ fn main() -> Result<(), Error> {
openssl::symm::encrypt_aead(
cipher,
&key,
Some(&iv),
Some(&iv[..12]),
b"",
&input,
&mut tag).unwrap();