Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustify PKCS7 unpadding #11556

Merged
merged 2 commits into from
Sep 7, 2024
Merged

Rustify PKCS7 unpadding #11556

merged 2 commits into from
Sep 7, 2024

Conversation

nitneuqr
Copy link
Contributor

@nitneuqr nitneuqr commented Sep 6, 2024

Opening this as a smaller PR needed for #11555.

I'm new to rust, so please let me know if you see some issues in variable lifetime, or some unnecessary copying between Python & Rust.

cc @alex

refacto: removed check_pkcs7_padding function

refacto: removed python _PKCS7Unpadding
src/rust/src/padding.rs Outdated Show resolved Hide resolved
src/rust/src/padding.rs Outdated Show resolved Hide resolved
@reaperhulk
Copy link
Member

You can remove the pyfunction annotation from check_pkcs7_padding (which should also fix your coverage issue).

@nitneuqr
Copy link
Contributor Author

nitneuqr commented Sep 6, 2024

You can remove the pyfunction annotation from check_pkcs7_padding (which should also fix your coverage issue).

Good catch! Actually, since we're making check_pkcs7_padding private, should we simplify the i/o of the function?

@alex
Copy link
Member

alex commented Sep 6, 2024 via email

@nitneuqr
Copy link
Contributor Author

nitneuqr commented Sep 6, 2024

I'll check it out but saw the constant time part, and not planning on changing anything important on that side

@nitneuqr
Copy link
Contributor Author

nitneuqr commented Sep 7, 2024

Should be better!

You can remove the pyfunction annotation from check_pkcs7_padding (which should also fix your coverage issue).

Good catch! Actually, since we're making check_pkcs7_padding private, should we simplify the i/o of the function?

Just realized this didn't make sense since the function input and output types are not pyo3 already

Copy link
Member

@alex alex left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@alex alex merged commit 36edeb5 into pyca:main Sep 7, 2024
59 checks passed
@nitneuqr nitneuqr deleted the rustify-pkcs7-unpadding branch September 8, 2024 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants