-
Notifications
You must be signed in to change notification settings - Fork 119
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
no_std #62
Comments
I am very in favor of supporting no_std, targeting the 0.7 release. I started researching a bit removing our extensive use of |
nice! but reducing heap in general is very welcome |
this is more difficult than expected because cargo will pull in rand with dependencies anyway because its specified somewhere down the default resolver dependencies carving out the default implementation into a separate crate would solve this. would you be ok with it? |
@aep are you running into one of these issues, perhaps? |
yes! its criterion. with this diff it works all of these are upstreamable, except removing criterion, but this isn't even strictly necessary. |
@aep aah yep, I've run into that a lot with One option is to make a |
That change (making separate benches crate in the same workspace) sounds fine to me if it allows us to be |
@aep are you still planning to do any work on this? I am interested in Snow for a variant of PIV I'm implementing on Cortex-M33 microcontrollers, where I'd like to use Noise to establish Secure Messaging. Ideally, I would like to avoid @mcginty how's your research going? One way I'd hope that |
@nickray I'm interested in doing something quite similar! (not PIV or that class of token, but trying to encrypt a channel to a USB device)
I'd suggest using traits from the They're object safe and widely supported. There's an open PR for I see how the current type erasure-based API is convenient. I'm curious if it might make sense to split the API between a monomorphizing version with generic parameters and one that uses Perhaps, with default generic parameters, it'd be possible to make the struct Encryptor<C: Cipher = Box<dyn Cipher>> { ... } I've never tried that before but it seems like it could work? Otherwise it seems like you could split the generic vs type erasing structs into two different ones, and have one wrap the other. |
@nickray unfortunately no. after 5 years of trying to do rust on embedded we have decided that it's not the right tool. Reimplementing noise in zz (https://github.com/aep/zz) was a more effective path than maintaining the hacks necessary to get the last remaining rust code (this crate) working. |
Note: I made a |
@nickray could you please elaborate a bit on why it wasn't the right tool for you? |
That's @aep :) |
Thanks. For what it's worth, async/.await seems to work nicely now on no_std / embedded, after rust-lang/rust#69033 was merged. Then I guess it depends on what kind of system you are targeting, some might be better supported than others. With FFI, one can still reuse all the SDK code, no need to rewrite everything in Rust. |
Yes that's ferrous, not the rust devs, trying to make rust work on embedded. They're doing a great job. i don't think that's the right place to discuss this. everyone in the github issue gets notifications. |
How is progress going on this issue? Is 0.7.0 still the target for no_std support (but with alloc)? |
@benma btw if I get your use case right this might relevant: snow used to support hacl-star which is formally verified high quality crypto by Microsoft research and works fine on embedded. |
Thanks @aep . With custom patches? I am using a no_std environment, which does not seem to be supported yet. |
no, i never got rust really stable. but since it works for you, you might want to use the snow hacl-star resolver which itself is F* not rust, so works fine on embedded. was removed from snow some while ago, probably in an effort to use all rust dependencies |
HACL* support was removed because of a correctness issue in the snow's wrapper for it, but it could be easily added back in. I removed it in the mean time because I didn't want to keep code in snow that I wasn't confident in. |
Could you tell more about the correctness issue? |
we're migrating away from rust, but one of the things that's holding me back is snow, since it's fairly high quality and noise-c is .. not.
how do you feel about supporting no_std? That is, i'll do the majority of the work of course, but you'd have to maintain and defend it later :D
The text was updated successfully, but these errors were encountered: