From 170f5173ce6081ab0ce8acbf145d7eca55c820dd Mon Sep 17 00:00:00 2001 From: qmuntal Date: Fri, 20 Dec 2024 12:48:53 +0100 Subject: [PATCH] fix openssl 3 --- evp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evp.go b/evp.go index 5ad8653..1fd08fd 100644 --- a/evp.go +++ b/evp.go @@ -156,7 +156,6 @@ func loadHash(ch crypto.Hash) *hashAlgorithm { hash.ch = ch hash.size = int(C.go_openssl_EVP_MD_get_size(hash.md)) hash.blockSize = int(C.go_openssl_EVP_MD_get_block_size(hash.md)) - hash.marshallable = isHashMarshallable(hash.md) if vMajor == 3 { // On OpenSSL 3, directly operating on a EVP_MD object // not created by EVP_MD_fetch has negative performance @@ -169,6 +168,7 @@ func loadHash(ch crypto.Hash) *hashAlgorithm { hash.md = md } } + hash.marshallable = isHashMarshallable(hash.md) cacheMD.Store(ch, &hash) return &hash }