summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/regress/lib/libcrypto/wycheproof/wycheproof.go11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/wycheproof/wycheproof.go b/src/regress/lib/libcrypto/wycheproof/wycheproof.go
index 349227fb36..0681054f41 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.191 2025/09/14 17:03:28 tb Exp $ */ 1/* $OpenBSD: wycheproof.go,v 1.192 2025/09/15 09:43:42 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018,2023 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2018,2019,2022-2025 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2018,2019,2022-2025 Theo Buehler <tb@openbsd.org>
@@ -771,6 +771,7 @@ var evpMds = map[string]*C.EVP_MD{
771 "SHA3-256": C.EVP_sha3_256(), 771 "SHA3-256": C.EVP_sha3_256(),
772 "SHA3-384": C.EVP_sha3_384(), 772 "SHA3-384": C.EVP_sha3_384(),
773 "SHA3-512": C.EVP_sha3_512(), 773 "SHA3-512": C.EVP_sha3_512(),
774 "SM3": C.EVP_sm3(),
774} 775}
775 776
776func hashEvpMdFromString(hs string) (*C.EVP_MD, error) { 777func hashEvpMdFromString(hs string) (*C.EVP_MD, error) {
@@ -2250,6 +2251,10 @@ func (wtg *wycheproofTestGroupHmac) run(algorithm string, variant testVariant) b
2250 if strings.HasPrefix(algorithm, "HMACSHA3-") { 2251 if strings.HasPrefix(algorithm, "HMACSHA3-") {
2251 prefix = "SHA" 2252 prefix = "SHA"
2252 } 2253 }
2254 if algorithm == "HMACSM3" {
2255 prefix = ""
2256 algorithm = "SM3"
2257 }
2253 md, err := hashEvpMdFromString(prefix + strings.TrimPrefix(algorithm, "HMACSHA")) 2258 md, err := hashEvpMdFromString(prefix + strings.TrimPrefix(algorithm, "HMACSHA"))
2254 if err != nil { 2259 if err != nil {
2255 log.Fatalf("Failed to get hash: %v", err) 2260 log.Fatalf("Failed to get hash: %v", err)
@@ -2942,10 +2947,8 @@ func testGroupFromTestVector(wtv *wycheproofTestVectorsV1) (wycheproofTestGroupR
2942 return &wycheproofTestGroupEdDSA{}, variant 2947 return &wycheproofTestGroupEdDSA{}, variant
2943 case "HKDF-SHA-1", "HKDF-SHA-256", "HKDF-SHA-384", "HKDF-SHA-512": 2948 case "HKDF-SHA-1", "HKDF-SHA-256", "HKDF-SHA-384", "HKDF-SHA-512":
2944 return &wycheproofTestGroupHkdf{}, variant 2949 return &wycheproofTestGroupHkdf{}, variant
2945 case "HMACSHA1", "HMACSHA224", "HMACSHA256", "HMACSHA384", "HMACSHA512", "HMACSHA512/224", "HMACSHA512/256", "HMACSHA3-224", "HMACSHA3-256", "HMACSHA3-384", "HMACSHA3-512": 2950 case "HMACSHA1", "HMACSHA224", "HMACSHA256", "HMACSHA384", "HMACSHA512", "HMACSHA512/224", "HMACSHA512/256", "HMACSHA3-224", "HMACSHA3-256", "HMACSHA3-384", "HMACSHA3-512", "HMACSM3":
2946 return &wycheproofTestGroupHmac{}, variant 2951 return &wycheproofTestGroupHmac{}, variant
2947 case "HMACSM3":
2948 return nil, Skip
2949 case "KMAC128", "KMAC256": 2952 case "KMAC128", "KMAC256":
2950 return nil, Skip 2953 return nil, Skip
2951 case "ML-DSA-44", "ML-DSA-65", "ML-DSA-87": 2954 case "ML-DSA-44", "ML-DSA-65", "ML-DSA-87":