aboutsummaryrefslogtreecommitdiff
path: root/internal/stupidgcm/common_test.go
diff options
context:
space:
mode:
authorJakob Unterwurzacher2021-09-02 10:51:51 +0200
committerJakob Unterwurzacher2021-09-07 18:14:05 +0200
commit4017e4b22c2fe1c31dc67163affc49c28fd8c391 (patch)
tree10c77b97b00a6eb66b6da6bcccb95bb118632e31 /internal/stupidgcm/common_test.go
parent591a56e7ae06a5766747eb91cb1e7fade7f3a704 (diff)
stupidgcm: add stupidXchacha20poly1305
Implementation copied from https://github.com/golang/crypto/blob/32db794688a5a24a23a43f2a984cecd5b3d8da58/chacha20poly1305/xchacha20poly1305.go
Diffstat (limited to 'internal/stupidgcm/common_test.go')
-rw-r--r--internal/stupidgcm/common_test.go12
1 files changed, 11 insertions, 1 deletions
diff --git a/internal/stupidgcm/common_test.go b/internal/stupidgcm/common_test.go
index cf555b0..8123ce2 100644
--- a/internal/stupidgcm/common_test.go
+++ b/internal/stupidgcm/common_test.go
@@ -183,8 +183,18 @@ func testWipe(t *testing.T, c cipher.AEAD) {
t.Fatal("c2.key is not zeroed")
}
}
+ case *stupidXchacha20poly1305:
+ c2.Wipe()
+ if !c2.wiped {
+ t.Error("c2.wiped is not set")
+ }
+ for _, v := range c2.key {
+ if v != 0 {
+ t.Fatal("c2.key is not zeroed")
+ }
+ }
default:
- t.Fatalf("BUG: unhandled type %t", c2)
+ t.Fatalf("BUG: unhandled type %T", c2)
}
}