haxe-crypto
haxe-crypto copied to clipboard
RSA encryption hangs on JS-target
Hello! I wrote this code:
import com.hurlant.util.ByteArray;
import com.hurlant.util.der.PEM;
class Main {
public static function main() {
var key = PEM.readRSAPrivateKey("<PEM-key-here>");
var src = ByteArray.fromInt32ArrayLE([10, 20, 30, 40]);
var dst = new ByteArray();
key.encrypt(dat, dst, 32);
trace(dst.length);
}
}
I compiled this code to JavaScript and run it in Internet Explorer. However the JavaScript interpreter hangs eating up a lot of memory (when I stopped it it was working for 10min and ate up 350Mb). Seems like an infinite loop or something is going on.
Not maintaining this project myself anymore. If someone else wants to look at this, I will merge PRs.
@Leadlace, Try to use my fork with some fixes (https://github.com/AliEn707/haxe-crypto). I had similar error on flash and native. I am trying to fix it now and planning to do pull request later.