Open GoogleCodeExporter opened 9 years ago
Attaching a patch which allows the code to compile properly. Not sure if it's a
good
solution to the problem though. Basically replaces the vars that need to be
initialised with getters and in those getters calls a static init method which
does
the initialisation stuff...
Original comment by kelvin.l...@gmail.com
on 21 Aug 2009 at 2:51
Attachments:
Based on comments from:
http://www.mail-archive.com/flashcoders@chattyfig.figleaf.com/msg47315.html
I have fixed up the AESKey.as file so that it is calling a staticInit()
function that
initializes the ByteArray's. Attached is a patch of the changes.
Original comment by shawn.tu...@gmail.com
on 4 Sep 2009 at 8:30
Attachments:
[deleted comment]
[deleted comment]
With what tool have you divided the patch from the source? how can i apply the
patch?
can you provide the updated source somewhere?
Original comment by klingede...@yahoo.de
on 8 Sep 2009 at 3:47
My patch was generated via svn (using subclipse in Eclipse). Not sure about
Shawn's
one but I guess it's the same...
Original comment by kelvin.l...@gmail.com
on 9 Sep 2009 at 2:11
[deleted comment]
Shawn - I think your patch has an issue - around line 222, you're using 'j' to
initialize a loop variable, but the rest of the loop is using the 'i' variable:
+ for (var j:uint = 0; i < _Rcon.length; i++) {
Rcon[i] = _Rcon[i];
}
When I changed the loop to use j exclusively, it was fine. Can you repost your
patch
with the fix?
Original comment by SilentCh...@gmail.com
on 10 Sep 2009 at 10:45
fixed patch attached :) needs some testing, though.
Original comment by gretel....@gmail.com
on 22 Sep 2009 at 1:30
Attachments:
above patch has now been tested by me and is working fine.
Original comment by gretel....@gmail.com
on 22 Sep 2009 at 2:08
Any idea when this will get merged into the trunk?
Original comment by Typi...@gmail.com
on 30 Sep 2009 at 10:58
The patch solution did not work in my case... no errors, but messed up AES
encryption/decryption.
What did work is putting a function declaration where it's missing in the
original
code, then calling it right after. The rest of the code is intact.
private static var i:uint;
private static function staticInitializer():void {
Sbox = new ByteArray;
InvSbox = new ByteArray;
Xtime2Sbox = new ByteArray;
Xtime3Sbox = new ByteArray;
Xtime2 = new ByteArray;
Xtime9 = new ByteArray;
XtimeB = new ByteArray;
XtimeD = new ByteArray;
XtimeE = new ByteArray;
for (i=0;i<256;i++) {
Sbox[i] = _Sbox[i];
InvSbox[i] = _InvSbox[i];
Xtime2Sbox[i] = _Xtime2Sbox[i];
Xtime3Sbox[i] = _Xtime3Sbox[i];
Xtime2[i] = _Xtime2[i];
Xtime9[i] = _Xtime9[i];
XtimeB[i] = _XtimeB[i];
XtimeD[i] = _XtimeD[i];
XtimeE[i] = _XtimeE[i];
}
Rcon = new ByteArray;
for (i=0;i<_Rcon.length;i++) {
Rcon[i] = _Rcon[i];
}
}
staticInitializer();
Tested encrypting/decrypting AES.
Hope this can help.
Original comment by cont...@a-neko.eu
on 9 Oct 2009 at 9:17
a.neko.systems's solution worked for me. odd error. initially tried to call an
init
in the constructor then had to re-read what a "static initializer" really is
Original comment by Dominic....@gmail.com
on 11 Feb 2010 at 10:19
a.neko.system: thanks tons. That solution worked for me as well.
Original comment by agae...@gmail.com
on 9 Dec 2010 at 10:28
Seems this issue is still there... the solution described by a.neko works!
Original comment by JohnPMil...@gmail.com
on 21 Sep 2011 at 3:05
Original issue reported on code.google.com by
kelvin.l...@gmail.com
on 20 Aug 2009 at 5:00