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 <mike.munday@ibm.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Filippo Valsorda <filippo@golang.org>
This commit is contained in:
@@ -7,6 +7,13 @@ package chacha20poly1305
|
||||
var chacha20Poly1305Tests = []struct {
|
||||
plaintext, aad, key, nonce, out string
|
||||
}{
|
||||
{
|
||||
"",
|
||||
"",
|
||||
"808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f",
|
||||
"070000004041424344454647",
|
||||
"a0784d7a4716f3feb4f64e7f4b39bf04",
|
||||
},
|
||||
{
|
||||
"4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e",
|
||||
"50515253c0c1c2c3c4c5c6c7",
|
||||
|
||||
Reference in New Issue
Block a user