From bf69c9599dec3ae0ff9ab42e38653419a223eb57 Mon Sep 17 00:00:00 2001 From: number571 Date: Thu, 24 Oct 2024 14:10:36 +0700 Subject: [PATCH] update --- pkg/client/client.go | 10 +++++----- test/result/coverage.svg | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pkg/client/client.go b/pkg/client/client.go index 51890eb6..78c9e542 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -89,12 +89,12 @@ func (p *sClient) encryptWithParams( var ( rand = random.NewRandom() salt = rand.GetBytes(cSaltSize) - pkid = p.fPrivKey.GetPubKey().GetHasher().ToBytes() + pkey = p.fPrivKey.GetPubKey() ) data := joiner.NewBytesJoiner32([][]byte{pMsg, rand.GetBytes(pPadd)}) hash := hashing.NewHMACHasher(salt, bytes.Join( - [][]byte{pkid, pRecv.GetHasher().ToBytes(), data}, + [][]byte{pkey.ToBytes(), pRecv.ToBytes(), data}, []byte{}, )).ToBytes() @@ -107,7 +107,7 @@ func (p *sClient) encryptWithParams( return message.NewMessage( ct, cipher.EncryptBytes(joiner.NewBytesJoiner32([][]byte{ - pkid, + pkey.GetHasher().ToBytes(), salt, hash, p.fPrivKey.GetDSAPrivKey().SignBytes(hash), @@ -155,8 +155,8 @@ func (p *sClient) DecryptMessage(pMapPubKeys asymmetric.IMapPubKeys, pMsg []byte // Validate received hash with generated hash. check := hashing.NewHMACHasher(salt, bytes.Join( [][]byte{ - sPubKey.GetHasher().ToBytes(), - p.fPrivKey.GetPubKey().GetHasher().ToBytes(), + sPubKey.ToBytes(), + p.fPrivKey.GetPubKey().ToBytes(), data, }, []byte{}, diff --git a/test/result/coverage.svg b/test/result/coverage.svg index 9cbd05bd..ff061024 100644 --- a/test/result/coverage.svg +++ b/test/result/coverage.svg @@ -7,7 +7,7 @@ > - + - + - + - + - + - +