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

Chacha20poly1305 versions after and including 0.11.0-pre.1 require alloc on no_std. #643

Closed
ionspin opened this issue Oct 26, 2024 · 4 comments · Fixed by RustCrypto/stream-ciphers#372

Comments

@ionspin
Copy link

ionspin commented Oct 26, 2024

chacha20poly1305 = { version = "0.11.0-pre.1", default-features = false, features = [] }

Build result:

error: no global memory allocator found but one is required; link to std or add `#[global_allocator]` to a static item that implements the GlobalAlloc trait

chacha20poly1305 = { version = "0.10.1", default-features = false, features = [] } builds successfuly.

I might be missing something obvious, it's late here :)

@tarcieri
Copy link
Member

My best guess is chacha20poly1305 has a hard requirement for chacha20/zeroize, and it looks like chacha20 is pulling zeroize in without default-features = false, which is linking liballoc

@newpavlov
Copy link
Member

chacha20poly1305 has a hard requirement for chacha20/zeroize

But why is it a hard requirement? Most other crates have optional support for zeroize.

chacha20 is pulling zeroize in without default-features = false

Yeah, the problem is here.

@tarcieri
Copy link
Member

It was likely introduced in recent changes. I’m on a phone so I would suggest using the git history to answer your question.

@newpavlov
Copy link
Member

newpavlov commented Oct 27, 2024

Hm, it looks like zeroize was an unconditional dependency since v0.1 times. I guess it was an oversight, which did not get noticed until now. Same for some other AEAD crates.

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.

3 participants