From 03da570aca56ef47fe73eb888825a828884e5e22 Mon Sep 17 00:00:00 2001 From: Daniel Liu <139250065@qq.com> Date: Mon, 19 Jan 2026 13:55:15 +0800 Subject: [PATCH] crypto/ecies: use aes blocksize (#1946) Co-authored-by: lightclient 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 b4093a85a6..593f1bd622 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: