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

Prefer &mut [u8] over returning a newly allocated Vec<u8>; derive the latter from the former #56

Closed
WildCryptoFox opened this issue Sep 3, 2019 · 4 comments

Comments

@WildCryptoFox
Copy link

WildCryptoFox commented Sep 3, 2019

#[no_std] is already common between these crates but when they pull in alloc for Vec, and always allocate, you lose the ability to reuse allocations between calls.

At least an _in_place.

@newpavlov
Copy link
Member

Are you talking about the aead crate? We had a very lengthy discussion about non-allocating API. So we decided to start with a simple non-controversial allocating API and add non-allocating methods later.

@WildCryptoFox
Copy link
Author

@newpavlov I am, though I didn't want to discriminate against other cases where it may apply too. Thanks for the link. Later is fine.

@tarcieri
Copy link
Member

tarcieri commented Sep 3, 2019

I've been meaning to submit a follow-up PR with my thoughts as I'd like to address the in-place API before moving Miscreant over to the traits in the aead crate

@tarcieri
Copy link
Member

We added in-place APIs to the aead crate in #58 and #59

dns2utf8 pushed a commit to dns2utf8/traits that referenced this issue Jan 24, 2023
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

No branches or pull requests

3 participants