Timeline for Gimli, make it even shorter?
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Nov 20, 2019 at 22:50 | comment | added | ceilingcat | 238 | |
Sep 9, 2017 at 19:47 | history | edited | Roberto Graham | CC BY-SA 3.0 |
added 15 characters in body
|
Sep 9, 2017 at 18:26 | history | edited | Roberto Graham | CC BY-SA 3.0 |
added 9 characters in body
|
Sep 9, 2017 at 18:16 | comment | added | hyperneutrino♦ | Order of Operations | |
Sep 9, 2017 at 18:02 | history | edited | Roberto Graham | CC BY-SA 3.0 |
deleted 22 characters in body
|
Sep 9, 2017 at 17:52 | history | edited | Roberto Graham | CC BY-SA 3.0 |
added 5 characters in body
|
Sep 9, 2017 at 16:06 | comment | added | Peter Taylor |
You can make far fewer changes and get 300: void P(int[]S,int a,int b){int x=S[a];S[a]=S[b];S[b]=x;}void gimli(int[]S){for(int r=24,c,x,y,z;r>0;S[0]^=y<1?0x9e377901+r:0){for(c=4;c-->0;){x=S[c]<<24|S[c]>>>8;y=S[c+4]<<9|S[c+4]>>>23;z=S[c+8];S[c]=z^y^8*(x&y);S[c+4]=y^x^2*(x|z);S[c+8]=x^2*z^4*(y&z);}y=r%4;if(--r%2>0){P(S,0,1+y/2);P(S,3,2-y/2);}}} . I've basically made the minimal changes necessary to get it to compile. Java's precedence rules aren't very different to C's.
|
|
Sep 9, 2017 at 14:28 | comment | added | Clashsoft |
Same with s[4+c]>>>(23) .
|
|
Sep 9, 2017 at 14:27 | comment | added | Clashsoft |
s[0]^=(0x9e377900|r); (at the very end) -- can't you drop the extra parentheses?
|
|
Sep 9, 2017 at 12:56 | comment | added | Roberto Graham | @OlivierGrégoire I think just a remnant from me trying Integer.divideUnsigned, but I realised I can have >>> | |
Sep 9, 2017 at 12:55 | history | edited | Roberto Graham | CC BY-SA 3.0 |
added 6 characters in body
|
Sep 9, 2017 at 12:50 | comment | added | Olivier Grégoire |
Why use Integer at all? o_O Since you don't use any Integer method, there's no reason to not use int s here...
|
|
Sep 9, 2017 at 12:34 | history | answered | Roberto Graham | CC BY-SA 3.0 |