www/js/asmcrypto/asmcrypto.all.js
/**
       * Calculates MAC of the supplied data.
       * @instance
       * @memberof AES_asm
       * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)
       * @param {number} pos - offset of the data being processed
       * @param {number} len - length of the data being processed
       * @return {number} Actual amount of data have been processed.
       */
Calculates MAC of the supplied data.
Calculates MAC of the supplied data .
function mac(mode, pos, len) {
        mode = mode | 0;
        pos = pos | 0;
        len = len | 0;
        var ret = 0;
        if (pos & 15) return -1;
        while ((len | 0) >= 16) {
          _mac_modes[mode & 1](
            DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],
            DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],
            DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],
            DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]
          );
          ret = (ret + 16) | 0,
            pos = (pos + 16) | 0,
            len = (len - 16) | 0;
        }
        return ret | 0;
      }
function mac ( mode , pos , len ) { mode = mode | 0 ; pos = pos | 0 ; len = len | 0 ; var ret = 0 ; if ( pos & 15 ) return - 1 ; while ( ( len | 0 ) >= 16 ) { _mac_modes [ mode & 1 ] ( DATA [ pos | 0 ] << 24 | DATA [ pos | 1 ] << 16 | DATA [ pos | 2 ] << 8 | DATA [ pos | 3 ] , DATA [ pos | 4 ] << 24 | DATA [ pos | 5 ] << 16 | DATA [ pos | 6 ] << 8 | DATA [ pos | 7 ] , DATA [ pos | 8 ] << 24 | DATA [ pos | 9 ] << 16 | DATA [ pos | 10 ] << 8 | DATA [ pos | 11 ] , DATA [ pos | 12 ] << 24 | DATA [ pos | 13 ] << 16 | DATA [ pos | 14 ] << 8 | DATA [ pos | 15 ] ) ; ret = ( ret + 16 ) | 0 , pos = ( pos + 16 ) | 0 , len = ( len - 16 ) | 0 ; } return ret | 0 ; }
Calculates MAC of the supplied data.
Calculates MAC of the supplied data .