Skip to content

Conversation

@sashass1315
Copy link

This change removes two unnecessary Vec allocations and copies in the SM2 PKE decryption path. In decrypt_der_digest, the result from decrypt_digest already returns a Vec and was being cloned before returning; returning it directly avoids a full plaintext copy. In decrypt, the local buffer c2 was cloned with to_vec right before return; returning c2 directly preserves behavior while eliminating an allocation. These adjustments reduce overhead without altering functionality or public APIs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant