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

Refactoring phase 1: #94

Merged
merged 1 commit into from
Jul 13, 2020

Conversation

Superhepper
Copy link
Collaborator

@Superhepper Superhepper commented Jul 6, 2020

This is part of issue #87

  • Moved context to its own file.

  • Moved algorithm specifiers into own directory.

  • Created new file for algorithm structure.

  • Created new directory for structures.

  • Created sub directory to structures for buffer types.

  • Moved Digest into buffers.

  • Added MaxBuffer to buffers.

  • Added Auth to buffers.

  • Added Data to buffers.

  • Added Nonce to buffers.

  • Created sub directory to structures for name types.

  • Added Name type to names.

  • Made use of these new types in the places I could find they
    where being used.
    Signed-off-by: Jesper Brynolf jesper.brynolf@gmail.com

@Superhepper Superhepper force-pushed the refactoring_phase_1 branch 6 times, most recently from 42715c5 to 622bb91 Compare July 6, 2020 18:48
@Superhepper
Copy link
Collaborator Author

I need some reviews regarding this. It is rather massive.

@Superhepper Superhepper requested a review from hug-dev July 7, 2020 07:36
@hug-dev
Copy link
Member

hug-dev commented Jul 7, 2020

Will have a look today, thanks 💯

Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the great effort! I really like the module tree, I'm guessing you got inspiration from the spec? Looking forward to potentially splitting the Context implementation in multiple files as well.

I've left some comments below, but I don't think I reviewed everything thoroughly enough, might leave some more comments later.

src/structures/buffers/data.rs Outdated Show resolved Hide resolved
src/structures/buffers/digest.rs Show resolved Hide resolved
src/structures/buffers/digest.rs Outdated Show resolved Hide resolved
src/structures/mod.rs Show resolved Hide resolved
src/structures/names/name.rs Outdated Show resolved Hide resolved
src/context.rs Outdated Show resolved Hide resolved
src/context.rs Outdated Show resolved Hide resolved
src/context.rs Outdated Show resolved Hide resolved
src/context.rs Show resolved Hide resolved
src/context.rs Outdated Show resolved Hide resolved
@Superhepper
Copy link
Collaborator Author

Thanks for the great effort! I really like the module tree, I'm guessing you got inspiration from the spec? Looking forward to potentially splitting the Context implementation in multiple files as well.

I've left some comments below, but I don't think I reviewed everything thoroughly enough, might leave some more comments later.

Yeah I looked to the structures part of the spec and tried to basically copy it hehehe.

@Superhepper Superhepper force-pushed the refactoring_phase_1 branch 4 times, most recently from ce0dd19 to 68ac55f Compare July 7, 2020 19:56
src/abstraction/transient.rs Show resolved Hide resolved
src/algorithm/structures/mod.rs Show resolved Hide resolved
src/algorithm/structures/sensitive/data.rs Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/structures/buffers/digest.rs Show resolved Hide resolved
Copy link
Member

@hug-dev hug-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow! Amazing changes, thanks a lot 🚀 That is going to make that crate way more easy to develop with!

Just a few comments.

@Superhepper Superhepper force-pushed the refactoring_phase_1 branch 3 times, most recently from de1e340 to bdaca0d Compare July 11, 2020 12:59
- Moved context to its own file.
- Moved algorithm specifiers into own directory.
- Created new file for algorithm structure.
- Created new for structures.

- Created sub dir to structures for buffer types.
- Moved Digest into buffers.
- Added MaxBuffer to buffers.
- Added Auth to buffers.
- Added Data to buffers.
- Added Nonce to buffers.

- Created sub dir to structures for name types.
- Added Name type to names.

- Made use of these new types in the places I could find they
  where being used.
Signed-off-by: Jesper Brynolf <jesper.brynolf@gmail.com>
@Superhepper Superhepper marked this pull request as ready for review July 11, 2020 15:36
Copy link
Member

@ionut-arm ionut-arm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

src/algorithm/structures/sensitive/data.rs Show resolved Hide resolved
@@ -0,0 +1,51 @@
use std::convert::TryFrom;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just as a note, not necessary for this PR - we might end up moving these tests back into the files where these types are defined. For Context tests they need to be done as integration tests, but if nothing external to the test is needed then it's ok for them to be in the same file as the code they test.

}

impl Nonce {
const MAX_SIZE: usize = 64;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like these, very neat - can they be accessed outside this module? Or, could they be made public? I think it'd be useful for users

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the cannot be acessed outside the module bit ut is no problem changing tjat.

@ionut-arm ionut-arm merged commit d1bee0c into parallaxsecond:master Jul 13, 2020
@Superhepper Superhepper deleted the refactoring_phase_1 branch October 2, 2020 12:34
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

Successfully merging this pull request may close these issues.

3 participants