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

Optimizations #136

Merged
merged 16 commits into from
Aug 29, 2024
Merged

Optimizations #136

merged 16 commits into from
Aug 29, 2024

Conversation

fmkra
Copy link
Member

@fmkra fmkra commented Jul 16, 2024

No description provided.

@Okm165 Okm165 self-requested a review August 29, 2024 07:57
Copy link
Collaborator

@Okm165 Okm165 left a comment

Choose a reason for hiding this comment

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

LGTM

@Okm165 Okm165 merged commit af5cf79 into main Aug 29, 2024
14 checks passed
@Okm165 Okm165 deleted the optimizations branch August 29, 2024 08:02
@@ -52,21 +52,26 @@ fn get_sigma(r: u32) -> Array<u32> {
}

fn rotr16(n: u32) -> u32 {
n / 65536 + (n % 65536) * 65536
let (high, low) = DivRem::div_rem(n, 65536);
high + (low % 65536) * 65536

Choose a reason for hiding this comment

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

The % shouldn't be needed

@@ -51,19 +51,23 @@ fn get_sigma(r: u32) -> Array<u32> {
}

fn rotr16(n: u32) -> u32 {
n / 65536 + (n % 65536) * 65536
let (high, low) = DivRem::div_rem(n, 65536);
high + (low % 65536) * 65536

Choose a reason for hiding this comment

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

The % shouldn't be needed

@fmkra fmkra restored the optimizations branch September 9, 2024 10:29
@fmkra
Copy link
Member Author

fmkra commented Sep 9, 2024

I don't know what happened but code fragment you've sent isn't present on this branch. This is already fixed and looks like:

fn rotr12(n: u32) -> u32 {
    let (high, low) = DivRem::div_rem(n, 4096);
    TryInto::<felt252, u32>::try_into(high.into() + low.into() * 1048576).unwrap()
}

@fmkra fmkra deleted the optimizations branch September 9, 2024 10:36
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