package java.security; import com.google.gwt.core.client.JsArrayInteger; public class SecureRandom extends java.util.Random { private static final double twoToThe24 = 16777216.0; private static final double twoToThe31 = 2147483648.0; private static final double twoToThe32 = 4294967296.0; private static final double twoToTheMinus24 = 5.9604644775390625e-8; private static final double twoToTheMinus26 = 1.490116119384765625e-8; private static final double twoToTheMinus31 = 4.656612873077392578125e-10; private static final double twoToTheMinus53 = 1.1102230246251565404236316680908203125e-16; protected native JsArrayInteger jsNextChunk() /*-{ var words = $wnd.sjcl.random.randomWords(4); return words; }-*/; public int next(int numBits) { int numBytes = (numBits+7)/8; byte[] bytes = new byte[numBytes]; nextBytes(bytes); int result=0; for (int i=0; i