Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Rustify PKCS7 unpadding#11556

Merged
alex merged 2 commits into
pyca:mainfrom
nitneuqr:rustify-pkcs7-unpadding
Sep 7, 2024
Merged

Rustify PKCS7 unpadding#11556
alex merged 2 commits into
pyca:mainfrom
nitneuqr:rustify-pkcs7-unpadding

Conversation

@nitneuqr

@nitneuqr nitneuqr commented Sep 6, 2024

Copy link
Copy Markdown
Contributor

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
Comment thread src/rust/src/padding.rs Outdated
Comment thread src/rust/src/padding.rs Outdated
@reaperhulk

Copy link
Copy Markdown
Member

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

@nitneuqr

nitneuqr commented Sep 6, 2024

Copy link
Copy Markdown
Contributor Author

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

alex commented Sep 6, 2024 via email

Copy link
Copy Markdown
Member

@nitneuqr

nitneuqr commented Sep 6, 2024

Copy link
Copy Markdown
Contributor Author

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

@nitneuqr

nitneuqr commented Sep 7, 2024

Copy link
Copy Markdown
Contributor Author

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

@alex alex left a comment

Copy link
Copy Markdown
Member

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
@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