crypto/ecies: use aes blocksize (#1946)

Co-authored-by: lightclient <lightclient@protonmail.com>
Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This commit is contained in:
Daniel Liu 2026-01-19 13:55:15 +08:00 committed by GitHub
parent 6aaad7b72f
commit 03da570aca
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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: