crypto/ecies: fix panic on short ciphertext in symDecrypt

This commit is contained in:
BZO95 2026-02-04 17:05:30 +08:00
parent 6530945dcd
commit b8904599e3

View file

@ -221,6 +221,9 @@ func symDecrypt(params *ECIESParams, key, ct []byte) (m []byte, err error) {
if err != nil {
return
}
if len(ct) < params.BlockSize {
return nil, ErrInvalidMessage
}
ctr := cipher.NewCTR(c, ct[:params.BlockSize])