packages/cafeteria/plugins/cordova-plugin-secure-storage/www/sjcl_ss.js
function(prp, adata) {
    var i,
        times2 = sjcl.mode.ocb2._times2,
        w = sjcl.bitArray,
        xor = w._xor4,
        checksum = [0,0,0,0],
        delta = prp.encrypt([0,0,0,0]),
        bi;

    delta = xor(delta,times2(times2(delta)));

    for (i=0; i+4<adata.length; i+=4) {
      delta = times2(delta);
      checksum = xor(checksum, prp.encrypt(xor(delta, adata.slice(i,i+4))));
    }

    bi = adata.slice(i);
    if (w.bitLength(bi) < 128) {
      delta = xor(delta,times2(delta));
      bi = w.concat(bi,[0x80000000|0,0,0,0]);
    }
    checksum = xor(checksum, bi);
    return prp.encrypt(xor(times2(xor(delta,times2(delta))), checksum));
  }
function(prp, adata) {
    var i,
        times2 = sjcl.mode.ocb2._times2,
        w = sjcl.bitArray,
        xor = w._xor4,
        checksum = [0,0,0,0],
        delta = prp.encrypt([0,0,0,0]),
        bi;

    delta = xor(delta,times2(times2(delta)));

    for (i=0; i+4<adata.length; i+=4) {
      delta = times2(delta);
      checksum = xor(checksum, prp.encrypt(xor(delta, adata.slice(i,i+4))));
    }

    bi = adata.slice(i);
    if (w.bitLength(bi) < 128) {
      delta = xor(delta,times2(delta));
      bi = w.concat(bi,[0x80000000|0,0,0,0]);
    }
    checksum = xor(checksum, bi);
    return prp.encrypt(xor(times2(xor(delta,times2(delta))), checksum));
  }
function ( prp , adata ) { var i , times2 = sjcl . mode . ocb2 . _times2 , w = sjcl . bitArray , xor = w . _xor4 , checksum = [ 0 , 0 , 0 , 0 ] , delta = prp . encrypt ( [ 0 , 0 , 0 , 0 ] ) , bi ; delta = xor ( delta , times2 ( times2 ( delta ) ) ) ; for ( i = 0 ; i + 4 < adata . length ; i += 4 ) { delta = times2 ( delta ) ; checksum = xor ( checksum , prp . encrypt ( xor ( delta , adata . slice ( i , i + 4 ) ) ) ) ; } bi = adata . slice ( i ) ; if ( w . bitLength ( bi ) < 128 ) { delta = xor ( delta , times2 ( delta ) ) ; bi = w . concat ( bi , [ 0x80000000 | 0 , 0 , 0 , 0 ] ) ; } checksum = xor ( checksum , bi ) ; return prp . encrypt ( xor ( times2 ( xor ( delta , times2 ( delta ) ) ) , checksum ) ) ; }
PMAC authentication for OCB associated data.
@param {Object} prp The block cipher.  It must have a block size of 16 bytes.
@param {bitArray} adata The authenticated data.
PMAC authentication for OCB associated data .