-
Notifications
You must be signed in to change notification settings - Fork 69
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
Create a PSA Crypto Rust wrapper crate #62
Comments
As part of that, we should also make the Mbed Crypto crate dynamically load the C shared library to remove the need of building it ourselves. |
I propose the following design/ideas for the Mbed Crypto crate.
There seems to be a lot of duplication between things we use in the Parsec Rust interface and things we would abstract in this crate. For example, the |
I'm not sure that adds much value - we can have a dependency on the Mbed crypto crate in the interface crate and implement the conversions there. The Mbed-specific structures and some abstractions for the usage patterns should be defined in the Mbed crate, but nothing more |
If I understand correctly, |
You understanding is correct and regarding the
I think 3 is not so bad and could be implemented relatively easily. |
That also made me think that this crate we are going to create, it could/should be a |
It's true that it won't be a huge effort now, but it might end up requiring a lot of maintenance as new versions are released. It's true, though, that the same effort would be required for maintaining handwritten Rust code as well. |
Renamed the issue as creating a crate that interfaces with PSA Crypto and not only Mbed Crypto is a goal of this. |
Yes, your code will break. Don't do that.
|
I'm currently experimenting with this by splitting off part of Parsec into a sub-crate currently called |
The repo has been created at https://github.com/parallaxsecond/rust-psa-crypto |
The wrapper is now in a good shape! The next step is import |
Our Mbed Provider is closely tied to the FFI layer to Mbed Crypto, which lead to questions being raised about the safety of the code, especially around
unsafe
blocks and how such blocks should be handled in the larger context.A sensible solution is to split out the code directly interfacing with Mbed Crypto into its own module/crate, keeping the
unsafe
calls contained.The text was updated successfully, but these errors were encountered: