HerodotusDev / integrity

Apache License 2.0
61 stars 18 forks source link

Optimizations #136

Closed fmkra closed 2 weeks ago

fmkra commented 6 days ago

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()
}