sjcl.random.startCollectors();
window.getRandomBytes = function(nBytes) {
    return sjcl.random.randomWords(Math.ceil(nBytes / 4));
};

function log(arg) {
    if (typeof console != "undefined" && console.log)
        console.log(arg);
}

@@ -232,8 +232,973 @@
 arg);%0A%7D%0A
+%0A// %22Byte string%22 codec based on sjcl.codec.utf8String. It's pretty%0A// bogus though. We should write a typed array polyfill (either only%0A// supporting DataView or monkey-patching a non-standard%0A// Uint8Array.prototype.get/set so it's not laughingly inefficient.%0Asjcl.codec.byteString = %7B%0A  /** Convert from a bitArray to a byte string. */%0A  fromBits: function (arr) %7B%0A    var out = %22%22, bl = sjcl.bitArray.bitLength(arr), i, tmp;%0A    for (i=0; i%3Cbl/8; i++) %7B%0A      if ((i&3) === 0) %7B%0A        tmp = arr%5Bi/4%5D;%0A      %7D%0A      out += String.fromCharCode(tmp %3E%3E%3E 24);%0A      tmp %3C%3C= 8;%0A    %7D%0A    return out;%0A  %7D,%0A%0A  /** Convert from a byte string to a bitArray. */%0A  toBits: function (str) %7B%0A    var out = %5B%5D, i, tmp=0;%0A    for (i=0; i%3Cstr.length; i++) %7B%0A      tmp = tmp %3C%3C 8 %7C str.charCodeAt(i);%0A      if ((i&3) === 3) %7B%0A        out.push(tmp);%0A        tmp = 0;%0A      %7D%0A    %7D%0A    if (i&3) %7B%0A      out.push(sjcl.bitArray.partial(8*(i&3), tmp));%0A    %7D%0A    return out;%0A  %7D%0A%7D;%0A

Add sjcl.codec.byteString