You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See http://code.google.com/p/crypto-js/source/detail?r=205 for issue & related
fix.
What steps will reproduce the problem?
1. Create an md5 digest for a 4000 char string.
2. ???
3. Is it all zeroes?
What is the expected output? What do you see instead?
What version of the product are you using? On what operating system?
Please provide any additional information below.
In order to prevent GWT from optimizing out the shift by zero fix, I needed a
variable for which it couldn't infer the value.
int zeroAndNothingElse = Math.sqrt(2) < 5 ? 0 : 1;
H1 = (H1 + a) >>> zeroAndNothingElse;
H2 = (H2 + b) >>> zeroAndNothingElse;
H3 = (H3 + c) >>> zeroAndNothingElse;
H4 = (H4 + d) >>> zeroAndNothingElse;
This fixed the issue for me in
com.googlecode.gwt.crypto.bouncycastle.digests.MD5Digest
I don't know why the zero-shift causes the desired side-effect, or what the
other side effects may be.
Original issue reported on code.google.com by dearm...@gmail.com on 11 Apr 2012 at 1:30
The text was updated successfully, but these errors were encountered:
I'm currently experiencing this same problem.
I"d like a little more clarification about where you applied your zero-shift
fix. Was this towards the bottom of the processBlock() method where it's doing:
H1 += a;
H2 += b;
H3 += c;
H4 += d;
??? Did you simply replace these 4 lines with your zero-shift changes you
mention?
Original comment by drfoste...@gmail.com on 18 Oct 2012 at 5:42
I just copied the src into our tree, renamed it MD5DigestEx, and replaced those
lines, yes.
I don't recall where I read about the shift by zero working, it was in some
other JS-crypto lib.
All of the other sqrt nonsense is there because GWT is really good at
optimizing out shift by 0 and in turn everything that evaluates to 0.
FWIW versions, gwt 2.3.0 and gwt-crypto 2.3.0
Original comment by dearm...@gmail.com on 18 Oct 2012 at 7:09
Could you confirm the error on GWT 2.5, unfortunately GWT is producing a lot of
weird in terms of optimizations which can be harmful for mathematical libraries
such as this one. Please submit a patch if you've found the solution.
Original comment by rame...@gmail.com on 22 Jan 2013 at 9:00
Original issue reported on code.google.com by
dearm...@gmail.com
on 11 Apr 2012 at 1:30The text was updated successfully, but these errors were encountered: