From 94e3fad7f1b4eed4ec147751ad6b4c4d33f00611 Mon Sep 17 00:00:00 2001 From: Michael Munday Date: Sun, 13 May 2018 00:40:47 +0100 Subject: [PATCH] chacha20poly1305: add test for empty plaintext and additional data The code (especially assembly implementations) should be able to handle this scenario. Change-Id: I68c6a5b8a099a23a87bfcb5f7246a2134f82bb9e Reviewed-on: https://go-review.googlesource.com/112977 Run-TryBot: Michael Munday TryBot-Result: Gobot Gobot Reviewed-by: Filippo Valsorda --- chacha20poly1305/chacha20poly1305_vectors_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/chacha20poly1305/chacha20poly1305_vectors_test.go b/chacha20poly1305/chacha20poly1305_vectors_test.go index 49f0da6..64f6a72 100644 --- a/chacha20poly1305/chacha20poly1305_vectors_test.go +++ b/chacha20poly1305/chacha20poly1305_vectors_test.go @@ -7,6 +7,13 @@ package chacha20poly1305 var chacha20Poly1305Tests = []struct { plaintext, aad, key, nonce, out string }{ + { + "", + "", + "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f", + "070000004041424344454647", + "a0784d7a4716f3feb4f64e7f4b39bf04", + }, { "4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e", "50515253c0c1c2c3c4c5c6c7",