crypto/ecies: use aes blocksize

Co-authored-by: Gary Rong <garyrong0905@gmail.com>
This commit is contained in:
lightclient 2026-01-09 10:38:18 -07:00 committed by Felix Lange
parent fdfd1235ac
commit 638741b082

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: