 = a & 7;
            x.length = (a >> 3) + 1;
            b.nextBytes(x);
            if (t > 0) x[0] &= ((1 << t) - 1); else x[0] = 0;
            self.fromString(x, 256);
        }
    }

// (public) convert to bigendian byte array
    function bnToByteArray() {
        var self = this;
        var i = self.t, r = new Array();
        r[0] = self.s;
        var p = self.DB - (i * self.DB) % 8, d, k = 0;
        if (i-- > 0) {
            if (p < self.DB && (d = self[i] >> p) != (self.s & self.DM) >> p)
 