-
Notifications
You must be signed in to change notification settings - Fork 27
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
Implement design #9
Conversation
Moves the shim function in the psa-crypto-sys as they are part of the PSA Crypto API. Deletes the other higher-level functions in favor of the psa-crypto crate design implementation to come. Signed-off-by: Hugues de Valon <[email protected]>
Creates the directory structures, the structures, types and functions as defined in parallaxsecond#8 The implementation is currently only limited to key management and asymmetric signature functions. Signed-off-by: Hugues de Valon <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
I'm assuming you still have some stuff to do around the From
blocks that aren't actually implemented yet?
Also, are we going to keep the algorithms and key properties types here and import them from here in the interface?
fn from(_attributes: Attributes) -> Self { | ||
unsafe { psa_crypto_sys::psa_key_attributes_init() } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be expanded at some point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This is now just a stub to make it compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming you still have some stuff to do around the From blocks that aren't actually implemented yet?
Yes! I did the minimum on those ones to make them compile
Also, are we going to keep the algorithms and key properties types here and import them from here in the interface?
Yes, that was what I thought. Import Type
and Algorithm
mainly I think. In Parsec we have to redefine the Attributes
structure as we do not use lifetimes or we could just use it as it is but leave it unchecked.
fn from(_attributes: Attributes) -> Self { | ||
unsafe { psa_crypto_sys::psa_key_attributes_init() } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes! This is now just a stub to make it compile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Don't hesitate raising issues for bugs or concerns over the design. This is still at the state of "prototype", we shall be adding more tests and examples. |
Implement the design of the
psa-crypto
crate as discussed in #8This is not finished but the PR is done for early reviews/comments.
I decided to remove
id
from theAttributes
as it seemed weird to have this value as both an input of the function (for persistant keys keys) and an output. I replaced it withOption<u32>
which represent a tentative of ID for the called that wants to generate a persistent key.Most of the
Attributes
andAlgorithm
structures were taken from the Parsec Rust Interface. BecauseANY_HASH
can only be used for hash-and-sign algorithm, I decided to remove it from theHash
enumeration and to create theSignHash
one, just for asymmetric signature functions.Things yet to be done: