diff options
author | tb <> | 2018-09-22 14:12:47 +0000 |
---|---|---|
committer | tb <> | 2018-09-22 14:12:47 +0000 |
commit | ba3259c803eaeebf4240133bda37bb7be518fdd9 (patch) | |
tree | 337e8e139ada0a6766a46842c4095150e0815e2d | |
parent | f20a852393dff66f73dc6c66295f94d0d9f15109 (diff) | |
download | openbsd-ba3259c803eaeebf4240133bda37bb7be518fdd9.tar.gz openbsd-ba3259c803eaeebf4240133bda37bb7be518fdd9.tar.bz2 openbsd-ba3259c803eaeebf4240133bda37bb7be518fdd9.zip |
gather statistics in checkAead{Open,Seal}() as well.
-rw-r--r-- | src/regress/lib/libcrypto/wycheproof/wycheproof.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go index 11c99b745a..c7b23b21fc 100644 --- a/src/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/src/regress/lib/libcrypto/wycheproof/wycheproof.go | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: wycheproof.go,v 1.64 2018/09/22 13:42:46 tb Exp $ */ | 1 | /* $OpenBSD: wycheproof.go,v 1.65 2018/09/22 14:12:47 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2018 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> | 4 | * Copyright (c) 2018 Theo Buehler <tb@openbsd.org> |
@@ -882,6 +882,9 @@ func checkAeadOpen(ctx *C.EVP_AEAD_CTX, iv []byte, ivLen int, aad []byte, aadLen | |||
882 | 882 | ||
883 | success := false | 883 | success := false |
884 | if bytes.Equal(openedMsg, msg) || wt.Result == "invalid" { | 884 | if bytes.Equal(openedMsg, msg) || wt.Result == "invalid" { |
885 | if acceptableAudit && wt.Result == "acceptable" { | ||
886 | gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) | ||
887 | } | ||
885 | success = true | 888 | success = true |
886 | } else { | 889 | } else { |
887 | fmt.Printf("FAIL: Test case %d (%q) %v - msg match: %t; want %v\n", wt.TCID, wt.Comment, wt.Flags, bytes.Equal(openedMsg, msg), wt.Result) | 890 | fmt.Printf("FAIL: Test case %d (%q) %v - msg match: %t; want %v\n", wt.TCID, wt.Comment, wt.Flags, bytes.Equal(openedMsg, msg), wt.Result) |
@@ -912,6 +915,9 @@ func checkAeadSeal(ctx *C.EVP_AEAD_CTX, iv []byte, ivLen int, aad []byte, aadLen | |||
912 | 915 | ||
913 | success := false | 916 | success := false |
914 | if bytes.Equal(sealedCt, ct) && bytes.Equal(sealedTag, tag) || wt.Result == "invalid" { | 917 | if bytes.Equal(sealedCt, ct) && bytes.Equal(sealedTag, tag) || wt.Result == "invalid" { |
918 | if acceptableAudit && wt.Result == "acceptable" { | ||
919 | gatherAcceptableStatistics(wt.TCID, wt.Comment, wt.Flags) | ||
920 | } | ||
915 | success = true | 921 | success = true |
916 | } else { | 922 | } else { |
917 | fmt.Printf("FAIL: Test case %d (%q) %v - EVP_AEAD_CTX_seal() = %d, ct match: %t, tag match: %t; want %v\n", wt.TCID, wt.Comment, wt.Flags, int(sealRet), bytes.Equal(sealedCt, ct), bytes.Equal(sealedTag, tag), wt.Result) | 923 | fmt.Printf("FAIL: Test case %d (%q) %v - EVP_AEAD_CTX_seal() = %d, ct match: %t, tag match: %t; want %v\n", wt.TCID, wt.Comment, wt.Flags, int(sealRet), bytes.Equal(sealedCt, ct), bytes.Equal(sealedTag, tag), wt.Result) |