From 3273b8c2d1477f586cd96a13346f24b6d43d242f Mon Sep 17 00:00:00 2001 From: ucwong Date: Wed, 14 Jan 2026 18:41:37 +0800 Subject: [PATCH] fix block size --- crypto/ecies/ecies.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/ecies/ecies.go b/crypto/ecies/ecies.go index ad856c468c..9f40157012 100644 --- a/crypto/ecies/ecies.go +++ b/crypto/ecies/ecies.go @@ -290,7 +290,7 @@ func (prv *PrivateKey) Decrypt(c, s1, s2 []byte) (m []byte, err error) { switch c[0] { case 2, 3, 4: rLen = (prv.PublicKey.Curve.Params().BitSize + 7) / 4 - if len(c) < (rLen + hLen + 1) { + if len(c) < (rLen + hLen + params.BlockSize) { return nil, ErrInvalidMessage } default: