Skip to content

Rescue pre-lightest matrix#9

Draft
Al-Kindi-0 wants to merge 4 commits into
mainfrom
feature_rescue2_draft
Draft

Rescue pre-lightest matrix#9
Al-Kindi-0 wants to merge 4 commits into
mainfrom
feature_rescue2_draft

Conversation

@Al-Kindi-0
Copy link
Copy Markdown
Owner

This is an implementation with our more optimized MDS matrix.

feat: impl. a lighter MDS

feat: impl. a lighter MDS

feat: impl. a lighter MDS

feat: impl. a lighter MDS
@Al-Kindi-0 Al-Kindi-0 requested a review from bobbinth July 11, 2022 20:29
Copy link
Copy Markdown
Collaborator

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks great! Just a few small comments inline.

Comment thread crypto/proptest-regressions/hash/rescue/rp64_256/mds_freq.txt Outdated
Comment thread crypto/src/hash/rescue/rp64_256/mod.rs Outdated
Comment thread crypto/src/hash/rescue/rp64_256/mod.rs Outdated
Comment on lines +25 to +28
const MDS_FREQ_BLOCK_ONE: [i64; 3] = [64 >> 2, 32 >> 2, 64 >> 2];
const MDS_FREQ_BLOCK_TWO: [(i64, i64); 3] =
[(-(2 >> 1), 4 >> 1), (-(2 >> 1), 2 >> 1), (8 >> 1, 16 >> 1)];
const MDS_FREQ_BLOCK_THREE: [i64; 3] = [-(32 >> 2), 4 >> 2, 4 >> 2];
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a reason to express these as shifts (e.g. 64 >> 2) rather than just final values (e.g., 16).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

This is done in order to emphasize that the original constants of the matrix are shifted in order to optimize/remove some later shifts in the iFFT2 and iFFT4. Basically it is for illustration purposes but if it is ugly we can remove it and make do with a written explanation.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd probably put the final values in the code, and address the above point in the comments.

feat: impl. a lighter MDS

feat: impl. a lighter MDS

feat: impl. a lighter MDS

feat: impl. a lighter MDS
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.

2 participants