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

Support no_std in (most) crates #7

Open
daviddrysdale opened this issue Nov 19, 2020 · 3 comments · May be fixed by #189
Open

Support no_std in (most) crates #7

daviddrysdale opened this issue Nov 19, 2020 · 3 comments · May be fixed by #189
Labels
enhancement New feature or request

Comments

@daviddrysdale
Copy link
Collaborator

daviddrysdale commented Nov 19, 2020

First, need a version of prost that includes danburkert/prost@fdf9fdf.

Then the obvious changes needed to make Tink no_std compatible would include the following (but there are bound to be others):

  • Depend on core + alloc instead of std, and have a std feature for those things that definitely need std:
    • keyset I/O (both binary and JSON-based)
    • streaming AEAD
  • Changes to use core / alloc types:
    • Box => alloc::boxed::Box
    • String => alloc::string::String
    • Vec => alloc::vec::Vec
    • std::sync::Arc => alloc::sync::Arc
    • std::fmt::* => core::fmt::*
    • std::collections::HashMap => alloc::collections::BTreeMap
    • std::sync::RwLock => spin::RwLock
    • std::convert::From => core::convert::From
    • Move TinkError to wrap something that just implements core::fmt::Debug rather than std::error::Error.
@daviddrysdale daviddrysdale added the enhancement New feature or request label Jan 10, 2021
@daviddrysdale
Copy link
Collaborator Author

Key question: given that alloc would definitely be required, does (no_std + alloc) really give much advantage over std?

@tiziano88
Copy link

I think in practice it's only useful for targets that do not have std yet, but somehow have alloc already. My guess is that there are not many practical cases for this. Maybe for some embedded devices based on Arm or AVR?

daviddrysdale added a commit that referenced this issue Jan 11, 2021
@daviddrysdale daviddrysdale linked a pull request Jul 19, 2021 that will close this issue
@daviddrysdale
Copy link
Collaborator Author

(Answering my own question: core + alloc works on platforms that have memory, but don't have (say) filesystems, networking, thread scheduling, etc. So yes, it does open up a bunch of potential platforms that std would exclude.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants