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

Add a way to estimate the encryption buffer needed size #7

Closed
Keruspe opened this issue Feb 11, 2022 · 1 comment · Fixed by RustCrypto/traits#936
Closed

Add a way to estimate the encryption buffer needed size #7

Keruspe opened this issue Feb 11, 2022 · 1 comment · Fixed by RustCrypto/traits#936

Comments

@Keruspe
Copy link

Keruspe commented Feb 11, 2022

With cipher 0.3 and block-modes 0.8, there used to be some encrypt_vec method which would allocate just enough room for the encrypted data + padding. Having a helper to calculate this size (or restoring some encrypt_padded_vec, and maybe decrypt_padded_vec too, or something like that) would be really helpful.

@newpavlov
Copy link
Member

In general, it should be enough to have one block of reserve space.

I plan to restore the allocating methods in the next cipher release. I wanted to somehow avoid zeroizing allocated output buffers, but, unfortunately, I couldn't find a simple sound solution.

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 a pull request may close this issue.

2 participants