I've noticed a side effect using the script found at http://shop-js.sourceforge.net/crypto.js.
The 'bdiv' function makes use of the keyword 'this' to assign two fields to the result : 'q' and 'mod'.
But in the rest of the script, the bdiv function is called like a normal function :
r=bdiv(p,m);
When called this way, the current object reflected by 'this' is the top, 'window' object.
Therefore, after the first execution of this function, we have two global variables defined with the names 'q' and 'mod'.
This can (and did for me) occur very strange behaviour, like replacing global objects named 'q' or 'mod' with a totaly different value.
The patch that worked for me is to use the 'new' keyword when calling the bdiv function :
r = new bdiv(p,m);
Thanks for the good work on this project.
Logged In: NO
This use of new for de bdiv and other functions also solves the problems arising when executing the javascript serverside.
Yves Vanhaesebroeck