-
-
Notifications
You must be signed in to change notification settings - Fork 769
RustCrypto Traits #1148
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
Comments
OpenSSL's APIs don't align cleanly with rust-crypto's. |
I was on vacation when you commented and closed this. Thanks for looking into it. I think the Rust cryptography ecosystem would benefit if we had a common set of traits e.g. for digests |
@sfackler Either way, we are open to API changes, next version changes are discussed in RustCrypto/traits#43. P.S.: FYI we also plan to integrate OpenSSL assembly into our hash crates. |
The Hasher type uses fallible methods and has a non-fixed output size https://docs.rs/openssl/0.10.25/openssl/hash/struct.Hasher.html |
You always can panic if initialization has failed or algorithm has returned a wrong number of bytes (I don't think the latter should be possible in practice though). We may add fallible initialization methods in future, since they are also can be useful if algorithm is executed on an external hardware. Also, algorithms in the |
What is the "wrong number" of bytes? |
You said it yourself:
So IIUC with OpenSSL API type system does not enforce the fact that |
impl Digest for Hasher {
type OutputSize = /* what goes here? */
} |
You should not implement Also note that you should not implement |
To be clear: I do not argue that RustCrypto traits should be implemented as part of the |
Have you considered to implement rust-openssl so that it implements these traits?
https://github.com/RustCrypto/traits
The text was updated successfully, but these errors were encountered: