This commit is contained in:
cui 2026-05-23 15:25:06 +00:00 committed by GitHub
commit 99ba8d1ed2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -254,9 +254,12 @@ func Encrypt(rand io.Reader, pub *PublicKey, m, s1, s2 []byte) (ct []byte, err e
Ke, Km := deriveKeys(hash, z, s1, params.KeyLen)
em, err := symEncrypt(rand, params, Ke, m)
if err != nil || len(em) <= params.BlockSize {
if err != nil {
return nil, err
}
if len(em) <= params.BlockSize {
return nil, ErrInvalidMessage
}
d := messageTag(params.Hash, Km, em, s2)