-
Notifications
You must be signed in to change notification settings - Fork 34
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
Refactoring of modules and updating of documentation #197
Comments
@mahmudsudo want to get assigned? If so, can you present a bit of a plan for specifics you want to accomplish? Agreed on this direction though! Thanks for making the issue 👍 |
so aes and others would implement all these seperately:
|
Do you think we need to have the pub trait Encryption {
/// The key type used by this encryption algorithm
type Key;
/// The error type returned by encryption operations
type Error;
/// The data that is input into this scheme for encryption (e.g., blocks, streams, etc.)
type Plaintext;
/// The encrypted form of the data
type Ciphertext;
/// Encrypt data using the provided key
fn encrypt(&self, key: &Self::Key, data: &Self::Plaintext) -> Result<Self::Ciphertext, Self::Error>;
/// Decrypt data using the provided key
fn decrypt(&self, key: &Self::Key, data: &Self::Ciphertext) -> Result<Self::Plaintext, Self::Error>;
} In the case of symmetric encryption, you fundamentally have an equality of these types What do you think? Potentially as well you could imply that the /// Encrypt data using the provided key
fn encrypt(&self, data: &Self::Plaintext) -> Result<Self::Ciphertext, Self::Error>;
/// Decrypt data using the provided key
fn decrypt(&self, data: &Self::Ciphertext) -> Result<Self::Plaintext, Self::Error>; |
Nice , would take this approach |
It's all yours sudo :) |
i took this approach :
is it something satisfactory or do i need to tweak a little bit All optional functions on both stream and block ciphers would be added to their specific impl bodies , instead of having 3 traits , we now have one general trait |
The present documentation does not fully cover the codebase and some modules need refactoring
The text was updated successfully, but these errors were encountered: