From 4fe8d28d31f6556e8c78bf1b409230c32f4db9fd Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 15 May 2024 08:29:37 +0800 Subject: [PATCH] kdf: share Z hash state #220 --- ecdh/ecdh.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ecdh/ecdh.go b/ecdh/ecdh.go index acc4bbe..6ea168c 100644 --- a/ecdh/ecdh.go +++ b/ecdh/ecdh.go @@ -9,7 +9,6 @@ import ( "io" "sync" - "github.com/emmansun/gmsm/kdf" "github.com/emmansun/gmsm/sm3" ) @@ -129,7 +128,7 @@ func (uv *PublicKey) SM2SharedKey(isResponder bool, kenLen int, sPub, sRemote *P copy(buffer[96:], peerZ) } - return kdf.Kdf(sm3.New(), buffer[:], kenLen), nil + return sm3.Kdf(buffer[:], kenLen), nil } // PrivateKey is an ECDH private key, usually kept secret.