From: tb Date: Fri, 24 Sep 2021 20:48:23 +0000 (+0000) Subject: Simplify runAesCmacTest() by using EVP_DigestSign(). X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c23e0ff856be9f3a00e8966c397ceb2f3812b0f7;p=openbsd Simplify runAesCmacTest() by using EVP_DigestSign(). --- diff --git a/regress/lib/libcrypto/wycheproof/wycheproof.go b/regress/lib/libcrypto/wycheproof/wycheproof.go index 4e465a8410a..9b22f1411ec 100644 --- a/regress/lib/libcrypto/wycheproof/wycheproof.go +++ b/regress/lib/libcrypto/wycheproof/wycheproof.go @@ -1,4 +1,4 @@ -/* $OpenBSD: wycheproof.go,v 1.121 2021/04/03 13:34:45 tb Exp $ */ +/* $OpenBSD: wycheproof.go,v 1.122 2021/09/24 20:48:23 tb Exp $ */ /* * Copyright (c) 2018 Joel Sing * Copyright (c) 2018, 2019 Theo Buehler @@ -39,12 +39,6 @@ package main #include #include #include - -int -evpDigestSignUpdate(EVP_MD_CTX *ctx, const void *d, size_t cnt) -{ - return EVP_DigestSignUpdate(ctx, d, cnt); -} */ import "C" @@ -1033,19 +1027,12 @@ func runAesCmacTest(cipher *C.EVP_CIPHER, wt *wycheproofTestAesCmac) bool { return false } - ret = C.evpDigestSignUpdate(mdctx, unsafe.Pointer(&msg[0]), C.size_t(msgLen)) - if ret != 1 { - fmt.Printf("FAIL: Test case %d (%q) %v - EVP_DigestSignUpdate() = %d, want %v\n", - wt.TCID, wt.Comment, wt.Flags, ret, wt.Result) - return false - } - var outLen C.size_t outTag := make([]byte, 16) - ret = C.EVP_DigestSignFinal(mdctx, (*C.uchar)(unsafe.Pointer(&outTag[0])), &outLen) + ret = C.EVP_DigestSign(mdctx, (*C.uchar)(unsafe.Pointer(&outTag[0])), &outLen, (*C.uchar)(unsafe.Pointer(&msg[0])), C.size_t(msgLen)) if ret != 1 { - fmt.Printf("FAIL: Test case %d (%q) %v - EVP_DigestSignFinal() = %d, want %v\n", + fmt.Printf("FAIL: Test case %d (%q) %v - EVP_DigestSign() = %d, want %v\n", wt.TCID, wt.Comment, wt.Flags, ret, wt.Result) return false }