summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2023-11-06 15:07:58 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2023-11-06 15:07:58 +0000
commit333f8ab5eb6fc4a9dbfa460e4b4c241ffc91610f (patch)
treeb91ebe3b5cdeb20858b0c67dccca954b6328d5e1 /regress
parent63118232f51f339316721d16e769c923fd80b6f0 (diff)
Add aliases for AES AEAD constructions and ChaCha
These used the wycheproofTestGroupAead type but an upcoming change requires to change this. Introduce the aliases now to make the next diff cleaner.
Diffstat (limited to 'regress')
-rw-r--r--regress/lib/libcrypto/wycheproof/wycheproof.go21
1 files changed, 12 insertions, 9 deletions
diff --git a/regress/lib/libcrypto/wycheproof/wycheproof.go b/regress/lib/libcrypto/wycheproof/wycheproof.go
index 7994e13879e..d9eda15f072 100644
--- a/regress/lib/libcrypto/wycheproof/wycheproof.go
+++ b/regress/lib/libcrypto/wycheproof/wycheproof.go
@@ -1,4 +1,4 @@
-/* $OpenBSD: wycheproof.go,v 1.147 2023/11/06 14:50:12 tb Exp $ */
+/* $OpenBSD: wycheproof.go,v 1.148 2023/11/06 15:07:57 tb Exp $ */
/*
* Copyright (c) 2018 Joel Sing <jsing@openbsd.org>
* Copyright (c) 2018,2019,2022 Theo Buehler <tb@openbsd.org>
@@ -164,6 +164,9 @@ type wycheproofTestGroupAead struct {
Tests []*wycheproofTestAead `json:"tests"`
}
+type wycheproofTestGroupAesAead wycheproofTestGroupAead
+type wycheproofTestGroupChaCha wycheproofTestGroupAead
+
type wycheproofTestAead struct {
TCID int `json:"tcId"`
Comment string `json:"comment"`
@@ -984,7 +987,7 @@ func runAesAeadTest(algorithm string, ctx *C.EVP_CIPHER_CTX, aead *C.EVP_AEAD, w
return openEvp && sealEvp && openAead && sealAead
}
-func runAesAeadTestGroup(algorithm string, wtg *wycheproofTestGroupAead) bool {
+func runAesAeadTestGroup(algorithm string, wtg *wycheproofTestGroupAesAead) bool {
fmt.Printf("Running %v test group %v with IV size %d, key size %d and tag size %d...\n",
algorithm, wtg.Type, wtg.IVSize, wtg.KeySize, wtg.TagSize)
@@ -1288,7 +1291,7 @@ func runChaCha20Poly1305Test(algorithm string, wt *wycheproofTestAead) bool {
return openSuccess && sealSuccess
}
-func runChaCha20Poly1305TestGroup(algorithm string, wtg *wycheproofTestGroupAead) bool {
+func runChaCha20Poly1305TestGroup(algorithm string, wtg *wycheproofTestGroupChaCha) bool {
// ChaCha20-Poly1305 currently only supports nonces of length 12 (96 bits)
if algorithm == "CHACHA20-POLY1305" && wtg.IVSize != 96 {
return true
@@ -2779,13 +2782,13 @@ func runTestVectors(path string, variant testVariant) bool {
case "AES-CBC-PKCS5":
wtg = &wycheproofTestGroupAesCbcPkcs5{}
case "AES-CCM":
- wtg = &wycheproofTestGroupAead{}
+ wtg = &wycheproofTestGroupAesAead{}
case "AES-CMAC":
wtg = &wycheproofTestGroupAesCmac{}
case "AES-GCM":
- wtg = &wycheproofTestGroupAead{}
+ wtg = &wycheproofTestGroupAesAead{}
case "CHACHA20-POLY1305", "XCHACHA20-POLY1305":
- wtg = &wycheproofTestGroupAead{}
+ wtg = &wycheproofTestGroupChaCha{}
case "DSA":
wtg = &wycheproofTestGroupDSA{}
case "ECDH":
@@ -2834,13 +2837,13 @@ func runTestVectors(path string, variant testVariant) bool {
case "AES-CBC-PKCS5":
return runAesCbcPkcs5TestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAesCbcPkcs5))
case "AES-CCM":
- return runAesAeadTestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAead))
+ return runAesAeadTestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAesAead))
case "AES-CMAC":
return runAesCmacTestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAesCmac))
case "AES-GCM":
- return runAesAeadTestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAead))
+ return runAesAeadTestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAesAead))
case "CHACHA20-POLY1305", "XCHACHA20-POLY1305":
- return runChaCha20Poly1305TestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupAead))
+ return runChaCha20Poly1305TestGroup(wtv.Algorithm, wtg.(*wycheproofTestGroupChaCha))
case "DSA":
return runDSATestGroup(wtv.Algorithm, variant, wtg.(*wycheproofTestGroupDSA))
case "ECDH":