xinghenese / as3crypto

Automatically exported from code.google.com/p/as3crypto
0 stars 0 forks source link

Inconsistent behavior on 64-bit flash runtime in Linux #27

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
We noticed some inconsistent behavior in the BigInteger.as:fromArray and
BigInteger.as:rShiftTo methods that seem to be attributed to some quirky
math problem in the 64-bit flash runtime on linux.

if a bytearray is passed into the constructor 
a[0] = 1
a[1] = 0
a[2] = 1
the correct BigInteger value should be 65537 (2^16+2^0) but 64-bit flash
gets 41.

We were able to workaround this by dumping the results of the bit shifts
into a temporary variable before assigning by bitwise or (|=) in these two
methods.

It seems to be a fairly low level issue with the runtime, and should only
affect people who installed the 64-bit alpha from Adobe labs.

I submitted this bug to Adobe:
http://bugs.adobe.com/jira/browse/FP-2972

Attached are the source/binary for the faulty test case based on
BigInteger:fromArray (i stripped out as much as I could to highlight the
arithmetic error while still being able to reproduce the issue)

Also attached is a changes.txt file which is a from/to for the changes we
made for the workaround.  Sorry no diff file, it's kind of messy due to
other changes we made in the file.

Original issue reported on code.google.com by mael...@gmail.com on 16 Oct 2009 at 6:58

Attachments:

GoogleCodeExporter commented 9 years ago
i included the wrong crypto_debug.swf.  this one is actually compiled from the 
code
attached.

Original comment by mael...@gmail.com on 16 Oct 2009 at 7:04

Attachments:

GoogleCodeExporter commented 9 years ago
Here is a diff that applies the changes documented, thanks for the fix maeldur, 
you
saved me hours of hair pulling.

Original comment by ge...@spacevs.com on 28 Oct 2009 at 11:29

Attachments:

GoogleCodeExporter commented 9 years ago
I've heard reports from people that this is not only a linux issue, but a 
flashplayer 
10.1 issue on all platforms.  I didn't dig into it as deeply as the submitter 
here, but 
I did submit a bug to adobe that sounds similar.  
http://bugs.adobe.com/jira/browse/FP-
3428

Original comment by andrewwe...@gmail.com on 14 Feb 2010 at 1:12