SHARE
TWEET

Untitled

a guest Jul 17th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. use std::num::Wrapping as w;
  2.  
  3. #[no_mangle]
  4. pub fn foo() {
  5.     let mut a = w::<u64>(0x9e3779b97f4a7c13);
  6.     let mut b = w::<u64>(0x9e3779b97f4a7c13);
  7.     let mut c = w::<u64>(0x9e3779b97f4a7c13);
  8.     let mut d = w::<u64>(0x9e3779b97f4a7c13);
  9.     let mut e = w::<u64>(0x9e3779b97f4a7c13);
  10.     let mut f = w::<u64>(0x9e3779b97f4a7c13);
  11.     let mut g = w::<u64>(0x9e3779b97f4a7c13);
  12.     let mut h = w::<u64>(0x9e3779b97f4a7c13);
  13.  
  14.     for _ in 0..4 {
  15.         a=a-e; f=f^(h>>9);  h=h+a;
  16.         b=b-f; g=g^(a<<9);  a=a+b;
  17.         c=c-g; h=h^(b>>23); b=b+c;
  18.         d=d-h; a=a^(c<<15); c=c+d;
  19.         e=e-a; b=b^(d>>14); d=d+e;
  20.         f=f-b; c=c^(e<<20); e=e+f;
  21.         g=g-c; d=d^(f>>17); f=f+g;
  22.         h=h-d; e=e^(g<<14); g=g+h;
  23.     }
  24. }
RAW Paste Data
Top