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

no_std #6

Open
nickray opened this issue Jan 3, 2020 · 5 comments
Open

no_std #6

nickray opened this issue Jan 3, 2020 · 5 comments

Comments

@nickray
Copy link

nickray commented Jan 3, 2020

Hiya, any plans for no_std compatibility? I'm looking for a DER writer in the context of FIDO2 authenticators (on microcontrollers), and this seems the most minimal implementation I've found.

There are two issues:

  • lack of core::io::Writer (but there's e.g. core_io)
  • lack of Vec and friends (but there's heapless)

Possibly having a default-feature std would go against the "minimal" intent of this library. My alternative plan is to fork this into derpy and do things there.

@heartsucker
Copy link
Owner

I don't have plans for that at the moment, but that is entirely because I threw this crate together to have something minimal for other work I was doing. That said, I think that should be doable, and it would also force me to clean up the API some since it's not super ergonomic. Is this something you could possible help with?

@nickray
Copy link
Author

nickray commented Jan 4, 2020

Maybe! 😊 Although not likely soon, it turns out all I needed is formatting a sequence of two integers: https://github.com/nickray/usbd-ctaphid/blob/main/src/insecure.rs#L105-L147.

I will revisit when I move from "make it work" to "make it right".

@heartsucker
Copy link
Owner

I'll see if I can get this done if a few hours. If so, I can close this. Otherwise, I'll have to get to it another time.

@nickray
Copy link
Author

nickray commented Jan 4, 2020

I did some work in https://github.com/nickray/usbd-ctaphid/blob/e1c02114d1c816d5b65770e70b84790ea677b45d/src/derpy.rs, covers my use case of sequences of integers for ASN.1 DER formatting of ECDSA signatures.
I'm not sure this merits inclusion here (apart from being written a bit more understandably), mainly because there's no real i.e. agreed-upon equivalent for Write in no_std.

@heartsucker
Copy link
Owner

I think what may be reasonable is tidying up the current API and then adding a no_std features that disables all the heap things and leaves only the stack-only things. Because I agree that some of your use cases apply to others, and I think the minimal nature of this crate makes inclusion natural.

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

2 participants