From 3b17e782747fcd2cf06622324f3d48ad91f64ab3 Mon Sep 17 00:00:00 2001 From: lightclient Date: Fri, 9 Jan 2026 10:38:18 -0700 Subject: [PATCH] crypto/ecies: use aes blocksize Co-authored-by: Gary Rong --- 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 76f934c72d..9a892781f4 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: