[
  {
    "path": ".editorconfig",
    "content": "[*]\nend_of_line = lf\ninsert_final_newline = true\ncharset = utf-8\nindent_style = space\nindent_size = 2\n"
  },
  {
    "path": ".esmrc",
    "content": "{\n  \"mode\": \"all\",\n  \"cjs\": {\n    \"namedExports\": true,\n    \"vars\": true,\n    \"interop\": true\n  }\n}\n"
  },
  {
    "path": ".gitignore",
    "content": "asmcrypto*.js\nasmcrypto*.mjs\nasmcrypto*.map\ntest/aes.asm.js\ntest/aes.asm.js.map\ndoc/\nnode_modules/\n.idea/\ndist_es5\ndist_es8\n"
  },
  {
    "path": ".npmignore",
    "content": "doc/\nnode_modules/\n.idea/\npackage-lock.json\n*.ts\n!*.d.ts\n"
  },
  {
    "path": ".prettierignore",
    "content": "*.asm.*\n"
  },
  {
    "path": ".prettierrc",
    "content": "{\n  \"printWidth\": 120,\n  \"singleQuote\": true,\n  \"trailingComma\": \"all\"\n}\n"
  },
  {
    "path": ".travis.yml",
    "content": "language: node_js\nnode_js:\n- '10'\n- '12'\n- '14'\nscript:\n  npm test\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2013 Artem S Vybornov\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "asmCrypto \n=========\n\nNot maintained anymore, use a native or WASM implementation instead.\n"
  },
  {
    "path": "build.js",
    "content": "import * as fs from 'fs-extra';\nimport ts from 'typescript';\nimport * as rollup from 'rollup';\n\n(async function() {\n  // Delete old\n  await fs.remove('dist_es5');\n  await fs.remove('dist_es8');\n\n  // Run ts\n  const raw_config = await fs.readFile('tsconfig.json', 'utf8');\n  const options_es5_raw = JSON.parse(raw_config).compilerOptions;\n  options_es5_raw.target = 'es5';\n  options_es5_raw.outDir = 'dist_es5';\n  const options_es8_raw = JSON.parse(raw_config).compilerOptions;\n\n  const options_es5 = ts.convertCompilerOptionsFromJson(options_es5_raw, '.');\n  const options_es8 = ts.convertCompilerOptionsFromJson(options_es8_raw, '.');\n\n  const program_es5 = ts.createProgram(['src/entry-export_all.ts'], options_es5.options);\n  const program_es8 = ts.createProgram(['src/entry-export_all.ts'], options_es8.options);\n  const result_es5 = program_es5.emit();\n  if (result_es5.emitSkipped) {\n    throw new Error(result_es5.diagnostics[0].messageText);\n  }\n  const result_es8 = program_es8.emit();\n  if (result_es8.emitSkipped) {\n    throw new Error(result_es8.diagnostics[0].messageText);\n  }\n\n  // Copy non-ts resources\n  await fs.copy('src/aes/aes.asm.js', 'dist_es5/aes/aes.asm.js');\n  await fs.copy('src/aes/aes.asm.d.ts', 'dist_es5/aes/aes.asm.d.ts');\n  await fs.copy('src/aes/aes.asm.js', 'dist_es8/aes/aes.asm.js');\n  await fs.copy('src/aes/aes.asm.d.ts', 'dist_es8/aes/aes.asm.d.ts');\n\n  await fs.copy('src/bignum/bigint.asm.js', 'dist_es5/bignum/bigint.asm.js');\n  await fs.copy('src/bignum/bigint.asm.d.ts', 'dist_es5/bignum/bigint.asm.d.ts');\n  await fs.copy('src/bignum/bigint.asm.js', 'dist_es8/bignum/bigint.asm.js');\n  await fs.copy('src/bignum/bigint.asm.d.ts', 'dist_es8/bignum/bigint.asm.d.ts');\n\n  await fs.copy('src/hash/sha1/sha1.asm.js', 'dist_es5/hash/sha1/sha1.asm.js');\n  await fs.copy('src/hash/sha1/sha1.asm.d.ts', 'dist_es5/hash/sha1/sha1.asm.d.ts');\n  await fs.copy('src/hash/sha1/sha1.asm.js', 'dist_es8/hash/sha1/sha1.asm.js');\n  await fs.copy('src/hash/sha1/sha1.asm.d.ts', 'dist_es8/hash/sha1/sha1.asm.d.ts');\n\n  await fs.copy('src/hash/sha256/sha256.asm.js', 'dist_es5/hash/sha256/sha256.asm.js');\n  await fs.copy('src/hash/sha256/sha256.asm.d.ts', 'dist_es5/hash/sha256/sha256.asm.d.ts');\n  await fs.copy('src/hash/sha256/sha256.asm.js', 'dist_es8/hash/sha256/sha256.asm.js');\n  await fs.copy('src/hash/sha256/sha256.asm.d.ts', 'dist_es8/hash/sha256/sha256.asm.d.ts');\n\n  await fs.copy('src/hash/sha512/sha512.asm.js', 'dist_es5/hash/sha512/sha512.asm.js');\n  await fs.copy('src/hash/sha512/sha512.asm.d.ts', 'dist_es5/hash/sha512/sha512.asm.d.ts');\n  await fs.copy('src/hash/sha512/sha512.asm.js', 'dist_es8/hash/sha512/sha512.asm.js');\n  await fs.copy('src/hash/sha512/sha512.asm.d.ts', 'dist_es8/hash/sha512/sha512.asm.d.ts');\n\n  const es5bundle = await rollup.rollup({\n    input: 'dist_es5/entry-export_all.js',\n    onwarn(warning, warn) {\n      if (warning.code === 'THIS_IS_UNDEFINED') return;\n      warn(warning); // this requires Rollup 0.46\n    },\n  });\n\n  // Legacy browser export, as a bundle\n  await es5bundle.write({\n    file: 'asmcrypto.all.es5.js',\n    format: 'iife',\n    name: 'asmCrypto',\n  });\n\n  // Legacy browser export, as a bundle\n  await es5bundle.write({\n    file: 'asmcrypto.all.es5.mjs',\n    format: 'es',\n  });\n\n  // NodeJS old\n  await es5bundle.write({\n    file: 'asmcrypto.all.js',\n    format: 'cjs',\n  });\n\n  // Modern export, eg. Chrome or NodeJS 10 with ESM\n  const es8bundle = await rollup.rollup({\n    input: 'dist_es8/entry-export_all.js',\n    onwarn(warning, warn) {\n      if (warning.code === 'THIS_IS_UNDEFINED') return;\n      warn(warning); // this requires Rollup 0.46\n    },\n  });\n  await es8bundle.write({\n    file: 'asmcrypto.all.es8.js',\n    format: 'es',\n  });\n\n  console.log('Build complete');\n})();\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"asmcrypto.js\",\n  \"version\": \"2.3.2\",\n  \"description\": \"Asm.js implementation of WebCrypto API\",\n  \"homepage\": \"https://github.com/asmcrypto/asmcrypto.js\",\n  \"main\": \"asmcrypto.all.js\",\n  \"module\": \"asmcrypto.all.es8.js\",\n  \"license\": \"MIT\",\n  \"author\": {\n    \"name\": \"Ádám Lippai\",\n    \"email\": \"adam@rigo.sk\",\n    \"web\": \"https://github.com/alippai\"\n  },\n  \"contributors\": [\n    {\n      \"name\": \"Artem S Vybornov\",\n      \"email\": \"vybornov@gmail.com\",\n      \"web\": \"https://github.com/vibornoff\"\n    },\n    {\n      \"name\": \"Ximin Luo\",\n      \"email\": \"infinity0@pwned.gg\",\n      \"web\": \"https://github.com/infinity0\"\n    }\n  ],\n  \"repository\": {\n    \"type\": \"git\",\n    \"url\": \"https://github.com/asmcrypto/asmcrypto.js.git\"\n  },\n  \"devDependencies\": {\n    \"@types/chai\": \"^4.1.7\",\n    \"@types/mocha\": \"^8.0.3\",\n    \"@types/node\": \"^10.12.2\",\n    \"chai\": \"^4.2.0\",\n    \"esm\": \"3.2.25\",\n    \"fs-extra\": \"^9.0.1\",\n    \"mocha\": \"^8.1.3\",\n    \"prettier\": \"^1.14.3\",\n    \"rollup\": \"2.28.1\",\n    \"ts-node\": \"^7.0.1\",\n    \"tslint\": \"^5.11.0\",\n    \"tslint-plugin-prettier\": \"^2.0.1\",\n    \"typescript\": \"^3.1.6\"\n  },\n  \"scripts\": {\n    \"prepare\": \"node -r esm build.js\",\n    \"test\": \"node -r esm build.js && mocha -r esm test/*.js\",\n    \"prettier\": \"prettier --single-quote --trailing-comma all --write \\\"src/**/*.js\\\" \\\"src/**/*.ts\\\" --print-width 120\"\n  },\n  \"typings\": \"./dist_es8/entry-export_all.d.ts\",\n  \"dependencies\": {}\n}\n"
  },
  {
    "path": "src/aes/aes.asm.d.ts",
    "content": "declare type AES_mode = 'ECB' | 'CBC' | 'CFB' | 'OFB' | 'CTR' | 'CCM';\nexport class AES_asm {\n  constructor(foreign: any, heap: ArrayBuffer);\n\n  /**\n   * @param ks - key size, 4/6/8 (for 128/192/256-bit key correspondingly)\n   * @param k0 - key vector components\n   * @param k1 - key vector components\n   * @param k2 - key vector components\n   * @param k3 - key vector components\n   * @param k4 - key vector components\n   * @param k5 - key vector components\n   * @param k6 - key vector components\n   * @param k7 - key vector components\n   */\n  set_key(\n    ks: number,\n    k0: number,\n    k1: number,\n    k2: number,\n    k3: number,\n    k4: number,\n    k5: number,\n    k6: number,\n    k7: number,\n  ): void;\n\n  /**\n   * Populate the internal iv of the module\n   */\n  set_iv(i0: number, i1: number, i2: number, i3: number): void;\n\n  /**\n   * Set counter mask for CTR-family modes\n   */\n  set_mask(m0: number, m1: number, m2: number, m3: number): void;\n\n  /**\n   * Set nonce for CTR-family modes\n   */\n  set_nonce(n0: number, n1: number, n2: number, n3: number): void;\n\n  /**\n   * Set counter for CTR-family modes\n   */\n  set_counter(c0: number, c1: number, c2: number, c3: number): void;\n\n  /**\n   * Perform ciphering operation on the supplied data\n   *\n   * @param mode - block cipher mode (see {@link AES_asm} mode constants)\n   * @param pos - offset of the data being processed\n   * @param len - length of the data being processed\n   * @return Actual amount of data have been processed\n   */\n  cipher(mode: number, pos: number, len: number): number;\n\n  /**\n   * GCM initialization\n   */\n  gcm_init(): void;\n\n  /**\n   * Store the internal iv vector into the heap\n   *\n   * @returns The number of bytes have been written into the heap, always 16\n   */\n  get_iv(pos: number): 16;\n\n  /**\n   * Calculates MAC of the supplied data\n   *\n   * @param mode - block cipher mode (see {@link AES_asm} mode constants)\n   * @param pos - offset of the data being processed\n   * @param len - length of the data being processed\n   * @return Actual amount of data have been processed\n   */\n  mac(mode: number, pos: number, len: number): number;\n\n  /**\n   * Store the internal state vector into the heap.\n   *\n   * @param pos - offset where to put the data\n   * @return The number of bytes have been written into the heap, always 16.\n   */\n  get_state(pos: number): 16;\n\n  /**\n   * AES enciphering mode constants\n   */\n  static ENC: {\n    ECB: 0;\n    CBC: 2;\n    CFB: 4;\n    OFB: 6;\n    CTR: 7;\n    [key: string]: number;\n  };\n\n  /**\n   * AES deciphering mode constants\n   */\n  static DEC: {\n    ECB: 1;\n    CBC: 3;\n    CFB: 5;\n    OFB: 6;\n    CTR: 7;\n    [key: string]: number;\n  };\n\n  /**\n   * AES MAC mode constants\n   */\n  static MAC: {\n    CBC: 0;\n    GCM: 1;\n    [key: string]: number;\n  };\n\n  static HEAP_DATA: number;\n}\n"
  },
  {
    "path": "src/aes/aes.asm.js",
    "content": "/**\n * @file {@link http://asmjs.org Asm.js} implementation of the {@link https://en.wikipedia.org/wiki/Advanced_Encryption_Standard Advanced Encryption Standard}.\n * @author Artem S Vybornov <vybornov@gmail.com>\n * @license MIT\n */\nexport var AES_asm = function () {\n  \"use strict\";\n\n  /**\n   * Galois Field stuff init flag\n   */\n  var ginit_done = false;\n\n  /**\n   * Galois Field exponentiation and logarithm tables for 3 (the generator)\n   */\n  var gexp3, glog3;\n\n  /**\n   * Init Galois Field tables\n   */\n  function ginit() {\n    gexp3 = [],\n      glog3 = [];\n\n    var a = 1, c, d;\n    for (c = 0; c < 255; c++) {\n      gexp3[c] = a;\n\n      // Multiply by three\n      d = a & 0x80, a <<= 1, a &= 255;\n      if (d === 0x80) a ^= 0x1b;\n      a ^= gexp3[c];\n\n      // Set the log table value\n      glog3[gexp3[c]] = c;\n    }\n    gexp3[255] = gexp3[0];\n    glog3[0] = 0;\n\n    ginit_done = true;\n  }\n\n  /**\n   * Galois Field multiplication\n   * @param {number} a\n   * @param {number} b\n   * @return {number}\n   */\n  function gmul(a, b) {\n    var c = gexp3[(glog3[a] + glog3[b]) % 255];\n    if (a === 0 || b === 0) c = 0;\n    return c;\n  }\n\n  /**\n   * Galois Field reciprocal\n   * @param {number} a\n   * @return {number}\n   */\n  function ginv(a) {\n    var i = gexp3[255 - glog3[a]];\n    if (a === 0) i = 0;\n    return i;\n  }\n\n  /**\n   * AES stuff init flag\n   */\n  var aes_init_done = false;\n\n  /**\n   * Encryption, Decryption, S-Box and KeyTransform tables\n   *\n   * @type {number[]}\n   */\n  var aes_sbox;\n\n  /**\n   * @type {number[]}\n   */\n  var aes_sinv;\n\n  /**\n   * @type {number[][]}\n   */\n  var aes_enc;\n\n  /**\n   * @type {number[][]}\n   */\n  var aes_dec;\n\n  /**\n   * Init AES tables\n   */\n  function aes_init() {\n    if (!ginit_done) ginit();\n\n    // Calculates AES S-Box value\n    function _s(a) {\n      var c, s, x;\n      s = x = ginv(a);\n      for (c = 0; c < 4; c++) {\n        s = ((s << 1) | (s >>> 7)) & 255;\n        x ^= s;\n      }\n      x ^= 99;\n      return x;\n    }\n\n    // Tables\n    aes_sbox = [],\n      aes_sinv = [],\n      aes_enc = [[], [], [], []],\n      aes_dec = [[], [], [], []];\n\n    for (var i = 0; i < 256; i++) {\n      var s = _s(i);\n\n      // S-Box and its inverse\n      aes_sbox[i] = s;\n      aes_sinv[s] = i;\n\n      // Ecryption and Decryption tables\n      aes_enc[0][i] = (gmul(2, s) << 24) | (s << 16) | (s << 8) | gmul(3, s);\n      aes_dec[0][s] = (gmul(14, i) << 24) | (gmul(9, i) << 16) | (gmul(13, i) << 8) | gmul(11, i);\n      // Rotate tables\n      for (var t = 1; t < 4; t++) {\n        aes_enc[t][i] = (aes_enc[t - 1][i] >>> 8) | (aes_enc[t - 1][i] << 24);\n        aes_dec[t][s] = (aes_dec[t - 1][s] >>> 8) | (aes_dec[t - 1][s] << 24);\n      }\n    }\n\n    aes_init_done = true;\n  }\n\n  /**\n   * Asm.js module constructor.\n   *\n   * <p>\n   * Heap buffer layout by offset:\n   * <pre>\n   * 0x0000   encryption key schedule\n   * 0x0400   decryption key schedule\n   * 0x0800   sbox\n   * 0x0c00   inv sbox\n   * 0x1000   encryption tables\n   * 0x2000   decryption tables\n   * 0x3000   reserved (future GCM multiplication lookup table)\n   * 0x4000   data\n   * </pre>\n   * Don't touch anything before <code>0x400</code>.\n   * </p>\n   *\n   * @alias AES_asm\n   * @class\n   * @param foreign - <i>ignored</i>\n   * @param buffer - heap buffer to link with\n   */\n  var wrapper = function (foreign, buffer) {\n    // Init AES stuff for the first time\n    if (!aes_init_done) aes_init();\n\n    // Fill up AES tables\n    var heap = new Uint32Array(buffer);\n    heap.set(aes_sbox, 0x0800 >> 2);\n    heap.set(aes_sinv, 0x0c00 >> 2);\n    for (var i = 0; i < 4; i++) {\n      heap.set(aes_enc[i], (0x1000 + 0x400 * i) >> 2);\n      heap.set(aes_dec[i], (0x2000 + 0x400 * i) >> 2);\n    }\n\n    /**\n     * Calculate AES key schedules.\n     * @instance\n     * @memberof AES_asm\n     * @param {number} ks - key size, 4/6/8 (for 128/192/256-bit key correspondingly)\n     * @param {number} k0 - key vector components\n     * @param {number} k1 - key vector components\n     * @param {number} k2 - key vector components\n     * @param {number} k3 - key vector components\n     * @param {number} k4 - key vector components\n     * @param {number} k5 - key vector components\n     * @param {number} k6 - key vector components\n     * @param {number} k7 - key vector components\n     */\n    function set_key(ks, k0, k1, k2, k3, k4, k5, k6, k7) {\n      var ekeys = heap.subarray(0x000, 60),\n        dkeys = heap.subarray(0x100, 0x100 + 60);\n\n      // Encryption key schedule\n      ekeys.set([k0, k1, k2, k3, k4, k5, k6, k7]);\n      for (var i = ks, rcon = 1; i < 4 * ks + 28; i++) {\n        var k = ekeys[i - 1];\n        if ((i % ks === 0) || (ks === 8 && i % ks === 4)) {\n          k = aes_sbox[k >>> 24] << 24 ^ aes_sbox[k >>> 16 & 255] << 16 ^ aes_sbox[k >>> 8 & 255] << 8 ^ aes_sbox[k & 255];\n        }\n        if (i % ks === 0) {\n          k = (k << 8) ^ (k >>> 24) ^ (rcon << 24);\n          rcon = (rcon << 1) ^ ((rcon & 0x80) ? 0x1b : 0);\n        }\n        ekeys[i] = ekeys[i - ks] ^ k;\n      }\n\n      // Decryption key schedule\n      for (var j = 0; j < i; j += 4) {\n        for (var jj = 0; jj < 4; jj++) {\n          var k = ekeys[i - (4 + j) + (4 - jj) % 4];\n          if (j < 4 || j >= i - 4) {\n            dkeys[j + jj] = k;\n          } else {\n            dkeys[j + jj] = aes_dec[0][aes_sbox[k >>> 24]]\n              ^ aes_dec[1][aes_sbox[k >>> 16 & 255]]\n              ^ aes_dec[2][aes_sbox[k >>> 8 & 255]]\n              ^ aes_dec[3][aes_sbox[k & 255]];\n          }\n        }\n      }\n\n      // Set rounds number\n      asm.set_rounds(ks + 5);\n    }\n\n    // create library object with necessary properties\n    var stdlib = {Uint8Array: Uint8Array, Uint32Array: Uint32Array};\n\n    var asm = function (stdlib, foreign, buffer) {\n      \"use asm\";\n\n      var S0 = 0, S1 = 0, S2 = 0, S3 = 0,\n        I0 = 0, I1 = 0, I2 = 0, I3 = 0,\n        N0 = 0, N1 = 0, N2 = 0, N3 = 0,\n        M0 = 0, M1 = 0, M2 = 0, M3 = 0,\n        H0 = 0, H1 = 0, H2 = 0, H3 = 0,\n        R = 0;\n\n      var HEAP = new stdlib.Uint32Array(buffer),\n        DATA = new stdlib.Uint8Array(buffer);\n\n      /**\n       * AES core\n       * @param {number} k - precomputed key schedule offset\n       * @param {number} s - precomputed sbox table offset\n       * @param {number} t - precomputed round table offset\n       * @param {number} r - number of inner rounds to perform\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _core(k, s, t, r, x0, x1, x2, x3) {\n        k = k | 0;\n        s = s | 0;\n        t = t | 0;\n        r = r | 0;\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var t1 = 0, t2 = 0, t3 = 0,\n          y0 = 0, y1 = 0, y2 = 0, y3 = 0,\n          i = 0;\n\n        t1 = t | 0x400, t2 = t | 0x800, t3 = t | 0xc00;\n\n        // round 0\n        x0 = x0 ^ HEAP[(k | 0) >> 2],\n          x1 = x1 ^ HEAP[(k | 4) >> 2],\n          x2 = x2 ^ HEAP[(k | 8) >> 2],\n          x3 = x3 ^ HEAP[(k | 12) >> 2];\n\n        // round 1..r\n        for (i = 16; (i | 0) <= (r << 4); i = (i + 16) | 0) {\n          y0 = HEAP[(t | x0 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x1 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x2 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x3 << 2 & 1020) >> 2] ^ HEAP[(k | i | 0) >> 2],\n            y1 = HEAP[(t | x1 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x2 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x3 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x0 << 2 & 1020) >> 2] ^ HEAP[(k | i | 4) >> 2],\n            y2 = HEAP[(t | x2 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x3 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x0 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x1 << 2 & 1020) >> 2] ^ HEAP[(k | i | 8) >> 2],\n            y3 = HEAP[(t | x3 >> 22 & 1020) >> 2] ^ HEAP[(t1 | x0 >> 14 & 1020) >> 2] ^ HEAP[(t2 | x1 >> 6 & 1020) >> 2] ^ HEAP[(t3 | x2 << 2 & 1020) >> 2] ^ HEAP[(k | i | 12) >> 2];\n          x0 = y0, x1 = y1, x2 = y2, x3 = y3;\n        }\n\n        // final round\n        S0 = HEAP[(s | x0 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x1 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x2 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x3 << 2 & 1020) >> 2] ^ HEAP[(k | i | 0) >> 2],\n          S1 = HEAP[(s | x1 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x2 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x3 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x0 << 2 & 1020) >> 2] ^ HEAP[(k | i | 4) >> 2],\n          S2 = HEAP[(s | x2 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x3 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x0 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x1 << 2 & 1020) >> 2] ^ HEAP[(k | i | 8) >> 2],\n          S3 = HEAP[(s | x3 >> 22 & 1020) >> 2] << 24 ^ HEAP[(s | x0 >> 14 & 1020) >> 2] << 16 ^ HEAP[(s | x1 >> 6 & 1020) >> 2] << 8 ^ HEAP[(s | x2 << 2 & 1020) >> 2] ^ HEAP[(k | i | 12) >> 2];\n      }\n\n      /**\n       * ECB mode encryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ecb_enc(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          x0,\n          x1,\n          x2,\n          x3\n        );\n      }\n\n      /**\n       * ECB mode decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ecb_dec(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var t = 0;\n\n        _core(\n          0x0400, 0x0c00, 0x2000,\n          R,\n          x0,\n          x3,\n          x2,\n          x1\n        );\n\n        t = S1, S1 = S3, S3 = t;\n      }\n\n\n      /**\n       * CBC mode encryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cbc_enc(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0 ^ x0,\n          I1 ^ x1,\n          I2 ^ x2,\n          I3 ^ x3\n        );\n\n        I0 = S0,\n          I1 = S1,\n          I2 = S2,\n          I3 = S3;\n      }\n\n      /**\n       * CBC mode decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cbc_dec(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var t = 0;\n\n        _core(\n          0x0400, 0x0c00, 0x2000,\n          R,\n          x0,\n          x3,\n          x2,\n          x1\n        );\n\n        t = S1, S1 = S3, S3 = t;\n\n        S0 = S0 ^ I0,\n          S1 = S1 ^ I1,\n          S2 = S2 ^ I2,\n          S3 = S3 ^ I3;\n\n        I0 = x0,\n          I1 = x1,\n          I2 = x2,\n          I3 = x3;\n      }\n\n      /**\n       * CFB mode encryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cfb_enc(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0,\n          I1,\n          I2,\n          I3\n        );\n\n        I0 = S0 = S0 ^ x0,\n          I1 = S1 = S1 ^ x1,\n          I2 = S2 = S2 ^ x2,\n          I3 = S3 = S3 ^ x3;\n      }\n\n\n      /**\n       * CFB mode decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _cfb_dec(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0,\n          I1,\n          I2,\n          I3\n        );\n\n        S0 = S0 ^ x0,\n          S1 = S1 ^ x1,\n          S2 = S2 ^ x2,\n          S3 = S3 ^ x3;\n\n        I0 = x0,\n          I1 = x1,\n          I2 = x2,\n          I3 = x3;\n      }\n\n      /**\n       * OFB mode encryption / decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ofb(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          I0,\n          I1,\n          I2,\n          I3\n        );\n\n        I0 = S0,\n          I1 = S1,\n          I2 = S2,\n          I3 = S3;\n\n        S0 = S0 ^ x0,\n          S1 = S1 ^ x1,\n          S2 = S2 ^ x2,\n          S3 = S3 ^ x3;\n      }\n\n      /**\n       * CTR mode encryption / decryption\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _ctr(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        _core(\n          0x0000, 0x0800, 0x1000,\n          R,\n          N0,\n          N1,\n          N2,\n          N3\n        );\n\n        N3 = (~M3 & N3) | M3 & (N3 + 1);\n          N2 = (~M2 & N2) | M2 & (N2 + ((N3 | 0) == 0));\n          N1 = (~M1 & N1) | M1 & (N1 + ((N2 | 0) == 0));\n          N0 = (~M0 & N0) | M0 & (N0 + ((N1 | 0) == 0));\n\n        S0 = S0 ^ x0;\n          S1 = S1 ^ x1;\n          S2 = S2 ^ x2;\n          S3 = S3 ^ x3;\n      }\n\n      /**\n       * GCM mode MAC calculation\n       * @param {number} x0 - 128-bit input block vector\n       * @param {number} x1 - 128-bit input block vector\n       * @param {number} x2 - 128-bit input block vector\n       * @param {number} x3 - 128-bit input block vector\n       */\n      function _gcm_mac(x0, x1, x2, x3) {\n        x0 = x0 | 0;\n        x1 = x1 | 0;\n        x2 = x2 | 0;\n        x3 = x3 | 0;\n\n        var y0 = 0, y1 = 0, y2 = 0, y3 = 0,\n          z0 = 0, z1 = 0, z2 = 0, z3 = 0,\n          i = 0, c = 0;\n\n        x0 = x0 ^ I0,\n          x1 = x1 ^ I1,\n          x2 = x2 ^ I2,\n          x3 = x3 ^ I3;\n\n        y0 = H0 | 0,\n          y1 = H1 | 0,\n          y2 = H2 | 0,\n          y3 = H3 | 0;\n\n        for (; (i | 0) < 128; i = (i + 1) | 0) {\n          if (y0 >>> 31) {\n            z0 = z0 ^ x0,\n              z1 = z1 ^ x1,\n              z2 = z2 ^ x2,\n              z3 = z3 ^ x3;\n          }\n\n          y0 = (y0 << 1) | (y1 >>> 31),\n            y1 = (y1 << 1) | (y2 >>> 31),\n            y2 = (y2 << 1) | (y3 >>> 31),\n            y3 = (y3 << 1);\n\n          c = x3 & 1;\n\n          x3 = (x3 >>> 1) | (x2 << 31),\n            x2 = (x2 >>> 1) | (x1 << 31),\n            x1 = (x1 >>> 1) | (x0 << 31),\n            x0 = (x0 >>> 1);\n\n          if (c) x0 = x0 ^ 0xe1000000;\n        }\n\n        I0 = z0,\n          I1 = z1,\n          I2 = z2,\n          I3 = z3;\n      }\n\n      /**\n       * Set the internal rounds number.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} r - number if inner AES rounds\n       */\n      function set_rounds(r) {\n        r = r | 0;\n        R = r;\n      }\n\n      /**\n       * Populate the internal state of the module.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} s0 - state vector\n       * @param {number} s1 - state vector\n       * @param {number} s2 - state vector\n       * @param {number} s3 - state vector\n       */\n      function set_state(s0, s1, s2, s3) {\n        s0 = s0 | 0;\n        s1 = s1 | 0;\n        s2 = s2 | 0;\n        s3 = s3 | 0;\n\n        S0 = s0,\n          S1 = s1,\n          S2 = s2,\n          S3 = s3;\n      }\n\n      /**\n       * Populate the internal iv of the module.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} i0 - iv vector\n       * @param {number} i1 - iv vector\n       * @param {number} i2 - iv vector\n       * @param {number} i3 - iv vector\n       */\n      function set_iv(i0, i1, i2, i3) {\n        i0 = i0 | 0;\n        i1 = i1 | 0;\n        i2 = i2 | 0;\n        i3 = i3 | 0;\n\n        I0 = i0,\n          I1 = i1,\n          I2 = i2,\n          I3 = i3;\n      }\n\n      /**\n       * Set nonce for CTR-family modes.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} n0 - nonce vector\n       * @param {number} n1 - nonce vector\n       * @param {number} n2 - nonce vector\n       * @param {number} n3 - nonce vector\n       */\n      function set_nonce(n0, n1, n2, n3) {\n        n0 = n0 | 0;\n        n1 = n1 | 0;\n        n2 = n2 | 0;\n        n3 = n3 | 0;\n\n        N0 = n0,\n          N1 = n1,\n          N2 = n2,\n          N3 = n3;\n      }\n\n      /**\n       * Set counter mask for CTR-family modes.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} m0 - counter mask vector\n       * @param {number} m1 - counter mask vector\n       * @param {number} m2 - counter mask vector\n       * @param {number} m3 - counter mask vector\n       */\n      function set_mask(m0, m1, m2, m3) {\n        m0 = m0 | 0;\n        m1 = m1 | 0;\n        m2 = m2 | 0;\n        m3 = m3 | 0;\n\n        M0 = m0,\n          M1 = m1,\n          M2 = m2,\n          M3 = m3;\n      }\n\n      /**\n       * Set counter for CTR-family modes.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} c0 - counter vector\n       * @param {number} c1 - counter vector\n       * @param {number} c2 - counter vector\n       * @param {number} c3 - counter vector\n       */\n      function set_counter(c0, c1, c2, c3) {\n        c0 = c0 | 0;\n        c1 = c1 | 0;\n        c2 = c2 | 0;\n        c3 = c3 | 0;\n\n        N3 = (~M3 & N3) | M3 & c3,\n          N2 = (~M2 & N2) | M2 & c2,\n          N1 = (~M1 & N1) | M1 & c1,\n          N0 = (~M0 & N0) | M0 & c0;\n      }\n\n      /**\n       * Store the internal state vector into the heap.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} pos - offset where to put the data\n       * @return {number} The number of bytes have been written into the heap, always 16.\n       */\n      function get_state(pos) {\n        pos = pos | 0;\n\n        if (pos & 15) return -1;\n\n        DATA[pos | 0] = S0 >>> 24,\n          DATA[pos | 1] = S0 >>> 16 & 255,\n          DATA[pos | 2] = S0 >>> 8 & 255,\n          DATA[pos | 3] = S0 & 255,\n          DATA[pos | 4] = S1 >>> 24,\n          DATA[pos | 5] = S1 >>> 16 & 255,\n          DATA[pos | 6] = S1 >>> 8 & 255,\n          DATA[pos | 7] = S1 & 255,\n          DATA[pos | 8] = S2 >>> 24,\n          DATA[pos | 9] = S2 >>> 16 & 255,\n          DATA[pos | 10] = S2 >>> 8 & 255,\n          DATA[pos | 11] = S2 & 255,\n          DATA[pos | 12] = S3 >>> 24,\n          DATA[pos | 13] = S3 >>> 16 & 255,\n          DATA[pos | 14] = S3 >>> 8 & 255,\n          DATA[pos | 15] = S3 & 255;\n\n        return 16;\n      }\n\n      /**\n       * Store the internal iv vector into the heap.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} pos - offset where to put the data\n       * @return {number} The number of bytes have been written into the heap, always 16.\n       */\n      function get_iv(pos) {\n        pos = pos | 0;\n\n        if (pos & 15) return -1;\n\n        DATA[pos | 0] = I0 >>> 24,\n          DATA[pos | 1] = I0 >>> 16 & 255,\n          DATA[pos | 2] = I0 >>> 8 & 255,\n          DATA[pos | 3] = I0 & 255,\n          DATA[pos | 4] = I1 >>> 24,\n          DATA[pos | 5] = I1 >>> 16 & 255,\n          DATA[pos | 6] = I1 >>> 8 & 255,\n          DATA[pos | 7] = I1 & 255,\n          DATA[pos | 8] = I2 >>> 24,\n          DATA[pos | 9] = I2 >>> 16 & 255,\n          DATA[pos | 10] = I2 >>> 8 & 255,\n          DATA[pos | 11] = I2 & 255,\n          DATA[pos | 12] = I3 >>> 24,\n          DATA[pos | 13] = I3 >>> 16 & 255,\n          DATA[pos | 14] = I3 >>> 8 & 255,\n          DATA[pos | 15] = I3 & 255;\n\n        return 16;\n      }\n\n      /**\n       * GCM initialization.\n       * @instance\n       * @memberof AES_asm\n       */\n      function gcm_init() {\n        _ecb_enc(0, 0, 0, 0);\n        H0 = S0,\n          H1 = S1,\n          H2 = S2,\n          H3 = S3;\n      }\n\n      /**\n       * Perform ciphering operation on the supplied data.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)\n       * @param {number} pos - offset of the data being processed\n       * @param {number} len - length of the data being processed\n       * @return {number} Actual amount of data have been processed.\n       */\n      function cipher(mode, pos, len) {\n        mode = mode | 0;\n        pos = pos | 0;\n        len = len | 0;\n\n        var ret = 0;\n\n        if (pos & 15) return -1;\n\n        while ((len | 0) >= 16) {\n          _cipher_modes[mode & 7](\n            DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],\n            DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],\n            DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],\n            DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]\n          );\n\n          DATA[pos | 0] = S0 >>> 24,\n            DATA[pos | 1] = S0 >>> 16 & 255,\n            DATA[pos | 2] = S0 >>> 8 & 255,\n            DATA[pos | 3] = S0 & 255,\n            DATA[pos | 4] = S1 >>> 24,\n            DATA[pos | 5] = S1 >>> 16 & 255,\n            DATA[pos | 6] = S1 >>> 8 & 255,\n            DATA[pos | 7] = S1 & 255,\n            DATA[pos | 8] = S2 >>> 24,\n            DATA[pos | 9] = S2 >>> 16 & 255,\n            DATA[pos | 10] = S2 >>> 8 & 255,\n            DATA[pos | 11] = S2 & 255,\n            DATA[pos | 12] = S3 >>> 24,\n            DATA[pos | 13] = S3 >>> 16 & 255,\n            DATA[pos | 14] = S3 >>> 8 & 255,\n            DATA[pos | 15] = S3 & 255;\n\n          ret = (ret + 16) | 0,\n            pos = (pos + 16) | 0,\n            len = (len - 16) | 0;\n        }\n\n        return ret | 0;\n      }\n\n      /**\n       * Calculates MAC of the supplied data.\n       * @instance\n       * @memberof AES_asm\n       * @param {number} mode - block cipher mode (see {@link AES_asm} mode constants)\n       * @param {number} pos - offset of the data being processed\n       * @param {number} len - length of the data being processed\n       * @return {number} Actual amount of data have been processed.\n       */\n      function mac(mode, pos, len) {\n        mode = mode | 0;\n        pos = pos | 0;\n        len = len | 0;\n\n        var ret = 0;\n\n        if (pos & 15) return -1;\n\n        while ((len | 0) >= 16) {\n          _mac_modes[mode & 1](\n            DATA[pos | 0] << 24 | DATA[pos | 1] << 16 | DATA[pos | 2] << 8 | DATA[pos | 3],\n            DATA[pos | 4] << 24 | DATA[pos | 5] << 16 | DATA[pos | 6] << 8 | DATA[pos | 7],\n            DATA[pos | 8] << 24 | DATA[pos | 9] << 16 | DATA[pos | 10] << 8 | DATA[pos | 11],\n            DATA[pos | 12] << 24 | DATA[pos | 13] << 16 | DATA[pos | 14] << 8 | DATA[pos | 15]\n          );\n\n          ret = (ret + 16) | 0,\n            pos = (pos + 16) | 0,\n            len = (len - 16) | 0;\n        }\n\n        return ret | 0;\n      }\n\n      /**\n       * AES cipher modes table (virual methods)\n       */\n      var _cipher_modes = [_ecb_enc, _ecb_dec, _cbc_enc, _cbc_dec, _cfb_enc, _cfb_dec, _ofb, _ctr];\n\n      /**\n       * AES MAC modes table (virual methods)\n       */\n      var _mac_modes = [_cbc_enc, _gcm_mac];\n\n      /**\n       * Asm.js module exports\n       */\n      return {\n        set_rounds: set_rounds,\n        set_state: set_state,\n        set_iv: set_iv,\n        set_nonce: set_nonce,\n        set_mask: set_mask,\n        set_counter: set_counter,\n        get_state: get_state,\n        get_iv: get_iv,\n        gcm_init: gcm_init,\n        cipher: cipher,\n        mac: mac,\n      };\n    }(stdlib, foreign, buffer);\n\n    asm.set_key = set_key;\n\n    return asm;\n  };\n\n  /**\n   * AES enciphering mode constants\n   * @enum {number}\n   * @const\n   */\n  wrapper.ENC = {\n    ECB: 0,\n    CBC: 2,\n    CFB: 4,\n    OFB: 6,\n    CTR: 7,\n  },\n\n    /**\n     * AES deciphering mode constants\n     * @enum {number}\n     * @const\n     */\n    wrapper.DEC = {\n      ECB: 1,\n      CBC: 3,\n      CFB: 5,\n      OFB: 6,\n      CTR: 7,\n    },\n\n    /**\n     * AES MAC mode constants\n     * @enum {number}\n     * @const\n     */\n    wrapper.MAC = {\n      CBC: 0,\n      GCM: 1,\n    };\n\n  /**\n   * Heap data offset\n   * @type {number}\n   * @const\n   */\n  wrapper.HEAP_DATA = 0x4000;\n\n  return wrapper;\n}();\n"
  },
  {
    "path": "src/aes/aes.ts",
    "content": "import { AES_asm, AES_mode } from './aes.asm';\nimport { _heap_init, _heap_write, is_bytes } from '../other/utils';\nimport { IllegalArgumentError, SecurityError } from '../other/errors';\n\nexport class AES {\n  public readonly heap: Uint8Array;\n  public readonly asm: AES_asm;\n  private readonly mode: string;\n  public padding: boolean; // TODO: This should be `private readonly`, hacking for AES-CFB?!\n  public pos: number = 0;\n  public len: number = 0;\n\n  constructor(key: Uint8Array, iv: Uint8Array | undefined, padding = true, mode: AES_mode, heap?: Uint8Array, asm?: AES_asm) {\n    this.mode = mode;\n\n    // The AES \"worker\"\n    this.heap = heap ? heap : _heap_init().subarray(AES_asm.HEAP_DATA);\n    this.asm = asm ? asm : new AES_asm(null, this.heap.buffer);\n\n    // The AES object state\n    this.pos = 0;\n    this.len = 0;\n\n    // Key\n    const keylen = key.length;\n    if (keylen !== 16 && keylen !== 24 && keylen !== 32) throw new IllegalArgumentError('illegal key size');\n\n    const keyview = new DataView(key.buffer, key.byteOffset, key.byteLength);\n    this.asm.set_key(\n      keylen >> 2,\n      keyview.getUint32(0),\n      keyview.getUint32(4),\n      keyview.getUint32(8),\n      keyview.getUint32(12),\n      keylen > 16 ? keyview.getUint32(16) : 0,\n      keylen > 16 ? keyview.getUint32(20) : 0,\n      keylen > 24 ? keyview.getUint32(24) : 0,\n      keylen > 24 ? keyview.getUint32(28) : 0,\n    );\n\n    // IV\n    if (iv !== undefined) {\n      if (iv.length !== 16) throw new IllegalArgumentError('illegal iv size');\n\n      let ivview = new DataView(iv.buffer, iv.byteOffset, iv.byteLength);\n\n      this.asm.set_iv(ivview.getUint32(0), ivview.getUint32(4), ivview.getUint32(8), ivview.getUint32(12));\n    } else {\n      this.asm.set_iv(0, 0, 0, 0);\n    }\n\n    this.padding = padding;\n  }\n\n  AES_Encrypt_process(data: Uint8Array): Uint8Array {\n    if (!is_bytes(data)) throw new TypeError(\"data isn't of expected type\");\n\n    let asm = this.asm;\n    let heap = this.heap;\n    let amode = AES_asm.ENC[this.mode];\n    let hpos = AES_asm.HEAP_DATA;\n    let pos = this.pos;\n    let len = this.len;\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let rpos = 0;\n    let rlen = (len + dlen) & -16;\n    let wlen = 0;\n\n    let result = new Uint8Array(rlen);\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n      len += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.cipher(amode, hpos + pos, len);\n\n      if (wlen) result.set(heap.subarray(pos, pos + wlen), rpos);\n      rpos += wlen;\n\n      if (wlen < len) {\n        pos += wlen;\n        len -= wlen;\n      } else {\n        pos = 0;\n        len = 0;\n      }\n    }\n\n    this.pos = pos;\n    this.len = len;\n\n    return result;\n  }\n\n  AES_Encrypt_finish(): Uint8Array {\n    let asm = this.asm;\n    let heap = this.heap;\n    let amode = AES_asm.ENC[this.mode];\n    let hpos = AES_asm.HEAP_DATA;\n    let pos = this.pos;\n    let len = this.len;\n    let plen = 16 - (len % 16);\n    let rlen = len;\n\n    if (this.hasOwnProperty('padding')) {\n      if (this.padding) {\n        for (let p = 0; p < plen; ++p) {\n          heap[pos + len + p] = plen;\n        }\n        len += plen;\n        rlen = len;\n      } else if (len % 16) {\n        throw new IllegalArgumentError('data length must be a multiple of the block size');\n      }\n    } else {\n      len += plen;\n    }\n\n    const result = new Uint8Array(rlen);\n\n    if (len) asm.cipher(amode, hpos + pos, len);\n\n    if (rlen) result.set(heap.subarray(pos, pos + rlen));\n\n    this.pos = 0;\n    this.len = 0;\n\n    return result;\n  }\n\n  AES_Decrypt_process(data: Uint8Array): Uint8Array {\n    if (!is_bytes(data)) throw new TypeError(\"data isn't of expected type\");\n\n    let asm = this.asm;\n    let heap = this.heap;\n    let amode = AES_asm.DEC[this.mode];\n    let hpos = AES_asm.HEAP_DATA;\n    let pos = this.pos;\n    let len = this.len;\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let rpos = 0;\n    let rlen = (len + dlen) & -16;\n    let plen = 0;\n    let wlen = 0;\n\n    if (this.padding) {\n      plen = len + dlen - rlen || 16;\n      rlen -= plen;\n    }\n\n    const result = new Uint8Array(rlen);\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n      len += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.cipher(amode, hpos + pos, len - (!dlen ? plen : 0));\n\n      if (wlen) result.set(heap.subarray(pos, pos + wlen), rpos);\n      rpos += wlen;\n\n      if (wlen < len) {\n        pos += wlen;\n        len -= wlen;\n      } else {\n        pos = 0;\n        len = 0;\n      }\n    }\n\n    this.pos = pos;\n    this.len = len;\n\n    return result;\n  }\n\n  AES_Decrypt_finish(): Uint8Array {\n    let asm = this.asm;\n    let heap = this.heap;\n    let amode = AES_asm.DEC[this.mode];\n    let hpos = AES_asm.HEAP_DATA;\n    let pos = this.pos;\n    let len = this.len;\n    let rlen = len;\n\n    if (len > 0) {\n      if (len % 16) {\n        if (this.hasOwnProperty('padding')) {\n          throw new IllegalArgumentError('data length must be a multiple of the block size');\n        } else {\n          len += 16 - (len % 16);\n        }\n      }\n\n      asm.cipher(amode, hpos + pos, len);\n\n      if (this.hasOwnProperty('padding') && this.padding) {\n        let pad = heap[pos + rlen - 1];\n        if (pad < 1 || pad > 16 || pad > rlen) throw new SecurityError('bad padding');\n\n        let pcheck = 0;\n        for (let i = pad; i > 1; i--) pcheck |= pad ^ heap[pos + rlen - i];\n        if (pcheck) throw new SecurityError('bad padding');\n\n        rlen -= pad;\n      }\n    }\n\n    const result = new Uint8Array(rlen);\n\n    if (rlen > 0) {\n      result.set(heap.subarray(pos, pos + rlen));\n    }\n\n    this.pos = 0;\n    this.len = 0;\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "src/aes/cbc.ts",
    "content": "import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\n\nexport class AES_CBC {\n  private aes: AES;\n\n  static encrypt(data: Uint8Array, key: Uint8Array, padding: boolean = true, iv?: Uint8Array): Uint8Array {\n    return new AES_CBC(key, iv, padding).encrypt(data);\n  }\n\n  static decrypt(data: Uint8Array, key: Uint8Array, padding: boolean = true, iv?: Uint8Array): Uint8Array {\n    return new AES_CBC(key, iv, padding).decrypt(data);\n  }\n\n  constructor(key: Uint8Array, iv?: Uint8Array, padding: boolean = true, aes?: AES) {\n    this.aes = aes ? aes : new AES(key, iv, padding, 'CBC');\n  }\n\n  encrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Encrypt_process(data);\n    const r2 = this.aes.AES_Encrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Decrypt_process(data);\n    const r2 = this.aes.AES_Decrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n}\n"
  },
  {
    "path": "src/aes/ccm.ts",
    "content": "/**\n * Counter with CBC-MAC (CCM)\n *\n * Due to JS limitations (52 bits of Number precision) maximum encrypted message length\n * is limited to ~4 PiB ( 2^52 - 16 ) per `nonce`-`key` pair.\n * That also limits `lengthSize` parameter maximum value to 7 (not 8 as described in RFC3610).\n *\n * Additional authenticated data `adata` maximum length is chosen to be no more than 65279 bytes ( 2^16 - 2^8 ),\n * which is considered enough for the most of use-cases.\n *\n * And one more important thing: in case of progressive ciphering of a data stream (in other\n * words when data can't be held in-memory at a whole and are ciphered chunk-by-chunk)\n * you have to know the `dataLength` in advance and pass that value to the cipher options.\n */\n\nimport { AES_asm } from './aes.asm';\nimport { AES } from './aes';\nimport { _heap_write } from '../other/utils';\nimport { IllegalArgumentError, IllegalStateError, SecurityError } from '../other/errors';\n\nconst _AES_CCM_adata_maxLength = 65279; // 2^16 - 2^8\nconst _AES_CCM_data_maxLength = 4503599627370480; // 2^52 - 2^4\n\nexport class AES_CCM {\n  private readonly tagSize: number;\n  private readonly lengthSize: number;\n  private nonce: Uint8Array;\n  private readonly adata: Uint8Array | undefined;\n  private counter: number = 1;\n  private dataLength: number = -1;\n  private aes: AES;\n\n  static encrypt(\n    clear: Uint8Array,\n    key: Uint8Array,\n    nonce: Uint8Array,\n    adata: Uint8Array | undefined,\n    tagsize: number = 16,\n  ): Uint8Array {\n    return new AES_CCM(key, nonce, adata, tagsize, clear.length).encrypt(clear);\n  }\n  static decrypt(\n    cipher: Uint8Array,\n    key: Uint8Array,\n    nonce: Uint8Array,\n    adata: Uint8Array | undefined,\n    tagsize: number = 16,\n  ): Uint8Array {\n    return new AES_CCM(key, nonce, adata, tagsize, cipher.length - tagsize).decrypt(cipher);\n  }\n\n  constructor(\n    key: Uint8Array,\n    nonce: Uint8Array,\n    adata: Uint8Array | undefined,\n    tagSize: number = 16,\n    dataLength: number,\n    aes?: AES,\n  ) {\n    this.aes = aes ? aes : new AES(key, undefined, undefined, 'CCM');\n\n    // Tag size\n    if (tagSize < 4 || tagSize > 16 || tagSize & 1) throw new IllegalArgumentError('illegal tagSize value');\n    this.tagSize = tagSize;\n\n    // Nonce\n    this.nonce = nonce;\n\n    if (nonce.length < 8 || nonce.length > 13) throw new IllegalArgumentError('illegal nonce length');\n    this.lengthSize = 15 - nonce.length;\n    nonce = new Uint8Array(nonce.length + 1);\n    nonce[0] = this.lengthSize - 1;\n    nonce.set(this.nonce, 1);\n\n    if (dataLength < 0 || dataLength > _AES_CCM_data_maxLength || dataLength > Math.pow(2, 8 * this.lengthSize) - 16)\n      throw new IllegalArgumentError('illegal dataLength value');\n\n    if (adata !== undefined) {\n      if (adata.length > _AES_CCM_adata_maxLength) throw new IllegalArgumentError('illegal adata length');\n\n      this.adata = adata.length ? adata : undefined;\n    }\n\n    this.dataLength = dataLength;\n    this.counter = 1;\n\n    this.AES_CCM_calculate_iv();\n    this.AES_CTR_set_options(nonce, this.counter, 8 * this.lengthSize);\n  }\n\n  encrypt(data: Uint8Array): Uint8Array {\n    this.dataLength = data.length || 0;\n\n    const result1 = this.AES_CCM_Encrypt_process(data);\n    const result2 = this.AES_CCM_Encrypt_finish();\n\n    const result = new Uint8Array(result1.length + result2.length);\n    if (result1.length) result.set(result1);\n    if (result2.length) result.set(result2, result1.length);\n\n    return result;\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    this.dataLength = data.length || 0;\n\n    const result1 = this.AES_CCM_Decrypt_process(data);\n    const result2 = this.AES_CCM_Decrypt_finish();\n\n    const result = new Uint8Array(result1.length + result2.length);\n    if (result1.length) result.set(result1);\n    if (result2.length) result.set(result2, result1.length);\n\n    return result;\n  }\n\n  AES_CCM_calculate_iv(): void {\n    const nonce = this.nonce;\n    const adata = this.adata;\n    const tagSize = this.tagSize;\n    const lengthSize = this.lengthSize;\n    const dataLength = this.dataLength;\n\n    const data = new Uint8Array(16 + (adata ? 2 + adata.length : 0));\n\n    // B0: flags(adata?, M', L'), nonce, len(data)\n    data[0] = (adata ? 64 : 0) | ((tagSize - 2) << 2) | (lengthSize - 1);\n    data.set(nonce, 1);\n    if (lengthSize > 6) data[9] = ((dataLength / 0x100000000) >>> 16) & 15;\n    if (lengthSize > 5) data[10] = ((dataLength / 0x100000000) >>> 8) & 255;\n    if (lengthSize > 4) data[11] = (dataLength / 0x100000000) & 255;\n    if (lengthSize > 3) data[12] = dataLength >>> 24;\n    if (lengthSize > 2) data[13] = (dataLength >>> 16) & 255;\n    data[14] = (dataLength >>> 8) & 255;\n    data[15] = dataLength & 255;\n\n    // B*: len(adata), adata\n    if (adata) {\n      data[16] = (adata.length >>> 8) & 255;\n      data[17] = adata.length & 255;\n      data.set(adata, 18);\n    }\n\n    this._cbc_mac_process(data);\n    this.aes.asm.get_state(AES_asm.HEAP_DATA);\n\n    const iv = new Uint8Array(this.aes.heap.subarray(0, 16));\n    const ivview = new DataView(iv.buffer, iv.byteOffset, iv.byteLength);\n    this.aes.asm.set_iv(ivview.getUint32(0), ivview.getUint32(4), ivview.getUint32(8), ivview.getUint32(12));\n  }\n\n  _cbc_mac_process(data: Uint8Array): void {\n    const heap = this.aes.heap;\n    const asm = this.aes.asm;\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let wlen = 0;\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, 0, data, dpos, dlen);\n      while (wlen & 15) heap[wlen++] = 0;\n      dpos += wlen;\n      dlen -= wlen;\n\n      asm.mac(AES_asm.MAC.CBC, AES_asm.HEAP_DATA, wlen);\n    }\n  }\n\n  AES_CCM_Encrypt_process(data: Uint8Array): Uint8Array {\n    const asm = this.aes.asm;\n    const heap = this.aes.heap;\n\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let counter = this.counter;\n    let pos = this.aes.pos;\n    let len = this.aes.len;\n\n    const rlen = (len + dlen) & -16;\n    let rpos = 0;\n    let wlen = 0;\n\n    if (((counter - 1) << 4) + len + dlen > _AES_CCM_data_maxLength)\n      // ??? should check against lengthSize\n      throw new RangeError('counter overflow');\n\n    const result = new Uint8Array(rlen);\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n      len += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.mac(AES_asm.MAC.CBC, AES_asm.HEAP_DATA + pos, len);\n      wlen = asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, wlen);\n\n      if (wlen) result.set(heap.subarray(pos, pos + wlen), rpos);\n      counter += wlen >>> 4;\n      rpos += wlen;\n\n      if (wlen < len) {\n        pos += wlen;\n        len -= wlen;\n      } else {\n        pos = 0;\n        len = 0;\n      }\n    }\n\n    this.counter = counter;\n    this.aes.pos = pos;\n    this.aes.len = len;\n\n    return result;\n  }\n\n  AES_CCM_Encrypt_finish(): Uint8Array {\n    const asm = this.aes.asm;\n    const heap = this.aes.heap;\n    const tagSize = this.tagSize;\n    const pos = this.aes.pos;\n    const len = this.aes.len;\n\n    const result = new Uint8Array(len + tagSize);\n\n    let i = len;\n    for (; i & 15; i++) heap[pos + i] = 0;\n\n    asm.mac(AES_asm.MAC.CBC, AES_asm.HEAP_DATA + pos, i);\n    asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, i);\n    if (len) result.set(heap.subarray(pos, pos + len));\n\n    asm.set_counter(0, 0, 0, 0);\n    asm.get_iv(AES_asm.HEAP_DATA);\n    asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n    result.set(heap.subarray(0, tagSize), len);\n\n    this.counter = 1;\n    this.aes.pos = 0;\n    this.aes.len = 0;\n\n    return result;\n  }\n\n  AES_CCM_Decrypt_process(data: Uint8Array): Uint8Array {\n    let dpos = 0;\n    let dlen = data.length || 0;\n    const asm = this.aes.asm;\n    const heap = this.aes.heap;\n    let counter = this.counter;\n    const tagSize = this.tagSize;\n    let pos = this.aes.pos;\n    let len = this.aes.len;\n    let rpos = 0;\n    const rlen = len + dlen > tagSize ? (len + dlen - tagSize) & -16 : 0;\n    const tlen = len + dlen - rlen;\n    let wlen = 0;\n\n    if (((counter - 1) << 4) + len + dlen > _AES_CCM_data_maxLength) throw new RangeError('counter overflow');\n\n    const result = new Uint8Array(rlen);\n\n    while (dlen > tlen) {\n      wlen = _heap_write(heap, pos + len, data, dpos, dlen - tlen);\n      len += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, wlen);\n      wlen = asm.mac(AES_asm.MAC.CBC, AES_asm.HEAP_DATA + pos, wlen);\n\n      if (wlen) result.set(heap.subarray(pos, pos + wlen), rpos);\n      counter += wlen >>> 4;\n      rpos += wlen;\n\n      pos = 0;\n      len = 0;\n    }\n\n    if (dlen > 0) {\n      len += _heap_write(heap, 0, data, dpos, dlen);\n    }\n\n    this.counter = counter;\n    this.aes.pos = pos;\n    this.aes.len = len;\n\n    return result;\n  }\n\n  AES_CCM_Decrypt_finish(): Uint8Array {\n    const asm = this.aes.asm;\n    const heap = this.aes.heap;\n    const tagSize = this.tagSize;\n    const pos = this.aes.pos;\n    const len = this.aes.len;\n    const rlen = len - tagSize;\n\n    if (len < tagSize) throw new IllegalStateError('authentication tag not found');\n\n    const result = new Uint8Array(rlen);\n    const atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));\n\n    asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, (rlen + 15) & -16);\n    result.set(heap.subarray(pos, pos + rlen));\n\n    let i = rlen;\n    for (; i & 15; i++) heap[pos + i] = 0;\n    asm.mac(AES_asm.MAC.CBC, AES_asm.HEAP_DATA + pos, i);\n\n    asm.set_counter(0, 0, 0, 0);\n    asm.get_iv(AES_asm.HEAP_DATA);\n    asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n\n    let acheck = 0;\n    for (let j = 0; j < tagSize; ++j) acheck |= atag[j] ^ heap[j];\n    if (acheck) throw new SecurityError('data integrity check failed');\n\n    this.counter = 1;\n    this.aes.pos = 0;\n    this.aes.len = 0;\n\n    return result;\n  }\n\n  private AES_CTR_set_options(nonce: Uint8Array, counter: number, size: number): void {\n    if (size < 8 || size > 48) throw new IllegalArgumentError('illegal counter size');\n\n    const mask = Math.pow(2, size) - 1;\n    this.aes.asm.set_mask(0, 0, (mask / 0x100000000) | 0, mask | 0);\n\n    const len = nonce.length;\n    if (!len || len > 16) throw new IllegalArgumentError('illegal nonce size');\n\n    this.nonce = nonce;\n\n    const view = new DataView(new ArrayBuffer(16));\n    new Uint8Array(view.buffer).set(nonce);\n\n    this.aes.asm.set_nonce(view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12));\n\n    if (counter < 0 || counter >= Math.pow(2, size)) throw new IllegalArgumentError('illegal counter value');\n\n    this.counter = counter;\n\n    this.aes.asm.set_counter(0, 0, (counter / 0x100000000) | 0, counter | 0);\n  }\n}\n"
  },
  {
    "path": "src/aes/cfb.ts",
    "content": "import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\n\nexport class AES_CFB {\n  private aes: AES;\n\n  static encrypt(data: Uint8Array, key: Uint8Array, iv?: Uint8Array): Uint8Array {\n    return new AES_CFB(key, iv).encrypt(data);\n  }\n\n  static decrypt(data: Uint8Array, key: Uint8Array, iv?: Uint8Array): Uint8Array {\n    return new AES_CFB(key, iv).decrypt(data);\n  }\n\n  constructor(key: Uint8Array, iv?: Uint8Array, aes?: AES) {\n    this.aes = aes ? aes : new AES(key, iv, true, 'CFB');\n    delete this.aes.padding;\n  }\n\n  encrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Encrypt_process(data);\n    const r2 = this.aes.AES_Encrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Decrypt_process(data);\n    const r2 = this.aes.AES_Decrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n}\n"
  },
  {
    "path": "src/aes/cmac.ts",
    "content": "import { AES_ECB } from './ecb';\nimport { AES_CBC } from './cbc';\n\nfunction mul2(data: Uint8Array): void {\n  const t = data[0] & 0x80;\n  for (let i = 0; i < 15; i++) {\n    data[i] = (data[i] << 1) ^ (data[i + 1] & 0x80 ? 1 : 0);\n  }\n  data[15] = (data[15] << 1) ^ (t ? 0x87 : 0);\n}\n\nexport class AES_CMAC {\n  private readonly k: Uint8Array;\n  private readonly cbc: AES_CBC;\n  private readonly buffer: Uint8Array;\n  private bufferLength = 0;\n  public result!: Uint8Array | null;\n\n  static bytes(data: Uint8Array, key: Uint8Array): Uint8Array {\n    return new AES_CMAC(key).process(data).finish().result as Uint8Array;\n  }\n\n  constructor(key: Uint8Array) {\n    this.k = new AES_ECB(key).encrypt(new Uint8Array(16));\n    mul2(this.k);\n    this.cbc = new AES_CBC(key, new Uint8Array(16), false);\n\n    this.buffer = new Uint8Array(16);\n    this.result = null;\n  }\n\n  process(data: Uint8Array): this {\n    if (this.bufferLength + data.length > 16) {\n      this.cbc.encrypt(this.buffer.subarray(0, this.bufferLength));\n      const offset = ((this.bufferLength + data.length - 1) & ~15) - this.bufferLength;\n      this.cbc.encrypt(data.subarray(0, offset));\n      this.buffer.set(data.subarray(offset));\n      this.bufferLength = data.length - offset;\n    } else {\n      this.buffer.set(data, this.bufferLength);\n      this.bufferLength += data.length;\n    }\n    return this;\n  }\n\n  finish(): this {\n    if (this.bufferLength !== 16) {\n      this.buffer[this.bufferLength] = 0x80;\n      for (let i = this.bufferLength + 1; i < 16; i++) {\n        this.buffer[i] = 0;\n      }\n      mul2(this.k);\n    }\n\n    for (let i = 0; i < 16; i++) {\n      this.buffer[i] ^= this.k[i];\n    }\n\n    this.result = this.cbc.encrypt(this.buffer);\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/aes/ctr.ts",
    "content": "import { AES } from './aes';\nimport { IllegalArgumentError } from '../other/errors';\nimport { joinBytes } from '../other/utils';\n\nexport class AES_CTR {\n  private aes: AES;\n\n  static encrypt(data: Uint8Array, key: Uint8Array, nonce: Uint8Array): Uint8Array {\n    return new AES_CTR(key, nonce).encrypt(data);\n  }\n\n  static decrypt(data: Uint8Array, key: Uint8Array, nonce: Uint8Array): Uint8Array {\n    return new AES_CTR(key, nonce).encrypt(data);\n  }\n\n  constructor(key: Uint8Array, nonce: Uint8Array, aes?: AES) {\n    this.aes = aes ? aes : new AES(key, undefined, false, 'CTR');\n    delete this.aes.padding;\n\n    this.AES_CTR_set_options(nonce);\n  }\n\n  encrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Encrypt_process(data);\n    const r2 = this.aes.AES_Encrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Encrypt_process(data);\n    const r2 = this.aes.AES_Encrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n\n  private AES_CTR_set_options(nonce: Uint8Array, counter?: number, size?: number): void {\n    if (size !== undefined) {\n      if (size < 8 || size > 48) throw new IllegalArgumentError('illegal counter size');\n\n      let mask = Math.pow(2, size) - 1;\n      this.aes.asm.set_mask(0, 0, (mask / 0x100000000) | 0, mask | 0);\n    } else {\n      size = 48;\n      this.aes.asm.set_mask(0, 0, 0xffff, 0xffffffff);\n    }\n\n    if (nonce !== undefined) {\n      let len = nonce.length;\n      if (!len || len > 16) throw new IllegalArgumentError('illegal nonce size');\n\n      let view = new DataView(new ArrayBuffer(16));\n      new Uint8Array(view.buffer).set(nonce);\n\n      this.aes.asm.set_nonce(view.getUint32(0), view.getUint32(4), view.getUint32(8), view.getUint32(12));\n    } else {\n      throw new Error('nonce is required');\n    }\n\n    if (counter !== undefined) {\n      if (counter < 0 || counter >= Math.pow(2, size)) throw new IllegalArgumentError('illegal counter value');\n\n      this.aes.asm.set_counter(0, 0, (counter / 0x100000000) | 0, counter | 0);\n    }\n  }\n}\n"
  },
  {
    "path": "src/aes/ecb.ts",
    "content": "import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\n\nexport class AES_ECB {\n  private aes: AES;\n  static encrypt(data: Uint8Array, key: Uint8Array, padding: boolean = false): Uint8Array {\n    return new AES_ECB(key, padding).encrypt(data);\n  }\n\n  static decrypt(data: Uint8Array, key: Uint8Array, padding: boolean = false): Uint8Array {\n    return new AES_ECB(key, padding).decrypt(data);\n  }\n\n  constructor(key: Uint8Array, padding: boolean = false, aes?: AES) {\n    this.aes = aes ? aes : new AES(key, undefined, padding, 'ECB');\n  }\n\n  encrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Encrypt_process(data);\n    const r2 = this.aes.AES_Encrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Decrypt_process(data);\n    const r2 = this.aes.AES_Decrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n}\n"
  },
  {
    "path": "src/aes/exports.ts",
    "content": "// shared asm.js module and heap\nimport { AES_asm } from './aes.asm';\n\nexport var _AES_heap_instance = new Uint8Array(0x100000); // 1MB\nexport var _AES_asm_instance = new AES_asm(null, _AES_heap_instance.buffer);\n"
  },
  {
    "path": "src/aes/gcm.ts",
    "content": "import { IllegalArgumentError, IllegalStateError, SecurityError } from '../other/errors';\nimport { _heap_write } from '../other/utils';\nimport { AES } from './aes';\nimport { AES_asm } from './aes.asm';\n\nconst _AES_GCM_data_maxLength = 68719476704; // 2^36 - 2^5\n\nexport class AES_GCM {\n  private readonly adata: Uint8Array | undefined;\n  private readonly gamma0: number = 0;\n  private aes: AES;\n\n  private counter: number = 1;\n\n  static encrypt(\n    cleartext: Uint8Array,\n    key: Uint8Array,\n    nonce: Uint8Array,\n    adata?: Uint8Array,\n    tagsize?: number,\n  ): Uint8Array {\n    return new AES_GCM(key, nonce, adata, tagsize).encrypt(cleartext);\n  }\n\n  static decrypt(\n    ciphertext: Uint8Array,\n    key: Uint8Array,\n    nonce: Uint8Array,\n    adata?: Uint8Array,\n    tagsize?: number,\n  ): Uint8Array {\n    return new AES_GCM(key, nonce, adata, tagsize).decrypt(ciphertext);\n  }\n\n  constructor(\n    key: Uint8Array,\n    nonce: Uint8Array,\n    adata?: Uint8Array,\n    private readonly tagSize: number = 16,\n    aes?: AES,\n  ) {\n    this.aes = aes ? aes : new AES(key, undefined, false, 'CTR');\n\n    // Init GCM\n    this.aes.asm.gcm_init();\n\n    // Tag size\n    if (this.tagSize < 4 || this.tagSize > 16) throw new IllegalArgumentError('illegal tagSize value');\n\n    // Nonce\n    const noncelen = nonce.length || 0;\n    const noncebuf = new Uint8Array(16);\n    if (noncelen !== 12) {\n      this._gcm_mac_process(nonce);\n\n      this.aes.heap[0] = 0;\n      this.aes.heap[1] = 0;\n      this.aes.heap[2] = 0;\n      this.aes.heap[3] = 0;\n      this.aes.heap[4] = 0;\n      this.aes.heap[5] = 0;\n      this.aes.heap[6] = 0;\n      this.aes.heap[7] = 0;\n      this.aes.heap[8] = 0;\n      this.aes.heap[9] = 0;\n      this.aes.heap[10] = 0;\n      this.aes.heap[11] = noncelen >>> 29;\n      this.aes.heap[12] = (noncelen >>> 21) & 255;\n      this.aes.heap[13] = (noncelen >>> 13) & 255;\n      this.aes.heap[14] = (noncelen >>> 5) & 255;\n      this.aes.heap[15] = (noncelen << 3) & 255;\n      this.aes.asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n\n      this.aes.asm.get_iv(AES_asm.HEAP_DATA);\n      this.aes.asm.set_iv(0, 0, 0, 0);\n\n      noncebuf.set(this.aes.heap.subarray(0, 16));\n    } else {\n      noncebuf.set(nonce);\n      noncebuf[15] = 1;\n    }\n\n    const nonceview = new DataView(noncebuf.buffer);\n    this.gamma0 = nonceview.getUint32(12);\n\n    this.aes.asm.set_nonce(nonceview.getUint32(0), nonceview.getUint32(4), nonceview.getUint32(8), 0);\n    this.aes.asm.set_mask(0, 0, 0, 0xffffffff);\n\n    // Associated data\n    if (adata !== undefined) {\n      if (adata.length > _AES_GCM_data_maxLength) throw new IllegalArgumentError('illegal adata length');\n\n      if (adata.length) {\n        this.adata = adata;\n        this._gcm_mac_process(adata);\n      } else {\n        this.adata = undefined;\n      }\n    } else {\n      this.adata = undefined;\n    }\n\n    // Counter\n    if (this.counter < 1 || this.counter > 0xffffffff)\n      throw new RangeError('counter must be a positive 32-bit integer');\n    this.aes.asm.set_counter(0, 0, 0, (this.gamma0 + this.counter) | 0);\n  }\n\n  encrypt(data: Uint8Array) {\n    return this.AES_GCM_encrypt(data);\n  }\n\n  decrypt(data: Uint8Array) {\n    return this.AES_GCM_decrypt(data);\n  }\n\n  AES_GCM_Encrypt_process(data: Uint8Array): Uint8Array {\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let asm = this.aes.asm;\n    let heap = this.aes.heap;\n    let counter = this.counter;\n    let pos = this.aes.pos;\n    let len = this.aes.len;\n    let rpos = 0;\n    let rlen = (len + dlen) & -16;\n    let wlen = 0;\n\n    if (((counter - 1) << 4) + len + dlen > _AES_GCM_data_maxLength) throw new RangeError('counter overflow');\n\n    const result = new Uint8Array(rlen);\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, pos + len, data, dpos, dlen);\n      len += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, len);\n      wlen = asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, wlen);\n\n      if (wlen) result.set(heap.subarray(pos, pos + wlen), rpos);\n      counter += wlen >>> 4;\n      rpos += wlen;\n\n      if (wlen < len) {\n        pos += wlen;\n        len -= wlen;\n      } else {\n        pos = 0;\n        len = 0;\n      }\n    }\n\n    this.counter = counter;\n    this.aes.pos = pos;\n    this.aes.len = len;\n\n    return result;\n  }\n\n  AES_GCM_Encrypt_finish(): Uint8Array {\n    let asm = this.aes.asm;\n    let heap = this.aes.heap;\n    let counter = this.counter;\n    let tagSize = this.tagSize;\n    let adata = this.adata;\n    let pos = this.aes.pos;\n    let len = this.aes.len;\n\n    const result = new Uint8Array(len + tagSize);\n\n    asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA + pos, (len + 15) & -16);\n    if (len) result.set(heap.subarray(pos, pos + len));\n\n    let i = len;\n    for (; i & 15; i++) heap[pos + i] = 0;\n    asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, i);\n\n    const alen = adata !== undefined ? adata.length : 0;\n    const clen = ((counter - 1) << 4) + len;\n\n    heap[0] = 0;\n    heap[1] = 0;\n    heap[2] = 0;\n    heap[3] = alen >>> 29;\n    heap[4] = alen >>> 21;\n    heap[5] = (alen >>> 13) & 255;\n    heap[6] = (alen >>> 5) & 255;\n    heap[7] = (alen << 3) & 255;\n    heap[8] = heap[9] = heap[10] = 0;\n    heap[11] = clen >>> 29;\n    heap[12] = (clen >>> 21) & 255;\n    heap[13] = (clen >>> 13) & 255;\n    heap[14] = (clen >>> 5) & 255;\n    heap[15] = (clen << 3) & 255;\n\n    asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n    asm.get_iv(AES_asm.HEAP_DATA);\n\n    asm.set_counter(0, 0, 0, this.gamma0);\n    asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n    result.set(heap.subarray(0, tagSize), len);\n\n    this.counter = 1;\n    this.aes.pos = 0;\n    this.aes.len = 0;\n\n    return result;\n  }\n\n  AES_GCM_Decrypt_process(data: Uint8Array): Uint8Array {\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let asm = this.aes.asm;\n    let heap = this.aes.heap;\n    let counter = this.counter;\n    let tagSize = this.tagSize;\n    let pos = this.aes.pos;\n    let len = this.aes.len;\n    let rpos = 0;\n    let rlen = len + dlen > tagSize ? (len + dlen - tagSize) & -16 : 0;\n    let tlen = len + dlen - rlen;\n    let wlen = 0;\n\n    if (((counter - 1) << 4) + len + dlen > _AES_GCM_data_maxLength) throw new RangeError('counter overflow');\n\n    const result = new Uint8Array(rlen);\n\n    while (dlen > tlen) {\n      wlen = _heap_write(heap, pos + len, data, dpos, dlen - tlen);\n      len += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, wlen);\n      wlen = asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, wlen);\n\n      if (wlen) result.set(heap.subarray(pos, pos + wlen), rpos);\n      counter += wlen >>> 4;\n      rpos += wlen;\n\n      pos = 0;\n      len = 0;\n    }\n\n    if (dlen > 0) {\n      len += _heap_write(heap, 0, data, dpos, dlen);\n    }\n\n    this.counter = counter;\n    this.aes.pos = pos;\n    this.aes.len = len;\n\n    return result;\n  }\n\n  AES_GCM_Decrypt_finish() {\n    let asm = this.aes.asm;\n    let heap = this.aes.heap;\n    let tagSize = this.tagSize;\n    let adata = this.adata;\n    let counter = this.counter;\n    let pos = this.aes.pos;\n    let len = this.aes.len;\n    let rlen = len - tagSize;\n\n    if (len < tagSize) throw new IllegalStateError('authentication tag not found');\n\n    const result = new Uint8Array(rlen);\n    const atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));\n\n    let i = rlen;\n    for (; i & 15; i++) heap[pos + i] = 0;\n\n    asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA + pos, i);\n    asm.cipher(AES_asm.DEC.CTR, AES_asm.HEAP_DATA + pos, i);\n\n    if (rlen) result.set(heap.subarray(pos, pos + rlen));\n\n    const alen = adata !== undefined ? adata.length : 0;\n    const clen = ((counter - 1) << 4) + len - tagSize;\n    heap[0] = 0;\n    heap[1] = 0;\n    heap[2] = 0;\n    heap[3] = alen >>> 29;\n    heap[4] = alen >>> 21;\n    heap[5] = (alen >>> 13) & 255;\n    heap[6] = (alen >>> 5) & 255;\n    heap[7] = (alen << 3) & 255;\n    heap[8] = heap[9] = heap[10] = 0;\n    heap[11] = clen >>> 29;\n    heap[12] = (clen >>> 21) & 255;\n    heap[13] = (clen >>> 13) & 255;\n    heap[14] = (clen >>> 5) & 255;\n    heap[15] = (clen << 3) & 255;\n    asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, 16);\n    asm.get_iv(AES_asm.HEAP_DATA);\n\n    asm.set_counter(0, 0, 0, this.gamma0);\n    asm.cipher(AES_asm.ENC.CTR, AES_asm.HEAP_DATA, 16);\n\n    let acheck = 0;\n    for (let i = 0; i < tagSize; ++i) acheck |= atag[i] ^ heap[i];\n    if (acheck) throw new SecurityError('data integrity check failed');\n\n    this.counter = 1;\n    this.aes.pos = 0;\n    this.aes.len = 0;\n\n    return result;\n  }\n\n  private AES_GCM_decrypt(data: Uint8Array): Uint8Array {\n    const result1 = this.AES_GCM_Decrypt_process(data);\n    const result2 = this.AES_GCM_Decrypt_finish();\n\n    const result = new Uint8Array(result1.length + result2.length);\n    if (result1.length) result.set(result1);\n    if (result2.length) result.set(result2, result1.length);\n\n    return result;\n  }\n\n  private AES_GCM_encrypt(data: Uint8Array): Uint8Array {\n    const result1 = this.AES_GCM_Encrypt_process(data);\n    const result2 = this.AES_GCM_Encrypt_finish();\n\n    const result = new Uint8Array(result1.length + result2.length);\n    if (result1.length) result.set(result1);\n    if (result2.length) result.set(result2, result1.length);\n\n    return result;\n  }\n\n  _gcm_mac_process(data: Uint8Array) {\n    const heap = this.aes.heap;\n    const asm = this.aes.asm;\n    let dpos = 0;\n    let dlen = data.length || 0;\n    let wlen = 0;\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, 0, data, dpos, dlen);\n      dpos += wlen;\n      dlen -= wlen;\n\n      while (wlen & 15) heap[wlen++] = 0;\n\n      asm.mac(AES_asm.MAC.GCM, AES_asm.HEAP_DATA, wlen);\n    }\n  }\n}\n"
  },
  {
    "path": "src/aes/ofb.ts",
    "content": "import { AES } from './aes';\nimport { joinBytes } from '../other/utils';\n\nexport class AES_OFB {\n  private aes: AES;\n\n  static encrypt(data: Uint8Array, key: Uint8Array, iv?: Uint8Array): Uint8Array {\n    return new AES_OFB(key, iv).encrypt(data);\n  }\n\n  static decrypt(data: Uint8Array, key: Uint8Array, iv?: Uint8Array): Uint8Array {\n    return new AES_OFB(key, iv).decrypt(data);\n  }\n\n  constructor(key: Uint8Array, iv?: Uint8Array, aes?: AES) {\n    this.aes = aes ? aes : new AES(key, iv, false, 'OFB');\n  }\n\n  encrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Encrypt_process(data);\n    const r2 = this.aes.AES_Encrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    const r1 = this.aes.AES_Decrypt_process(data);\n    const r2 = this.aes.AES_Decrypt_finish();\n\n    return joinBytes(r1, r2);\n  }\n}\n"
  },
  {
    "path": "src/bignum/bigint.asm.d.ts",
    "content": "declare interface bigintresult {\n  sreset: (n?: number) => number;\n  salloc: (n?: number) => number;\n  sfree: (n?: number) => void;\n  z: (l?: number, z?: number, A?: number) => void;\n  tst: (A?: number, lA?: number) => 0;\n  neg: (A?: number, lA?: number, R?: number, lR?: number) => number;\n  cmp: (A?: number, lA?: number, B?: number, lB?: number) => 0;\n  add: (\n    A?: number,\n    lA?: number,\n    B?: number,\n    lB?: number,\n    R?: number,\n    lR?: number,\n  ) => number;\n  sub: (\n    A?: number,\n    lA?: number,\n    B?: number,\n    lB?: number,\n    R?: number,\n    lR?: number,\n  ) => number;\n  mul: (\n    A?: number,\n    lA?: number,\n    B?: number,\n    lB?: number,\n    R?: number,\n    lR?: number,\n  ) => void;\n  sqr: (A?: number, lA?: number, R?: number) => void;\n  div: (\n    N?: number,\n    lN?: number,\n    D?: number,\n    lD?: number,\n    Q?: number,\n  ) => void;\n  mredc: (\n    A?: number,\n    lA?: number,\n    N?: number,\n    lN?: number,\n    y?: number,\n    R?: number,\n  ) => void;\n}\n\nexport function bigint_asm(stdlib: any, foreign: any, buffer: ArrayBuffer): bigintresult;\n"
  },
  {
    "path": "src/bignum/bigint.asm.js",
    "content": "/**\n * Integers are represented as little endian array of 32-bit limbs.\n * Limbs number is a power of 2 and a multiple of 8 (256 bits).\n * Negative values use two's complement representation.\n */\nexport var bigint_asm = function ( stdlib, foreign, buffer ) {\n    \"use asm\";\n\n    var SP = 0;\n\n    var HEAP32 = new stdlib.Uint32Array(buffer);\n\n    var imul = stdlib.Math.imul;\n\n    /**\n     * Simple stack memory allocator\n     *\n     * Methods:\n     *  sreset\n     *  salloc\n     *  sfree\n     */\n\n    function sreset ( p ) {\n        p = p|0;\n        SP = p = (p + 31) & -32;\n        return p|0;\n    }\n\n    function salloc ( l ) {\n        l = l|0;\n        var p = 0; p = SP;\n        SP = p + ((l + 31) & -32)|0;\n        return p|0;\n    }\n\n    function sfree ( l ) {\n        l = l|0;\n        SP = SP - ((l + 31) & -32)|0;\n    }\n\n    /**\n     * Utility functions:\n     *  cp\n     *  z\n     */\n\n    function cp ( l, A, B ) {\n        l = l|0;\n        A = A|0;\n        B = B|0;\n\n        var i = 0;\n\n        if ( (A|0) > (B|0) ) {\n            for ( ; (i|0) < (l|0); i = (i+4)|0 ) {\n                HEAP32[(B+i)>>2] = HEAP32[(A+i)>>2];\n            }\n        }\n        else {\n            for ( i = (l-4)|0; (i|0) >= 0; i = (i-4)|0 ) {\n                HEAP32[(B+i)>>2] = HEAP32[(A+i)>>2];\n            }\n        }\n    }\n\n    function z ( l, z, A ) {\n        l = l|0;\n        z = z|0;\n        A = A|0;\n\n        var i = 0;\n\n        for ( ; (i|0) < (l|0); i = (i+4)|0 ) {\n            HEAP32[(A+i)>>2] = z;\n        }\n    }\n\n    /**\n     * Negate the argument\n     *\n     * Perform two's complement transformation:\n     *\n     *  -A = ~A + 1\n     *\n     * @param A offset of the argment being negated, 32-byte aligned\n     * @param lA length of the argument, multiple of 32\n     *\n     * @param R offset where to place the result to, 32-byte aligned\n     * @param lR length to truncate the result to, multiple of 32\n     */\n    function neg ( A, lA, R, lR ) {\n        A  =  A|0;\n        lA = lA|0;\n        R  =  R|0;\n        lR = lR|0;\n\n        var a = 0, c = 0, t = 0, r = 0, i = 0;\n\n        if ( (lR|0) <= 0 )\n            lR = lA;\n\n        if ( (lR|0) < (lA|0) )\n            lA = lR;\n\n        c = 1;\n        for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {\n            a = ~HEAP32[(A+i)>>2];\n            t = (a & 0xffff) + c|0;\n            r = (a >>> 16) + (t >>> 16)|0;\n            HEAP32[(R+i)>>2] = (r << 16) | (t & 0xffff);\n            c = r >>> 16;\n        }\n\n        for ( ; (i|0) < (lR|0); i = (i+4)|0 ) {\n            HEAP32[(R+i)>>2] = (c-1)|0;\n        }\n\n        return c|0;\n    }\n\n    function cmp ( A, lA, B, lB ) {\n        A  =  A|0;\n        lA = lA|0;\n        B  =  B|0;\n        lB = lB|0;\n\n        var a = 0, b = 0, i = 0;\n\n        if ( (lA|0) > (lB|0) ) {\n            for ( i = (lA-4)|0; (i|0) >= (lB|0); i = (i-4)|0 ) {\n                if ( HEAP32[(A+i)>>2]|0 ) return 1;\n            }\n        }\n        else {\n            for ( i = (lB-4)|0; (i|0) >= (lA|0); i = (i-4)|0 ) {\n                if ( HEAP32[(B+i)>>2]|0 ) return -1;\n            }\n        }\n\n        for ( ; (i|0) >= 0; i = (i-4)|0 ) {\n            a = HEAP32[(A+i)>>2]|0, b = HEAP32[(B+i)>>2]|0;\n            if ( (a>>>0) < (b>>>0) ) return -1;\n            if ( (a>>>0) > (b>>>0) ) return 1;\n        }\n\n        return 0;\n    }\n\n    /**\n     * Test the argument\n     *\n     * Same as `cmp` with zero.\n     */\n    function tst ( A, lA ) {\n        A  =  A|0;\n        lA = lA|0;\n\n        var i = 0;\n\n        for ( i = (lA-4)|0; (i|0) >= 0; i = (i-4)|0 ) {\n            if ( HEAP32[(A+i)>>2]|0 ) return (i+4)|0;\n        }\n\n        return 0;\n    }\n\n    /**\n     * Conventional addition\n     *\n     * @param A offset of the first argument, 32-byte aligned\n     * @param lA length of the first argument, multiple of 32\n     *\n     * @param B offset of the second argument, 32-bit aligned\n     * @param lB length of the second argument, multiple of 32\n     *\n     * @param R offset where to place the result to, 32-byte aligned\n     * @param lR length to truncate the result to, multiple of 32\n     */\n    function add ( A, lA, B, lB, R, lR ) {\n        A  =  A|0;\n        lA = lA|0;\n        B  =  B|0;\n        lB = lB|0;\n        R  =  R|0;\n        lR = lR|0;\n\n        var a = 0, b = 0, c = 0, t = 0, r = 0, i = 0;\n\n        if ( (lA|0) < (lB|0) ) {\n            t = A, A = B, B = t;\n            t = lA, lA = lB, lB = t;\n        }\n\n        if ( (lR|0) <= 0 )\n            lR = lA+4|0;\n\n        if ( (lR|0) < (lB|0) )\n            lA = lB = lR;\n\n        for ( ; (i|0) < (lB|0); i = (i+4)|0 ) {\n            a = HEAP32[(A+i)>>2]|0;\n            b = HEAP32[(B+i)>>2]|0;\n            t = ( (a & 0xffff) + (b & 0xffff)|0 ) + c|0;\n            r = ( (a >>> 16) + (b >>> 16)|0 ) + (t >>> 16)|0;\n            HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);\n            c = r >>> 16;\n        }\n\n        for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {\n            a = HEAP32[(A+i)>>2]|0;\n            t = (a & 0xffff) + c|0;\n            r = (a >>> 16) + (t >>> 16)|0;\n            HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);\n            c = r >>> 16;\n        }\n\n        for ( ; (i|0) < (lR|0); i = (i+4)|0 ) {\n            HEAP32[(R+i)>>2] = c|0;\n            c = 0;\n        }\n\n        return c|0;\n    }\n\n   /**\n     * Conventional subtraction\n     *\n     * @param A offset of the first argument, 32-byte aligned\n     * @param lA length of the first argument, multiple of 32\n     *\n     * @param B offset of the second argument, 32-bit aligned\n     * @param lB length of the second argument, multiple of 32\n     *\n     * @param R offset where to place the result to, 32-byte aligned\n     * @param lR length to truncate the result to, multiple of 32\n     */\n    function sub ( A, lA, B, lB, R, lR ) {\n        A  =  A|0;\n        lA = lA|0;\n        B  =  B|0;\n        lB = lB|0;\n        R  =  R|0;\n        lR = lR|0;\n\n        var a = 0, b = 0, c = 0, t = 0, r = 0, i = 0;\n\n        if ( (lR|0) <= 0 )\n            lR = (lA|0) > (lB|0) ? lA+4|0 : lB+4|0;\n\n        if ( (lR|0) < (lA|0) )\n            lA = lR;\n\n        if ( (lR|0) < (lB|0) )\n            lB = lR;\n\n        if ( (lA|0) < (lB|0) ) {\n            for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {\n                a = HEAP32[(A+i)>>2]|0;\n                b = HEAP32[(B+i)>>2]|0;\n                t = ( (a & 0xffff) - (b & 0xffff)|0 ) + c|0;\n                r = ( (a >>> 16) - (b >>> 16)|0 ) + (t >> 16)|0;\n                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);\n                c = r >> 16;\n            }\n\n            for ( ; (i|0) < (lB|0); i = (i+4)|0 ) {\n                b = HEAP32[(B+i)>>2]|0;\n                t = c - (b & 0xffff)|0;\n                r = (t >> 16) - (b >>> 16)|0;\n                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);\n                c = r >> 16;\n            }\n        }\n        else {\n            for ( ; (i|0) < (lB|0); i = (i+4)|0 ) {\n                a = HEAP32[(A+i)>>2]|0;\n                b = HEAP32[(B+i)>>2]|0;\n                t = ( (a & 0xffff) - (b & 0xffff)|0 ) + c|0;\n                r = ( (a >>> 16) - (b >>> 16)|0 ) + (t >> 16)|0;\n                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);\n                c = r >> 16;\n            }\n\n            for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {\n                a = HEAP32[(A+i)>>2]|0;\n                t = (a & 0xffff) + c|0;\n                r = (a >>> 16) + (t >> 16)|0;\n                HEAP32[(R+i)>>2] = (t & 0xffff) | (r << 16);\n                c = r >> 16;\n            }\n        }\n\n        for ( ; (i|0) < (lR|0); i = (i+4)|0 ) {\n            HEAP32[(R+i)>>2] = c|0;\n        }\n\n        return c|0;\n    }\n\n    /**\n     * Conventional multiplication\n     *\n     * TODO implement Karatsuba algorithm for large multiplicands\n     *\n     * @param A offset of the first argument, 32-byte aligned\n     * @param lA length of the first argument, multiple of 32\n     *\n     * @param B offset of the second argument, 32-byte aligned\n     * @param lB length of the second argument, multiple of 32\n     *\n     * @param R offset where to place the result to, 32-byte aligned\n     * @param lR length to truncate the result to, multiple of 32\n     */\n    function mul ( A, lA, B, lB, R, lR ) {\n        A  =  A|0;\n        lA = lA|0;\n        B  =  B|0;\n        lB = lB|0;\n        R  =  R|0;\n        lR = lR|0;\n\n        var al0 = 0, al1 = 0, al2 = 0, al3 = 0, al4 = 0, al5 = 0, al6 = 0, al7 = 0, ah0 = 0, ah1 = 0, ah2 = 0, ah3 = 0, ah4 = 0, ah5 = 0, ah6 = 0, ah7 = 0,\n            bl0 = 0, bl1 = 0, bl2 = 0, bl3 = 0, bl4 = 0, bl5 = 0, bl6 = 0, bl7 = 0, bh0 = 0, bh1 = 0, bh2 = 0, bh3 = 0, bh4 = 0, bh5 = 0, bh6 = 0, bh7 = 0,\n            r0 = 0, r1 = 0, r2 = 0, r3 = 0, r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0, r9 = 0, r10 = 0, r11 = 0, r12 = 0, r13 = 0, r14 = 0, r15 = 0,\n            u = 0, v = 0, w = 0, m = 0,\n            i = 0, Ai = 0, j = 0, Bj = 0, Rk = 0;\n\n        if ( (lA|0) > (lB|0) ) {\n            u = A, v = lA;\n            A = B, lA = lB;\n            B = u, lB = v;\n        }\n\n        m = (lA+lB)|0;\n        if ( ( (lR|0) > (m|0) ) | ( (lR|0) <= 0 ) )\n            lR = m;\n\n        if ( (lR|0) < (lA|0) )\n            lA = lR;\n\n        if ( (lR|0) < (lB|0) )\n            lB = lR;\n\n        for ( ; (i|0) < (lA|0); i = (i+32)|0 ) {\n            Ai = (A+i)|0;\n\n            ah0 = HEAP32[(Ai|0)>>2]|0,\n            ah1 = HEAP32[(Ai|4)>>2]|0,\n            ah2 = HEAP32[(Ai|8)>>2]|0,\n            ah3 = HEAP32[(Ai|12)>>2]|0,\n            ah4 = HEAP32[(Ai|16)>>2]|0,\n            ah5 = HEAP32[(Ai|20)>>2]|0,\n            ah6 = HEAP32[(Ai|24)>>2]|0,\n            ah7 = HEAP32[(Ai|28)>>2]|0,\n            al0 = ah0 & 0xffff,\n            al1 = ah1 & 0xffff,\n            al2 = ah2 & 0xffff,\n            al3 = ah3 & 0xffff,\n            al4 = ah4 & 0xffff,\n            al5 = ah5 & 0xffff,\n            al6 = ah6 & 0xffff,\n            al7 = ah7 & 0xffff,\n            ah0 = ah0 >>> 16,\n            ah1 = ah1 >>> 16,\n            ah2 = ah2 >>> 16,\n            ah3 = ah3 >>> 16,\n            ah4 = ah4 >>> 16,\n            ah5 = ah5 >>> 16,\n            ah6 = ah6 >>> 16,\n            ah7 = ah7 >>> 16;\n\n            r8 = r9 = r10 = r11 = r12 = r13 = r14 = r15 = 0;\n\n            for ( j = 0; (j|0) < (lB|0); j = (j+32)|0 ) {\n                Bj = (B+j)|0;\n                Rk = (R+(i+j|0))|0;\n\n                bh0 = HEAP32[(Bj|0)>>2]|0,\n                bh1 = HEAP32[(Bj|4)>>2]|0,\n                bh2 = HEAP32[(Bj|8)>>2]|0,\n                bh3 = HEAP32[(Bj|12)>>2]|0,\n                bh4 = HEAP32[(Bj|16)>>2]|0,\n                bh5 = HEAP32[(Bj|20)>>2]|0,\n                bh6 = HEAP32[(Bj|24)>>2]|0,\n                bh7 = HEAP32[(Bj|28)>>2]|0,\n                bl0 = bh0 & 0xffff,\n                bl1 = bh1 & 0xffff,\n                bl2 = bh2 & 0xffff,\n                bl3 = bh3 & 0xffff,\n                bl4 = bh4 & 0xffff,\n                bl5 = bh5 & 0xffff,\n                bl6 = bh6 & 0xffff,\n                bl7 = bh7 & 0xffff,\n                bh0 = bh0 >>> 16,\n                bh1 = bh1 >>> 16,\n                bh2 = bh2 >>> 16,\n                bh3 = bh3 >>> 16,\n                bh4 = bh4 >>> 16,\n                bh5 = bh5 >>> 16,\n                bh6 = bh6 >>> 16,\n                bh7 = bh7 >>> 16;\n\n                r0 = HEAP32[(Rk|0)>>2]|0,\n                r1 = HEAP32[(Rk|4)>>2]|0,\n                r2 = HEAP32[(Rk|8)>>2]|0,\n                r3 = HEAP32[(Rk|12)>>2]|0,\n                r4 = HEAP32[(Rk|16)>>2]|0,\n                r5 = HEAP32[(Rk|20)>>2]|0,\n                r6 = HEAP32[(Rk|24)>>2]|0,\n                r7 = HEAP32[(Rk|28)>>2]|0;\n\n                u = ((imul(al0, bl0)|0) + (r8 & 0xffff)|0) + (r0 & 0xffff)|0;\n                v = ((imul(ah0, bl0)|0) + (r8 >>> 16)|0) + (r0 >>> 16)|0;\n                w = ((imul(al0, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r0 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl1)|0) + (m & 0xffff)|0) + (r1 & 0xffff)|0;\n                v = ((imul(ah0, bl1)|0) + (m >>> 16)|0) + (r1 >>> 16)|0;\n                w = ((imul(al0, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r1 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl2)|0) + (m & 0xffff)|0) + (r2 & 0xffff)|0;\n                v = ((imul(ah0, bl2)|0) + (m >>> 16)|0) + (r2 >>> 16)|0;\n                w = ((imul(al0, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r2 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl3)|0) + (m & 0xffff)|0) + (r3 & 0xffff)|0;\n                v = ((imul(ah0, bl3)|0) + (m >>> 16)|0) + (r3 >>> 16)|0;\n                w = ((imul(al0, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r3 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl4)|0) + (m & 0xffff)|0) + (r4 & 0xffff)|0;\n                v = ((imul(ah0, bl4)|0) + (m >>> 16)|0) + (r4 >>> 16)|0;\n                w = ((imul(al0, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r4 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl5)|0) + (m & 0xffff)|0) + (r5 & 0xffff)|0;\n                v = ((imul(ah0, bl5)|0) + (m >>> 16)|0) + (r5 >>> 16)|0;\n                w = ((imul(al0, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r5 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl6)|0) + (m & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah0, bl6)|0) + (m >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al0, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al0, bl7)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah0, bl7)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al0, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                r8 = m;\n\n                u = ((imul(al1, bl0)|0) + (r9 & 0xffff)|0) + (r1 & 0xffff)|0;\n                v = ((imul(ah1, bl0)|0) + (r9 >>> 16)|0) + (r1 >>> 16)|0;\n                w = ((imul(al1, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r1 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl1)|0) + (m & 0xffff)|0) + (r2 & 0xffff)|0;\n                v = ((imul(ah1, bl1)|0) + (m >>> 16)|0) + (r2 >>> 16)|0;\n                w = ((imul(al1, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r2 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl2)|0) + (m & 0xffff)|0) + (r3 & 0xffff)|0;\n                v = ((imul(ah1, bl2)|0) + (m >>> 16)|0) + (r3 >>> 16)|0;\n                w = ((imul(al1, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r3 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl3)|0) + (m & 0xffff)|0) + (r4 & 0xffff)|0;\n                v = ((imul(ah1, bl3)|0) + (m >>> 16)|0) + (r4 >>> 16)|0;\n                w = ((imul(al1, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r4 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl4)|0) + (m & 0xffff)|0) + (r5 & 0xffff)|0;\n                v = ((imul(ah1, bl4)|0) + (m >>> 16)|0) + (r5 >>> 16)|0;\n                w = ((imul(al1, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r5 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl5)|0) + (m & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah1, bl5)|0) + (m >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al1, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl6)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah1, bl6)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al1, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al1, bl7)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah1, bl7)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al1, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah1, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                r9 = m;\n\n                u = ((imul(al2, bl0)|0) + (r10 & 0xffff)|0) + (r2 & 0xffff)|0;\n                v = ((imul(ah2, bl0)|0) + (r10 >>> 16)|0) + (r2 >>> 16)|0;\n                w = ((imul(al2, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r2 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl1)|0) + (m & 0xffff)|0) + (r3 & 0xffff)|0;\n                v = ((imul(ah2, bl1)|0) + (m >>> 16)|0) + (r3 >>> 16)|0;\n                w = ((imul(al2, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r3 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl2)|0) + (m & 0xffff)|0) + (r4 & 0xffff)|0;\n                v = ((imul(ah2, bl2)|0) + (m >>> 16)|0) + (r4 >>> 16)|0;\n                w = ((imul(al2, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r4 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl3)|0) + (m & 0xffff)|0) + (r5 & 0xffff)|0;\n                v = ((imul(ah2, bl3)|0) + (m >>> 16)|0) + (r5 >>> 16)|0;\n                w = ((imul(al2, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r5 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl4)|0) + (m & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah2, bl4)|0) + (m >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al2, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl5)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah2, bl5)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al2, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl6)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah2, bl6)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al2, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al2, bl7)|0) + (m & 0xffff)|0) + (r9 & 0xffff)|0;\n                v = ((imul(ah2, bl7)|0) + (m >>> 16)|0) + (r9 >>> 16)|0;\n                w = ((imul(al2, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah2, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r9 = (w << 16) | (u & 0xffff);\n\n                r10 = m;\n\n                u = ((imul(al3, bl0)|0) + (r11 & 0xffff)|0) + (r3 & 0xffff)|0;\n                v = ((imul(ah3, bl0)|0) + (r11 >>> 16)|0) + (r3 >>> 16)|0;\n                w = ((imul(al3, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r3 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl1)|0) + (m & 0xffff)|0) + (r4 & 0xffff)|0;\n                v = ((imul(ah3, bl1)|0) + (m >>> 16)|0) + (r4 >>> 16)|0;\n                w = ((imul(al3, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r4 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl2)|0) + (m & 0xffff)|0) + (r5 & 0xffff)|0;\n                v = ((imul(ah3, bl2)|0) + (m >>> 16)|0) + (r5 >>> 16)|0;\n                w = ((imul(al3, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r5 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl3)|0) + (m & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah3, bl3)|0) + (m >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al3, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl4)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah3, bl4)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al3, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl5)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah3, bl5)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al3, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl6)|0) + (m & 0xffff)|0) + (r9 & 0xffff)|0;\n                v = ((imul(ah3, bl6)|0) + (m >>> 16)|0) + (r9 >>> 16)|0;\n                w = ((imul(al3, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r9 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al3, bl7)|0) + (m & 0xffff)|0) + (r10 & 0xffff)|0;\n                v = ((imul(ah3, bl7)|0) + (m >>> 16)|0) + (r10 >>> 16)|0;\n                w = ((imul(al3, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah3, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r10 = (w << 16) | (u & 0xffff);\n\n                r11 = m;\n\n                u = ((imul(al4, bl0)|0) + (r12 & 0xffff)|0) + (r4 & 0xffff)|0;\n                v = ((imul(ah4, bl0)|0) + (r12 >>> 16)|0) + (r4 >>> 16)|0;\n                w = ((imul(al4, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r4 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl1)|0) + (m & 0xffff)|0) + (r5 & 0xffff)|0;\n                v = ((imul(ah4, bl1)|0) + (m >>> 16)|0) + (r5 >>> 16)|0;\n                w = ((imul(al4, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r5 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl2)|0) + (m & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah4, bl2)|0) + (m >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al4, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl3)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah4, bl3)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al4, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl4)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah4, bl4)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al4, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl5)|0) + (m & 0xffff)|0) + (r9 & 0xffff)|0;\n                v = ((imul(ah4, bl5)|0) + (m >>> 16)|0) + (r9 >>> 16)|0;\n                w = ((imul(al4, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r9 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl6)|0) + (m & 0xffff)|0) + (r10 & 0xffff)|0;\n                v = ((imul(ah4, bl6)|0) + (m >>> 16)|0) + (r10 >>> 16)|0;\n                w = ((imul(al4, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r10 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al4, bl7)|0) + (m & 0xffff)|0) + (r11 & 0xffff)|0;\n                v = ((imul(ah4, bl7)|0) + (m >>> 16)|0) + (r11 >>> 16)|0;\n                w = ((imul(al4, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah4, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r11 = (w << 16) | (u & 0xffff);\n\n                r12 = m;\n\n                u = ((imul(al5, bl0)|0) + (r13 & 0xffff)|0) + (r5 & 0xffff)|0;\n                v = ((imul(ah5, bl0)|0) + (r13 >>> 16)|0) + (r5 >>> 16)|0;\n                w = ((imul(al5, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r5 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl1)|0) + (m & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah5, bl1)|0) + (m >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al5, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl2)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah5, bl2)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al5, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl3)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah5, bl3)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al5, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl4)|0) + (m & 0xffff)|0) + (r9 & 0xffff)|0;\n                v = ((imul(ah5, bl4)|0) + (m >>> 16)|0) + (r9 >>> 16)|0;\n                w = ((imul(al5, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r9 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl5)|0) + (m & 0xffff)|0) + (r10 & 0xffff)|0;\n                v = ((imul(ah5, bl5)|0) + (m >>> 16)|0) + (r10 >>> 16)|0;\n                w = ((imul(al5, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r10 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl6)|0) + (m & 0xffff)|0) + (r11 & 0xffff)|0;\n                v = ((imul(ah5, bl6)|0) + (m >>> 16)|0) + (r11 >>> 16)|0;\n                w = ((imul(al5, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r11 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al5, bl7)|0) + (m & 0xffff)|0) + (r12 & 0xffff)|0;\n                v = ((imul(ah5, bl7)|0) + (m >>> 16)|0) + (r12 >>> 16)|0;\n                w = ((imul(al5, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah5, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r12 = (w << 16) | (u & 0xffff);\n\n                r13 = m;\n\n                u = ((imul(al6, bl0)|0) + (r14 & 0xffff)|0) + (r6 & 0xffff)|0;\n                v = ((imul(ah6, bl0)|0) + (r14 >>> 16)|0) + (r6 >>> 16)|0;\n                w = ((imul(al6, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r6 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl1)|0) + (m & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah6, bl1)|0) + (m >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al6, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl2)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah6, bl2)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al6, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl3)|0) + (m & 0xffff)|0) + (r9 & 0xffff)|0;\n                v = ((imul(ah6, bl3)|0) + (m >>> 16)|0) + (r9 >>> 16)|0;\n                w = ((imul(al6, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r9 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl4)|0) + (m & 0xffff)|0) + (r10 & 0xffff)|0;\n                v = ((imul(ah6, bl4)|0) + (m >>> 16)|0) + (r10 >>> 16)|0;\n                w = ((imul(al6, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r10 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl5)|0) + (m & 0xffff)|0) + (r11 & 0xffff)|0;\n                v = ((imul(ah6, bl5)|0) + (m >>> 16)|0) + (r11 >>> 16)|0;\n                w = ((imul(al6, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r11 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl6)|0) + (m & 0xffff)|0) + (r12 & 0xffff)|0;\n                v = ((imul(ah6, bl6)|0) + (m >>> 16)|0) + (r12 >>> 16)|0;\n                w = ((imul(al6, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r12 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al6, bl7)|0) + (m & 0xffff)|0) + (r13 & 0xffff)|0;\n                v = ((imul(ah6, bl7)|0) + (m >>> 16)|0) + (r13 >>> 16)|0;\n                w = ((imul(al6, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah6, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r13 = (w << 16) | (u & 0xffff);\n\n                r14 = m;\n\n                u = ((imul(al7, bl0)|0) + (r15 & 0xffff)|0) + (r7 & 0xffff)|0;\n                v = ((imul(ah7, bl0)|0) + (r15 >>> 16)|0) + (r7 >>> 16)|0;\n                w = ((imul(al7, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r7 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl1)|0) + (m & 0xffff)|0) + (r8 & 0xffff)|0;\n                v = ((imul(ah7, bl1)|0) + (m >>> 16)|0) + (r8 >>> 16)|0;\n                w = ((imul(al7, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r8 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl2)|0) + (m & 0xffff)|0) + (r9 & 0xffff)|0;\n                v = ((imul(ah7, bl2)|0) + (m >>> 16)|0) + (r9 >>> 16)|0;\n                w = ((imul(al7, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r9 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl3)|0) + (m & 0xffff)|0) + (r10 & 0xffff)|0;\n                v = ((imul(ah7, bl3)|0) + (m >>> 16)|0) + (r10 >>> 16)|0;\n                w = ((imul(al7, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r10 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl4)|0) + (m & 0xffff)|0) + (r11 & 0xffff)|0;\n                v = ((imul(ah7, bl4)|0) + (m >>> 16)|0) + (r11 >>> 16)|0;\n                w = ((imul(al7, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r11 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl5)|0) + (m & 0xffff)|0) + (r12 & 0xffff)|0;\n                v = ((imul(ah7, bl5)|0) + (m >>> 16)|0) + (r12 >>> 16)|0;\n                w = ((imul(al7, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r12 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl6)|0) + (m & 0xffff)|0) + (r13 & 0xffff)|0;\n                v = ((imul(ah7, bl6)|0) + (m >>> 16)|0) + (r13 >>> 16)|0;\n                w = ((imul(al7, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r13 = (w << 16) | (u & 0xffff);\n\n                u = ((imul(al7, bl7)|0) + (m & 0xffff)|0) + (r14 & 0xffff)|0;\n                v = ((imul(ah7, bl7)|0) + (m >>> 16)|0) + (r14 >>> 16)|0;\n                w = ((imul(al7, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah7, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r14 = (w << 16) | (u & 0xffff);\n\n                r15 = m;\n\n                HEAP32[(Rk|0)>>2] = r0,\n                HEAP32[(Rk|4)>>2] = r1,\n                HEAP32[(Rk|8)>>2] = r2,\n                HEAP32[(Rk|12)>>2] = r3,\n                HEAP32[(Rk|16)>>2] = r4,\n                HEAP32[(Rk|20)>>2] = r5,\n                HEAP32[(Rk|24)>>2] = r6,\n                HEAP32[(Rk|28)>>2] = r7;\n            }\n\n            Rk = (R+(i+j|0))|0;\n            HEAP32[(Rk|0)>>2] = r8,\n            HEAP32[(Rk|4)>>2] = r9,\n            HEAP32[(Rk|8)>>2] = r10,\n            HEAP32[(Rk|12)>>2] = r11,\n            HEAP32[(Rk|16)>>2] = r12,\n            HEAP32[(Rk|20)>>2] = r13,\n            HEAP32[(Rk|24)>>2] = r14,\n            HEAP32[(Rk|28)>>2] = r15;\n        }\n/*\n        for ( i = lA & -32; (i|0) < (lA|0); i = (i+4)|0 ) {\n            Ai = (A+i)|0;\n\n            ah0 = HEAP32[Ai>>2]|0,\n            al0 = ah0 & 0xffff,\n            ah0 = ah0 >>> 16;\n\n            r1 = 0;\n\n            for ( j = 0; (j|0) < (lB|0); j = (j+4)|0 ) {\n                Bj = (B+j)|0;\n                Rk = (R+(i+j|0))|0;\n\n                bh0 = HEAP32[Bj>>2]|0,\n                bl0 = bh0 & 0xffff,\n                bh0 = bh0 >>> 16;\n\n                r0 = HEAP32[Rk>>2]|0;\n\n                u = ((imul(al0, bl0)|0) + (r1 & 0xffff)|0) + (r0 & 0xffff)|0;\n                v = ((imul(ah0, bl0)|0) + (r1 >>> 16)|0) + (r0 >>> 16)|0;\n                w = ((imul(al0, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                m = ((imul(ah0, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                r0 = (w << 16) | (u & 0xffff);\n\n                r1 = m;\n\n                HEAP32[Rk>>2] = r0;\n            }\n\n            Rk = (R+(i+j|0))|0;\n            HEAP32[Rk>>2] = r1;\n        }\n*/\n    }\n\n    /**\n     * Fast squaring\n     *\n     * Exploits the fact:\n     *\n     *  X² = ( X0 + X1*B )² = X0² + 2*X0*X1*B + X1²*B²,\n     *\n     * where B is a power of 2, so:\n     *\n     *  2*X0*X1*B = (X0*X1 << 1)*B\n     *\n     * @param A offset of the argument being squared, 32-byte aligned\n     * @param lA length of the argument, multiple of 32\n     *\n     * @param R offset where to place the result to, 32-byte aligned\n     */\n    function sqr ( A, lA, R ) {\n        A  =  A|0;\n        lA = lA|0;\n        R  =  R|0;\n\n        var al0 = 0, al1 = 0, al2 = 0, al3 = 0, al4 = 0, al5 = 0, al6 = 0, al7 = 0, ah0 = 0, ah1 = 0, ah2 = 0, ah3 = 0, ah4 = 0, ah5 = 0, ah6 = 0, ah7 = 0,\n            bl0 = 0, bl1 = 0, bl2 = 0, bl3 = 0, bl4 = 0, bl5 = 0, bl6 = 0, bl7 = 0, bh0 = 0, bh1 = 0, bh2 = 0, bh3 = 0, bh4 = 0, bh5 = 0, bh6 = 0, bh7 = 0,\n            r0 = 0, r1 = 0, r2 = 0, r3 = 0, r4 = 0, r5 = 0, r6 = 0, r7 = 0, r8 = 0, r9 = 0, r10 = 0, r11 = 0, r12 = 0, r13 = 0, r14 = 0, r15 = 0,\n            u = 0, v = 0, w = 0, c = 0, h = 0, m = 0, r = 0,\n            d = 0, dd = 0, p = 0, i = 0, j = 0, k = 0, Ai = 0, Aj = 0, Rk = 0;\n\n        // prepare for iterations\n        for ( ; (i|0) < (lA|0); i = (i+4)|0 ) {\n            Rk = R+(i<<1)|0;\n            ah0 = HEAP32[(A+i)>>2]|0, al0 = ah0 & 0xffff, ah0 = ah0 >>> 16;\n            u = imul(al0,al0)|0;\n            v = (imul(al0,ah0)|0) + (u >>> 17)|0;\n            w = (imul(ah0,ah0)|0) + (v >>> 15)|0;\n            HEAP32[(Rk)>>2] = (v << 17) | (u & 0x1ffff);\n            HEAP32[(Rk|4)>>2] = w;\n        }\n\n        // unrolled 1st iteration\n        for ( p = 0; (p|0) < (lA|0); p = (p+8)|0 ) {\n            Ai = A+p|0, Rk = R+(p<<1)|0;\n\n            ah0 = HEAP32[(Ai)>>2]|0, al0 = ah0 & 0xffff, ah0 = ah0 >>> 16;\n\n            bh0 = HEAP32[(Ai|4)>>2]|0, bl0 = bh0 & 0xffff, bh0 = bh0 >>> 16;\n\n            u = imul(al0,bl0)|0;\n            v = (imul(al0,bh0)|0) + (u >>> 16)|0;\n            w = (imul(ah0,bl0)|0) + (v & 0xffff)|0;\n            m = ((imul(ah0,bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n\n            r = HEAP32[(Rk|4)>>2]|0;\n            u = (r & 0xffff) + ((u & 0xffff) << 1)|0;\n            w = ((r >>> 16) + ((w & 0xffff) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|4)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|8)>>2]|0;\n            u = ((r & 0xffff) + ((m & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((m >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|8)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            if ( c ) {\n                r = HEAP32[(Rk|12)>>2]|0;\n                u = (r & 0xffff) + c|0;\n                w = (r >>> 16) + (u >>> 16)|0;\n                HEAP32[(Rk|12)>>2] = (w << 16) | (u & 0xffff);\n            }\n        }\n\n        // unrolled 2nd iteration\n        for ( p = 0; (p|0) < (lA|0); p = (p+16)|0 ) {\n            Ai = A+p|0, Rk = R+(p<<1)|0;\n\n            ah0 = HEAP32[(Ai)>>2]|0, al0 = ah0 & 0xffff, ah0 = ah0 >>> 16,\n            ah1 = HEAP32[(Ai|4)>>2]|0, al1 = ah1 & 0xffff, ah1 = ah1 >>> 16;\n\n            bh0 = HEAP32[(Ai|8)>>2]|0, bl0 = bh0 & 0xffff, bh0 = bh0 >>> 16,\n            bh1 = HEAP32[(Ai|12)>>2]|0, bl1 = bh1 & 0xffff, bh1 = bh1 >>> 16;\n\n            u = imul(al0, bl0)|0;\n            v = imul(ah0, bl0)|0;\n            w = ((imul(al0, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah0, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r0 = (w << 16) | (u & 0xffff);\n\n            u = (imul(al0, bl1)|0) + (m & 0xffff)|0;\n            v = (imul(ah0, bl1)|0) + (m >>> 16)|0;\n            w = ((imul(al0, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah0, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r1 = (w << 16) | (u & 0xffff);\n\n            r2 = m;\n\n            u = (imul(al1, bl0)|0) + (r1 & 0xffff)|0;\n            v = (imul(ah1, bl0)|0) + (r1 >>> 16)|0;\n            w = ((imul(al1, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah1, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r1 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al1, bl1)|0) + (r2 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah1, bl1)|0) + (r2 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al1, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah1, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r2 = (w << 16) | (u & 0xffff);\n\n            r3 = m;\n\n            r = HEAP32[(Rk|8)>>2]|0;\n            u = (r & 0xffff) + ((r0 & 0xffff) << 1)|0;\n            w = ((r >>> 16) + ((r0 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|8)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|12)>>2]|0;\n            u = ((r & 0xffff) + ((r1 & 0xffff) << 1)|0)  + c|0;\n            w = ((r >>> 16) + ((r1 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|12)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|16)>>2]|0;\n            u = ((r & 0xffff) + ((r2 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r2 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|16)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|20)>>2]|0;\n            u = ((r & 0xffff) + ((r3 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r3 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|20)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            for ( k = 24; !!c & ( (k|0) < 32 ); k = (k+4)|0 ) {\n                r = HEAP32[(Rk|k)>>2]|0;\n                u = (r & 0xffff) + c|0;\n                w = (r >>> 16) + (u >>> 16)|0;\n                HEAP32[(Rk|k)>>2] = (w << 16) | (u & 0xffff);\n                c = w >>> 16;\n            }\n        }\n\n        // unrolled 3rd iteration\n        for ( p = 0; (p|0) < (lA|0); p = (p+32)|0 ) {\n            Ai = A+p|0, Rk = R+(p<<1)|0;\n\n            ah0 = HEAP32[(Ai)>>2]|0, al0 = ah0 & 0xffff, ah0 = ah0 >>> 16,\n            ah1 = HEAP32[(Ai|4)>>2]|0, al1 = ah1 & 0xffff, ah1 = ah1 >>> 16,\n            ah2 = HEAP32[(Ai|8)>>2]|0, al2 = ah2 & 0xffff, ah2 = ah2 >>> 16,\n            ah3 = HEAP32[(Ai|12)>>2]|0, al3 = ah3 & 0xffff, ah3 = ah3 >>> 16;\n\n            bh0 = HEAP32[(Ai|16)>>2]|0, bl0 = bh0 & 0xffff, bh0 = bh0 >>> 16,\n            bh1 = HEAP32[(Ai|20)>>2]|0, bl1 = bh1 & 0xffff, bh1 = bh1 >>> 16,\n            bh2 = HEAP32[(Ai|24)>>2]|0, bl2 = bh2 & 0xffff, bh2 = bh2 >>> 16,\n            bh3 = HEAP32[(Ai|28)>>2]|0, bl3 = bh3 & 0xffff, bh3 = bh3 >>> 16;\n\n            u = imul(al0, bl0)|0;\n            v = imul(ah0, bl0)|0;\n            w = ((imul(al0, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah0, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r0 = (w << 16) | (u & 0xffff);\n\n            u = (imul(al0, bl1)|0) + (m & 0xffff)|0;\n            v = (imul(ah0, bl1)|0) + (m >>> 16)|0;\n            w = ((imul(al0, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah0, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r1 = (w << 16) | (u & 0xffff);\n\n            u = (imul(al0, bl2)|0) + (m & 0xffff)|0;\n            v = (imul(ah0, bl2)|0) + (m >>> 16)|0;\n            w = ((imul(al0, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah0, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r2 = (w << 16) | (u & 0xffff);\n\n            u = (imul(al0, bl3)|0) + (m & 0xffff)|0;\n            v = (imul(ah0, bl3)|0) + (m >>> 16)|0;\n            w = ((imul(al0, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah0, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r3 = (w << 16) | (u & 0xffff);\n\n            r4 = m;\n\n            u = (imul(al1, bl0)|0) + (r1 & 0xffff)|0;\n            v = (imul(ah1, bl0)|0) + (r1 >>> 16)|0;\n            w = ((imul(al1, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah1, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r1 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al1, bl1)|0) + (r2 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah1, bl1)|0) + (r2 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al1, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah1, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r2 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al1, bl2)|0) + (r3 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah1, bl2)|0) + (r3 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al1, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah1, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r3 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al1, bl3)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah1, bl3)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al1, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah1, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r4 = (w << 16) | (u & 0xffff);\n\n            r5 = m;\n\n            u = (imul(al2, bl0)|0) + (r2 & 0xffff)|0;\n            v = (imul(ah2, bl0)|0) + (r2 >>> 16)|0;\n            w = ((imul(al2, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah2, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r2 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al2, bl1)|0) + (r3 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah2, bl1)|0) + (r3 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al2, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah2, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r3 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al2, bl2)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah2, bl2)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al2, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah2, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r4 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al2, bl3)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah2, bl3)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al2, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah2, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r5 = (w << 16) | (u & 0xffff);\n\n            r6 = m;\n\n            u = (imul(al3, bl0)|0) + (r3 & 0xffff)|0;\n            v = (imul(ah3, bl0)|0) + (r3 >>> 16)|0;\n            w = ((imul(al3, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah3, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r3 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al3, bl1)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah3, bl1)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al3, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah3, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r4 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al3, bl2)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah3, bl2)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al3, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah3, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r5 = (w << 16) | (u & 0xffff);\n\n            u = ((imul(al3, bl3)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n            v = ((imul(ah3, bl3)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n            w = ((imul(al3, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n            m = ((imul(ah3, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n            r6 = (w << 16) | (u & 0xffff);\n\n            r7 = m;\n\n            r = HEAP32[(Rk|16)>>2]|0;\n            u = (r & 0xffff) + ((r0 & 0xffff) << 1)|0;\n            w = ((r >>> 16) + ((r0 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|16)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|20)>>2]|0;\n            u = ((r & 0xffff) + ((r1 & 0xffff) << 1)|0)  + c|0;\n            w = ((r >>> 16) + ((r1 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|20)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|24)>>2]|0;\n            u = ((r & 0xffff) + ((r2 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r2 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|24)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk|28)>>2]|0;\n            u = ((r & 0xffff) + ((r3 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r3 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk|28)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk+32)>>2]|0;\n            u = ((r & 0xffff) + ((r4 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r4 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk+32)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk+36)>>2]|0;\n            u = ((r & 0xffff) + ((r5 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r5 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk+36)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk+40)>>2]|0;\n            u = ((r & 0xffff) + ((r6 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r6 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk+40)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            r = HEAP32[(Rk+44)>>2]|0;\n            u = ((r & 0xffff) + ((r7 & 0xffff) << 1)|0) + c|0;\n            w = ((r >>> 16) + ((r7 >>> 16) << 1)|0) + (u >>> 16)|0;\n            HEAP32[(Rk+44)>>2] = (w << 16) | (u & 0xffff);\n            c = w >>> 16;\n\n            for ( k = 48; !!c & ( (k|0) < 64 ); k = (k+4)|0 ) {\n                r = HEAP32[(Rk+k)>>2]|0;\n                u = (r & 0xffff) + c|0;\n                w = (r >>> 16) + (u >>> 16)|0;\n                HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                c = w >>> 16;\n            }\n        }\n\n        // perform iterations\n        for ( d = 32; (d|0) < (lA|0); d = d << 1 ) { // depth loop\n            dd = d << 1;\n\n            for ( p = 0; (p|0) < (lA|0); p = (p+dd)|0 ) { // part loop\n                Rk = R+(p<<1)|0;\n\n                h = 0;\n                for ( i = 0; (i|0) < (d|0); i = (i+32)|0 ) { // multiply-and-add loop\n                    Ai = (A+p|0)+i|0;\n\n                    ah0 = HEAP32[(Ai)>>2]|0, al0 = ah0 & 0xffff, ah0 = ah0 >>> 16,\n                    ah1 = HEAP32[(Ai|4)>>2]|0, al1 = ah1 & 0xffff, ah1 = ah1 >>> 16,\n                    ah2 = HEAP32[(Ai|8)>>2]|0, al2 = ah2 & 0xffff, ah2 = ah2 >>> 16,\n                    ah3 = HEAP32[(Ai|12)>>2]|0, al3 = ah3 & 0xffff, ah3 = ah3 >>> 16,\n                    ah4 = HEAP32[(Ai|16)>>2]|0, al4 = ah4 & 0xffff, ah4 = ah4 >>> 16,\n                    ah5 = HEAP32[(Ai|20)>>2]|0, al5 = ah5 & 0xffff, ah5 = ah5 >>> 16,\n                    ah6 = HEAP32[(Ai|24)>>2]|0, al6 = ah6 & 0xffff, ah6 = ah6 >>> 16,\n                    ah7 = HEAP32[(Ai|28)>>2]|0, al7 = ah7 & 0xffff, ah7 = ah7 >>> 16;\n\n                    r8 = r9 = r10 = r11 = r12 = r13 = r14 = r15 = c = 0;\n\n                    for ( j = 0; (j|0) < (d|0); j = (j+32)|0 ) {\n                        Aj = ((A+p|0)+d|0)+j|0;\n\n                        bh0 = HEAP32[(Aj)>>2]|0, bl0 = bh0 & 0xffff, bh0 = bh0 >>> 16,\n                        bh1 = HEAP32[(Aj|4)>>2]|0, bl1 = bh1 & 0xffff, bh1 = bh1 >>> 16,\n                        bh2 = HEAP32[(Aj|8)>>2]|0, bl2 = bh2 & 0xffff, bh2 = bh2 >>> 16,\n                        bh3 = HEAP32[(Aj|12)>>2]|0, bl3 = bh3 & 0xffff, bh3 = bh3 >>> 16,\n                        bh4 = HEAP32[(Aj|16)>>2]|0, bl4 = bh4 & 0xffff, bh4 = bh4 >>> 16,\n                        bh5 = HEAP32[(Aj|20)>>2]|0, bl5 = bh5 & 0xffff, bh5 = bh5 >>> 16,\n                        bh6 = HEAP32[(Aj|24)>>2]|0, bl6 = bh6 & 0xffff, bh6 = bh6 >>> 16,\n                        bh7 = HEAP32[(Aj|28)>>2]|0, bl7 = bh7 & 0xffff, bh7 = bh7 >>> 16;\n\n                        r0 = r1 = r2 = r3 = r4 = r5 = r6 = r7 = 0;\n\n                        u = ((imul(al0, bl0)|0) + (r0 & 0xffff)|0) + (r8 & 0xffff)|0;\n                        v = ((imul(ah0, bl0)|0) + (r0 >>> 16)|0) + (r8 >>> 16)|0;\n                        w = ((imul(al0, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r0 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl1)|0) + (r1 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl1)|0) + (r1 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r1 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl2)|0) + (r2 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl2)|0) + (r2 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r2 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl3)|0) + (r3 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl3)|0) + (r3 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r3 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl4)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl4)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r4 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl5)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl5)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r5 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl6)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl6)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al0, bl7)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah0, bl7)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al0, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah0, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        r8 = m;\n\n                        u = ((imul(al1, bl0)|0) + (r1 & 0xffff)|0) + (r9 & 0xffff)|0;\n                        v = ((imul(ah1, bl0)|0) + (r1 >>> 16)|0) + (r9 >>> 16)|0;\n                        w = ((imul(al1, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r1 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl1)|0) + (r2 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl1)|0) + (r2 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r2 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl2)|0) + (r3 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl2)|0) + (r3 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r3 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl3)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl3)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r4 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl4)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl4)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r5 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl5)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl5)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl6)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl6)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al1, bl7)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah1, bl7)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al1, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah1, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        r9 = m;\n\n                        u = ((imul(al2, bl0)|0) + (r2 & 0xffff)|0) + (r10 & 0xffff)|0;\n                        v = ((imul(ah2, bl0)|0) + (r2 >>> 16)|0) + (r10 >>> 16)|0;\n                        w = ((imul(al2, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r2 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl1)|0) + (r3 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl1)|0) + (r3 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r3 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl2)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl2)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r4 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl3)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl3)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r5 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl4)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl4)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl5)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl5)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl6)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl6)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al2, bl7)|0) + (r9 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah2, bl7)|0) + (r9 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al2, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah2, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r9 = (w << 16) | (u & 0xffff);\n\n                        r10 = m;\n\n                        u = ((imul(al3, bl0)|0) + (r3 & 0xffff)|0) + (r11 & 0xffff)|0;\n                        v = ((imul(ah3, bl0)|0) + (r3 >>> 16)|0) + (r11 >>> 16)|0;\n                        w = ((imul(al3, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r3 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl1)|0) + (r4 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl1)|0) + (r4 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r4 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl2)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl2)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r5 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl3)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl3)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl4)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl4)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl5)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl5)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl6)|0) + (r9 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl6)|0) + (r9 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r9 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al3, bl7)|0) + (r10 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah3, bl7)|0) + (r10 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al3, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah3, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r10 = (w << 16) | (u & 0xffff);\n\n                        r11 = m;\n\n                        u = ((imul(al4, bl0)|0) + (r4 & 0xffff)|0) + (r12 & 0xffff)|0;\n                        v = ((imul(ah4, bl0)|0) + (r4 >>> 16)|0) + (r12 >>> 16)|0;\n                        w = ((imul(al4, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r4 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl1)|0) + (r5 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl1)|0) + (r5 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r5 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl2)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl2)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl3)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl3)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl4)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl4)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl5)|0) + (r9 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl5)|0) + (r9 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r9 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl6)|0) + (r10 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl6)|0) + (r10 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r10 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al4, bl7)|0) + (r11 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah4, bl7)|0) + (r11 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al4, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah4, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r11 = (w << 16) | (u & 0xffff);\n\n                        r12 = m;\n\n                        u = ((imul(al5, bl0)|0) + (r5 & 0xffff)|0) + (r13 & 0xffff)|0;\n                        v = ((imul(ah5, bl0)|0) + (r5 >>> 16)|0) + (r13 >>> 16)|0;\n                        w = ((imul(al5, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r5 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl1)|0) + (r6 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl1)|0) + (r6 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl2)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl2)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl3)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl3)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl4)|0) + (r9 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl4)|0) + (r9 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r9 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl5)|0) + (r10 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl5)|0) + (r10 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r10 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl6)|0) + (r11 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl6)|0) + (r11 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r11 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al5, bl7)|0) + (r12 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah5, bl7)|0) + (r12 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al5, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah5, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r12 = (w << 16) | (u & 0xffff);\n\n                        r13 = m;\n\n                        u = ((imul(al6, bl0)|0) + (r6 & 0xffff)|0) + (r14 & 0xffff)|0;\n                        v = ((imul(ah6, bl0)|0) + (r6 >>> 16)|0) + (r14 >>> 16)|0;\n                        w = ((imul(al6, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r6 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl1)|0) + (r7 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl1)|0) + (r7 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl2)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl2)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl3)|0) + (r9 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl3)|0) + (r9 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r9 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl4)|0) + (r10 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl4)|0) + (r10 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r10 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl5)|0) + (r11 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl5)|0) + (r11 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r11 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl6)|0) + (r12 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl6)|0) + (r12 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r12 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al6, bl7)|0) + (r13 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah6, bl7)|0) + (r13 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al6, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah6, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r13 = (w << 16) | (u & 0xffff);\n\n                        r14 = m;\n\n                        u = ((imul(al7, bl0)|0) + (r7 & 0xffff)|0) + (r15 & 0xffff)|0;\n                        v = ((imul(ah7, bl0)|0) + (r7 >>> 16)|0) + (r15 >>> 16)|0;\n                        w = ((imul(al7, bh0)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh0)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r7 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl1)|0) + (r8 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl1)|0) + (r8 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh1)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh1)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r8 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl2)|0) + (r9 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl2)|0) + (r9 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh2)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh2)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r9 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl3)|0) + (r10 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl3)|0) + (r10 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh3)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh3)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r10 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl4)|0) + (r11 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl4)|0) + (r11 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh4)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh4)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r11 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl5)|0) + (r12 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl5)|0) + (r12 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh5)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh5)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r12 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl6)|0) + (r13 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl6)|0) + (r13 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh6)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh6)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r13 = (w << 16) | (u & 0xffff);\n\n                        u = ((imul(al7, bl7)|0) + (r14 & 0xffff)|0) + (m & 0xffff)|0;\n                        v = ((imul(ah7, bl7)|0) + (r14 >>> 16)|0) + (m >>> 16)|0;\n                        w = ((imul(al7, bh7)|0) + (v & 0xffff)|0) + (u >>> 16)|0;\n                        m = ((imul(ah7, bh7)|0) + (v >>> 16)|0) + (w >>> 16)|0;\n                        r14 = (w << 16) | (u & 0xffff);\n\n                        r15 = m;\n\n                        k = d+(i+j|0)|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r0 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r0 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r1 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r1 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r2 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r2 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r3 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r3 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r4 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r4 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r5 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r5 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r6 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r6 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n\n                        k = k+4|0;\n                        r = HEAP32[(Rk+k)>>2]|0;\n                        u = ((r & 0xffff) + ((r7 & 0xffff) << 1)|0) + c|0;\n                        w = ((r >>> 16) + ((r7 >>> 16) << 1)|0) + (u >>> 16)|0;\n                        HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                        c = w >>> 16;\n                    }\n\n                    k = d+(i+j|0)|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = (((r & 0xffff) + ((r8 & 0xffff) << 1)|0) + c|0) + h|0;\n                    w = ((r >>> 16) + ((r8 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r9 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r9 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r10 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r10 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r11 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r11 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r12 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r12 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r13 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r13 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r14 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r14 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    c = w >>> 16;\n\n                    k = k+4|0;\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = ((r & 0xffff) + ((r15 & 0xffff) << 1)|0) + c|0;\n                    w = ((r >>> 16) + ((r15 >>> 16) << 1)|0) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    h = w >>> 16;\n                }\n\n                for ( k = k+4|0; !!h & ( (k|0) < (dd<<1) ); k = (k+4)|0 ) { // carry propagation loop\n                    r = HEAP32[(Rk+k)>>2]|0;\n                    u = (r & 0xffff) + h|0;\n                    w = (r >>> 16) + (u >>> 16)|0;\n                    HEAP32[(Rk+k)>>2] = (w << 16) | (u & 0xffff);\n                    h = w >>> 16;\n                }\n            }\n        }\n    }\n\n    /**\n     * Conventional division\n     *\n     * @param A offset of the numerator, 32-byte aligned\n     * @param lA length of the numerator, multiple of 32\n     *\n     * @param B offset of the divisor, 32-byte aligned\n     * @param lB length of the divisor, multiple of 32\n     *\n     * @param R offset where to place the remainder to, 32-byte aligned\n     *\n     * @param Q offser where to place the quotient to, 32-byte aligned\n     */\n\n    function div ( N, lN, D, lD, Q ) {\n        N  =  N|0;\n        lN = lN|0\n        D  =  D|0;\n        lD = lD|0\n        Q  =  Q|0;\n\n        var n = 0, d = 0, e = 0,\n            u1 = 0, u0 = 0,\n            v0 = 0, vh = 0, vl = 0,\n            qh = 0, ql = 0, rh = 0, rl = 0,\n            t1 = 0, t2 = 0, m = 0, c = 0,\n            i = 0, j = 0, k = 0;\n\n        // number of significant limbs in `N` (multiplied by 4)\n        for ( i = (lN-1) & -4; (i|0) >= 0; i = (i-4)|0 ) {\n            n = HEAP32[(N+i)>>2]|0;\n            if ( n ) {\n                lN = i;\n                break;\n            }\n        }\n\n        // number of significant limbs in `D` (multiplied by 4)\n        for ( i = (lD-1) & -4; (i|0) >= 0; i = (i-4)|0 ) {\n            d = HEAP32[(D+i)>>2]|0;\n            if ( d ) {\n                lD = i;\n                break;\n            }\n        }\n\n        // `D` is zero? WTF?!\n\n        // calculate `e` — the power of 2 of the normalization factor\n        while ( (d & 0x80000000) == 0 ) {\n            d = d << 1;\n            e = e + 1|0;\n        }\n\n        // normalize `N` in place\n        u0 = HEAP32[(N+lN)>>2]|0;\n        if ( e ) {\n            u1 = u0>>>(32-e|0);\n            for ( i = (lN-4)|0; (i|0) >= 0; i = (i-4)|0 ) {\n                n = HEAP32[(N+i)>>2]|0;\n                HEAP32[(N+i+4)>>2] = (u0 << e) | ( e ? n >>> (32-e|0) : 0 );\n                u0 = n;\n            }\n            HEAP32[N>>2] = u0 << e;\n        }\n\n        // normalize `D` in place\n        if ( e ) {\n            v0 = HEAP32[(D+lD)>>2]|0;\n            for ( i = (lD-4)|0; (i|0) >= 0; i = (i-4)|0 ) {\n                d = HEAP32[(D+i)>>2]|0;\n                HEAP32[(D+i+4)>>2] = (v0 << e) | ( d >>> (32-e|0) );\n                v0 = d;\n            }\n            HEAP32[D>>2] = v0 << e;\n        }\n\n        // divisor parts won't change\n        v0 = HEAP32[(D+lD)>>2]|0;\n        vh = v0 >>> 16, vl = v0 & 0xffff;\n\n        // perform division\n        for ( i = lN; (i|0) >= (lD|0); i = (i-4)|0 ) {\n            j = (i-lD)|0;\n\n            // estimate high part of the quotient\n            u0 = HEAP32[(N+i)>>2]|0;\n            qh = ( (u1>>>0) / (vh>>>0) )|0, rh = ( (u1>>>0) % (vh>>>0) )|0, t1 = imul(qh, vl)|0;\n            while ( ( (qh|0) == 0x10000 ) | ( (t1>>>0) > (((rh << 16)|(u0 >>> 16))>>>0) ) ) {\n                qh = (qh-1)|0, rh = (rh+vh)|0, t1 = (t1-vl)|0;\n                if ( (rh|0) >= 0x10000 ) break;\n            }\n\n            // bulk multiply-and-subtract\n            // m - multiplication carry, c - subtraction carry\n            m = 0, c = 0;\n            for ( k = 0; (k|0) <= (lD|0); k = (k+4)|0 ) {\n                d = HEAP32[(D+k)>>2]|0;\n                t1 = (imul(qh, d & 0xffff)|0) + (m >>> 16)|0;\n                t2 = (imul(qh, d >>> 16)|0) + (t1 >>> 16)|0;\n                d = (m & 0xffff) | (t1 << 16);\n                m = t2;\n                n = HEAP32[(N+j+k)>>2]|0;\n                t1 = ((n & 0xffff) - (d & 0xffff)|0) + c|0;\n                t2 = ((n >>> 16) - (d >>> 16)|0) + (t1 >> 16)|0;\n                HEAP32[(N+j+k)>>2] = (t2 << 16) | (t1 & 0xffff);\n                c = t2 >> 16;\n            }\n            t1 = ((u1 & 0xffff) - (m & 0xffff)|0) + c|0;\n            t2 = ((u1 >>> 16) - (m >>> 16)|0) + (t1 >> 16)|0;\n            u1 = (t2 << 16) | (t1 & 0xffff);\n            c = t2 >> 16;\n\n            // add `D` back if got carry-out\n            if ( c ) {\n                qh = (qh-1)|0;\n                c = 0;\n                for ( k = 0; (k|0) <= (lD|0); k = (k+4)|0 ) {\n                    d = HEAP32[(D+k)>>2]|0;\n                    n = HEAP32[(N+j+k)>>2]|0;\n                    t1 = (n & 0xffff) + c|0;\n                    t2 = (n >>> 16) + d + (t1 >>> 16)|0;\n                    HEAP32[(N+j+k)>>2] = (t2 << 16) | (t1 & 0xffff);\n                    c = t2 >>> 16;\n                }\n                u1 = (u1+c)|0;\n            }\n\n            // estimate low part of the quotient\n            u0 = HEAP32[(N+i)>>2]|0;\n            n = (u1 << 16) | (u0 >>> 16);\n            ql = ( (n>>>0) / (vh>>>0) )|0, rl = ( (n>>>0) % (vh>>>0) )|0, t1 = imul(ql, vl)|0;\n            while ( ( (ql|0) == 0x10000 ) | ( (t1>>>0) > (((rl << 16)|(u0 & 0xffff))>>>0) ) ) {\n                ql = (ql-1)|0, rl = (rl+vh)|0, t1 = (t1-vl)|0;\n                if ( (rl|0) >= 0x10000 ) break;\n            }\n\n            // bulk multiply-and-subtract\n            // m - multiplication carry, c - subtraction carry\n            m = 0, c = 0;\n            for ( k = 0; (k|0) <= (lD|0); k = (k+4)|0 ) {\n                d = HEAP32[(D+k)>>2]|0;\n                t1 = (imul(ql, d & 0xffff)|0) + (m & 0xffff)|0;\n                t2 = ((imul(ql, d >>> 16)|0) + (t1 >>> 16)|0) + (m >>> 16)|0;\n                d = (t1 & 0xffff) | (t2 << 16);\n                m = t2 >>> 16;\n                n = HEAP32[(N+j+k)>>2]|0;\n                t1 = ((n & 0xffff) - (d & 0xffff)|0) + c|0;\n                t2 = ((n >>> 16) - (d >>> 16)|0) + (t1 >> 16)|0;\n                c = t2 >> 16;\n                HEAP32[(N+j+k)>>2] = (t2 << 16) | (t1 & 0xffff);\n            }\n            t1 = ((u1 & 0xffff) - (m & 0xffff)|0) + c|0;\n            t2 = ((u1 >>> 16) - (m >>> 16)|0) + (t1 >> 16)|0;\n            c = t2 >> 16;\n\n            // add `D` back if got carry-out\n            if ( c ) {\n                ql = (ql-1)|0;\n                c = 0;\n                for ( k = 0; (k|0) <= (lD|0); k = (k+4)|0 ) {\n                    d = HEAP32[(D+k)>>2]|0;\n                    n = HEAP32[(N+j+k)>>2]|0;\n                    t1 = ((n & 0xffff) + (d & 0xffff)|0) + c|0;\n                    t2 = ((n >>> 16) + (d >>> 16)|0) + (t1 >>> 16)|0;\n                    c = t2 >>> 16;\n                    HEAP32[(N+j+k)>>2] = (t1 & 0xffff) | (t2 << 16);\n                }\n            }\n\n            // got quotient limb\n            HEAP32[(Q+j)>>2] = (qh << 16) | ql;\n\n            u1 = HEAP32[(N+i)>>2]|0;\n        }\n\n        if ( e ) {\n            // TODO denormalize `D` in place\n\n            // denormalize `N` in place\n            u0 = HEAP32[N>>2]|0;\n            for ( i = 4; (i|0) <= (lD|0); i = (i+4)|0 ) {\n                n = HEAP32[(N+i)>>2]|0;\n                HEAP32[(N+i-4)>>2] = ( n << (32-e|0) ) | (u0 >>> e);\n                u0 = n;\n            }\n            HEAP32[(N+lD)>>2] = u0 >>> e;\n        }\n    }\n\n    /**\n     * Montgomery modular reduction\n     *\n     * Definition:\n     *\n     *  MREDC(A) = A × X (mod N),\n     *  M × X = N × Y + 1,\n     *\n     * where M = 2^(32*m) such that N < M and A < N×M\n     *\n     * Numbers `X` and `Y` can be calculated using Extended Euclidean Algorithm.\n     */\n    function mredc ( A, lA, N, lN, y, R ) {\n        A  =  A|0;\n        lA = lA|0;\n        N  =  N|0;\n        lN = lN|0;\n        y  =  y|0;\n        R  =  R|0;\n\n        var T = 0,\n            c = 0, uh = 0, ul = 0, vl = 0, vh = 0, w0 = 0, w1 = 0, w2 = 0, r0 = 0, r1 = 0,\n            i = 0, j = 0, k = 0;\n\n        T = salloc(lN<<1)|0;\n        z(lN<<1, 0, T);\n\n        cp( lA, A, T );\n\n        // HAC 14.32\n        for ( i = 0; (i|0) < (lN|0); i = (i+4)|0 ) {\n            uh = HEAP32[(T+i)>>2]|0, ul = uh & 0xffff, uh = uh >>> 16;\n            vh = y >>> 16, vl = y & 0xffff;\n            w0 = imul(ul,vl)|0, w1 = ( (imul(ul,vh)|0) + (imul(uh,vl)|0) | 0 ) + (w0 >>> 16) | 0;\n            ul = w0 & 0xffff, uh = w1 & 0xffff;\n            r1 = 0;\n            for ( j = 0; (j|0) < (lN|0); j = (j+4)|0 ) {\n                k = (i+j)|0;\n                vh = HEAP32[(N+j)>>2]|0, vl = vh & 0xffff, vh = vh >>> 16;\n                r0 = HEAP32[(T+k)>>2]|0;\n                w0 = ((imul(ul, vl)|0) + (r1 & 0xffff)|0) + (r0 & 0xffff)|0;\n                w1 = ((imul(ul, vh)|0) + (r1 >>> 16)|0) + (r0 >>> 16)|0;\n                w2 = ((imul(uh, vl)|0) + (w1 & 0xffff)|0) + (w0 >>> 16)|0;\n                r1 = ((imul(uh, vh)|0) + (w2 >>> 16)|0) + (w1 >>> 16)|0;\n                r0 = (w2 << 16) | (w0 & 0xffff);\n                HEAP32[(T+k)>>2] = r0;\n            }\n            k = (i+j)|0;\n            r0 = HEAP32[(T+k)>>2]|0;\n            w0 = ((r0 & 0xffff) + (r1 & 0xffff)|0) + c|0;\n            w1 = ((r0 >>> 16) + (r1 >>> 16)|0) + (w0 >>> 16)|0;\n            HEAP32[(T+k)>>2] = (w1 << 16) | (w0 & 0xffff);\n            c = w1 >>> 16;\n        }\n\n        cp( lN, (T+lN)|0, R );\n\n        sfree(lN<<1);\n\n        if ( c | ( (cmp( N, lN, R, lN )|0) <= 0 ) ) {\n            sub( R, lN, N, lN, R, lN )|0;\n        }\n    }\n\n    return {\n        sreset: sreset,\n        salloc: salloc,\n        sfree:  sfree,\n        z: z,\n        tst: tst,\n        neg: neg,\n        cmp: cmp,\n        add: add,\n        sub: sub,\n        mul: mul,\n        sqr: sqr,\n        div: div,\n        mredc: mredc\n    };\n}\n"
  },
  {
    "path": "src/bignum/bignum.ts",
    "content": "import { bigint_asm, bigintresult } from './bigint.asm';\nimport { string_to_bytes } from '../other/utils';\nimport { IllegalArgumentError } from '../other/errors';\nimport { BigNumber_extGCD, Number_extGCD } from './extgcd';\nimport { getRandomValues } from '../other/get-random-values';\n\n///////////////////////////////////////////////////////////////////////////////\n\nexport const _bigint_stdlib = { Uint32Array: Uint32Array, Math: Math };\nexport const _bigint_heap = new Uint32Array(0x100000);\nexport let _bigint_asm: bigintresult;\n\nfunction _half_imul(a: number, b: number) {\n  return (a * b) | 0;\n}\n\nif (_bigint_stdlib.Math.imul === undefined) {\n  _bigint_stdlib.Math.imul = _half_imul;\n  _bigint_asm = bigint_asm(_bigint_stdlib, null, _bigint_heap.buffer);\n  delete _bigint_stdlib.Math.imul;\n} else {\n  _bigint_asm = bigint_asm(_bigint_stdlib, null, _bigint_heap.buffer);\n}\n\n///////////////////////////////////////////////////////////////////////////////\n\nconst _BigNumber_ZERO_limbs = new Uint32Array(0);\n\nexport class BigNumber {\n  public limbs!: Uint32Array;\n  public bitLength!: number;\n  public sign!: number;\n\n  static extGCD = BigNumber_extGCD;\n  static ZERO = BigNumber.fromNumber(0);\n  static ONE = BigNumber.fromNumber(1);\n\n  static fromString(str: string): BigNumber {\n    const bytes = string_to_bytes(str);\n    return new BigNumber(bytes);\n  }\n\n  static fromNumber(num: number): BigNumber {\n    let limbs = _BigNumber_ZERO_limbs;\n    let bitlen = 0;\n    let sign = 0;\n\n    var absnum = Math.abs(num);\n    if (absnum > 0xffffffff) {\n      limbs = new Uint32Array(2);\n      limbs[0] = absnum | 0;\n      limbs[1] = (absnum / 0x100000000) | 0;\n      bitlen = 52;\n    } else if (absnum > 0) {\n      limbs = new Uint32Array(1);\n      limbs[0] = absnum;\n      bitlen = 32;\n    } else {\n      limbs = _BigNumber_ZERO_limbs;\n      bitlen = 0;\n    }\n    sign = num < 0 ? -1 : 1;\n\n    return BigNumber.fromConfig({ limbs, bitLength: bitlen, sign });\n  }\n\n  static fromArrayBuffer(buffer: ArrayBuffer): BigNumber {\n    return new BigNumber(new Uint8Array(buffer));\n  }\n\n  static fromConfig(obj: { limbs: Uint32Array; bitLength: number; sign: number }): BigNumber {\n    const bn = new BigNumber();\n    bn.limbs = new Uint32Array(obj.limbs);\n    bn.bitLength = obj.bitLength;\n    bn.sign = obj.sign;\n    return bn;\n  }\n\n  constructor(num?: Uint8Array) {\n    let limbs = _BigNumber_ZERO_limbs;\n    let bitlen = 0;\n    let sign = 0;\n\n    if (num === undefined) {\n      // do nothing\n    } else {\n      for (var i = 0; !num[i]; i++);\n\n      bitlen = (num.length - i) * 8;\n      if (!bitlen) return BigNumber.ZERO;\n\n      limbs = new Uint32Array((bitlen + 31) >> 5);\n      for (var j = num.length - 4; j >= i; j -= 4) {\n        limbs[(num.length - 4 - j) >> 2] = (num[j] << 24) | (num[j + 1] << 16) | (num[j + 2] << 8) | num[j + 3];\n      }\n      if (i - j === 3) {\n        limbs[limbs.length - 1] = num[i];\n      } else if (i - j === 2) {\n        limbs[limbs.length - 1] = (num[i] << 8) | num[i + 1];\n      } else if (i - j === 1) {\n        limbs[limbs.length - 1] = (num[i] << 16) | (num[i + 1] << 8) | num[i + 2];\n      }\n\n      sign = 1;\n    }\n\n    this.limbs = limbs;\n    this.bitLength = bitlen;\n    this.sign = sign;\n  }\n\n  toString(radix: number): string {\n    radix = radix || 16;\n\n    const limbs = this.limbs;\n    const bitlen = this.bitLength;\n    let str = '';\n\n    if (radix === 16) {\n      // FIXME clamp last limb to (bitlen % 32)\n      for (var i = ((bitlen + 31) >> 5) - 1; i >= 0; i--) {\n        var h = limbs[i].toString(16);\n        str += '00000000'.substr(h.length);\n        str += h;\n      }\n\n      str = str.replace(/^0+/, '');\n\n      if (!str.length) str = '0';\n    } else {\n      throw new IllegalArgumentError('bad radix');\n    }\n\n    if (this.sign < 0) str = '-' + str;\n\n    return str;\n  }\n\n  toBytes(): Uint8Array {\n    const bitlen = this.bitLength;\n    const limbs = this.limbs;\n\n    if (bitlen === 0) return new Uint8Array(0);\n\n    const bytelen = (bitlen + 7) >> 3;\n    const bytes = new Uint8Array(bytelen);\n    for (let i = 0; i < bytelen; i++) {\n      let j = bytelen - i - 1;\n      bytes[i] = limbs[j >> 2] >> ((j & 3) << 3);\n    }\n\n    return bytes;\n  }\n\n  /**\n   * Downgrade to Number\n   */\n  valueOf(): number {\n    const limbs = this.limbs;\n    const bits = this.bitLength;\n    const sign = this.sign;\n\n    if (!sign) return 0;\n\n    if (bits <= 32) return sign * (limbs[0] >>> 0);\n\n    if (bits <= 52) return sign * (0x100000000 * (limbs[1] >>> 0) + (limbs[0] >>> 0));\n\n    // normalization\n    let i,\n      l,\n      e = 0;\n    for (i = limbs.length - 1; i >= 0; i--) {\n      if ((l = limbs[i]) === 0) continue;\n      while (((l << e) & 0x80000000) === 0) e++;\n      break;\n    }\n\n    if (i === 0) return sign * (limbs[0] >>> 0);\n\n    return (\n      sign *\n      (0x100000 * (((limbs[i] << e) | (e ? limbs[i - 1] >>> (32 - e) : 0)) >>> 0) +\n        (((limbs[i - 1] << e) | (e && i > 1 ? limbs[i - 2] >>> (32 - e) : 0)) >>> 12)) *\n      Math.pow(2, 32 * i - e - 52)\n    );\n  }\n\n  clamp(b: number): BigNumber {\n    const limbs = this.limbs;\n    const bitlen = this.bitLength;\n\n    // FIXME check b is number and in a valid range\n\n    if (b >= bitlen) return this;\n\n    const clamped = new BigNumber();\n    let n = (b + 31) >> 5;\n    let k = b % 32;\n\n    clamped.limbs = new Uint32Array(limbs.subarray(0, n));\n    clamped.bitLength = b;\n    clamped.sign = this.sign;\n\n    if (k) clamped.limbs[n - 1] &= -1 >>> (32 - k);\n\n    return clamped;\n  }\n\n  slice(f: number, b?: number): BigNumber {\n    const limbs = this.limbs;\n    const bitlen = this.bitLength;\n\n    if (f < 0) throw new RangeError('TODO');\n\n    if (f >= bitlen) return BigNumber.ZERO;\n\n    if (b === undefined || b > bitlen - f) b = bitlen - f;\n\n    const sliced = new BigNumber();\n    let n = f >> 5;\n    let m = (f + b + 31) >> 5;\n    let l = (b + 31) >> 5;\n    let t = f % 32;\n    let k = b % 32;\n\n    const slimbs = new Uint32Array(l);\n    if (t) {\n      for (var i = 0; i < m - n - 1; i++) {\n        slimbs[i] = (limbs[n + i] >>> t) | (limbs[n + i + 1] << (32 - t));\n      }\n      slimbs[i] = limbs[n + i] >>> t;\n    } else {\n      slimbs.set(limbs.subarray(n, m));\n    }\n\n    if (k) {\n      slimbs[l - 1] &= -1 >>> (32 - k);\n    }\n\n    sliced.limbs = slimbs;\n    sliced.bitLength = b;\n    sliced.sign = this.sign;\n\n    return sliced;\n  }\n\n  negate(): BigNumber {\n    const negative = new BigNumber();\n\n    negative.limbs = this.limbs;\n    negative.bitLength = this.bitLength;\n    negative.sign = -1 * this.sign;\n\n    return negative;\n  }\n\n  compare(that: BigNumber): number {\n    var alimbs = this.limbs,\n      alimbcnt = alimbs.length,\n      blimbs = that.limbs,\n      blimbcnt = blimbs.length,\n      z = 0;\n\n    if (this.sign < that.sign) return -1;\n\n    if (this.sign > that.sign) return 1;\n\n    _bigint_heap.set(alimbs, 0);\n    _bigint_heap.set(blimbs, alimbcnt);\n    z = _bigint_asm.cmp(0, alimbcnt << 2, alimbcnt << 2, blimbcnt << 2);\n\n    return z * this.sign;\n  }\n\n  add(that: BigNumber): BigNumber {\n    if (!this.sign) return that;\n\n    if (!that.sign) return this;\n\n    var abitlen = this.bitLength,\n      alimbs = this.limbs,\n      alimbcnt = alimbs.length,\n      asign = this.sign,\n      bbitlen = that.bitLength,\n      blimbs = that.limbs,\n      blimbcnt = blimbs.length,\n      bsign = that.sign,\n      rbitlen,\n      rlimbcnt,\n      rsign,\n      rof,\n      result = new BigNumber();\n\n    rbitlen = (abitlen > bbitlen ? abitlen : bbitlen) + (asign * bsign > 0 ? 1 : 0);\n    rlimbcnt = (rbitlen + 31) >> 5;\n\n    _bigint_asm.sreset();\n\n    var pA = _bigint_asm.salloc(alimbcnt << 2),\n      pB = _bigint_asm.salloc(blimbcnt << 2),\n      pR = _bigint_asm.salloc(rlimbcnt << 2);\n\n    _bigint_asm.z(pR - pA + (rlimbcnt << 2), 0, pA);\n\n    _bigint_heap.set(alimbs, pA >> 2);\n    _bigint_heap.set(blimbs, pB >> 2);\n\n    if (asign * bsign > 0) {\n      _bigint_asm.add(pA, alimbcnt << 2, pB, blimbcnt << 2, pR, rlimbcnt << 2);\n      rsign = asign;\n    } else if (asign > bsign) {\n      rof = _bigint_asm.sub(pA, alimbcnt << 2, pB, blimbcnt << 2, pR, rlimbcnt << 2);\n      rsign = rof ? bsign : asign;\n    } else {\n      rof = _bigint_asm.sub(pB, blimbcnt << 2, pA, alimbcnt << 2, pR, rlimbcnt << 2);\n      rsign = rof ? asign : bsign;\n    }\n\n    if (rof) _bigint_asm.neg(pR, rlimbcnt << 2, pR, rlimbcnt << 2);\n\n    if (_bigint_asm.tst(pR, rlimbcnt << 2) === 0) return BigNumber.ZERO;\n\n    result.limbs = new Uint32Array(_bigint_heap.subarray(pR >> 2, (pR >> 2) + rlimbcnt));\n    result.bitLength = rbitlen;\n    result.sign = rsign;\n\n    return result;\n  }\n\n  subtract(that: BigNumber): BigNumber {\n    return this.add(that.negate());\n  }\n\n  square(): BigNumber {\n    if (!this.sign) return BigNumber.ZERO;\n\n    var abitlen = this.bitLength,\n      alimbs = this.limbs,\n      alimbcnt = alimbs.length,\n      rbitlen,\n      rlimbcnt,\n      result = new BigNumber();\n\n    rbitlen = abitlen << 1;\n    rlimbcnt = (rbitlen + 31) >> 5;\n\n    _bigint_asm.sreset();\n\n    var pA = _bigint_asm.salloc(alimbcnt << 2),\n      pR = _bigint_asm.salloc(rlimbcnt << 2);\n\n    _bigint_asm.z(pR - pA + (rlimbcnt << 2), 0, pA);\n\n    _bigint_heap.set(alimbs, pA >> 2);\n\n    _bigint_asm.sqr(pA, alimbcnt << 2, pR);\n\n    result.limbs = new Uint32Array(_bigint_heap.subarray(pR >> 2, (pR >> 2) + rlimbcnt));\n    result.bitLength = rbitlen;\n    result.sign = 1;\n\n    return result;\n  }\n\n  divide(that: BigNumber): { quotient: BigNumber; remainder: BigNumber } {\n    var abitlen = this.bitLength,\n      alimbs = this.limbs,\n      alimbcnt = alimbs.length,\n      bbitlen = that.bitLength,\n      blimbs = that.limbs,\n      blimbcnt = blimbs.length,\n      qlimbcnt,\n      rlimbcnt,\n      quotient = BigNumber.ZERO,\n      remainder = BigNumber.ZERO;\n\n    _bigint_asm.sreset();\n\n    var pA = _bigint_asm.salloc(alimbcnt << 2),\n      pB = _bigint_asm.salloc(blimbcnt << 2),\n      pQ = _bigint_asm.salloc(alimbcnt << 2);\n\n    _bigint_asm.z(pQ - pA + (alimbcnt << 2), 0, pA);\n\n    _bigint_heap.set(alimbs, pA >> 2);\n    _bigint_heap.set(blimbs, pB >> 2);\n\n    _bigint_asm.div(pA, alimbcnt << 2, pB, blimbcnt << 2, pQ);\n\n    qlimbcnt = _bigint_asm.tst(pQ, alimbcnt << 2) >> 2;\n    if (qlimbcnt) {\n      quotient = new BigNumber();\n      quotient.limbs = new Uint32Array(_bigint_heap.subarray(pQ >> 2, (pQ >> 2) + qlimbcnt));\n      quotient.bitLength = abitlen < qlimbcnt << 5 ? abitlen : qlimbcnt << 5;\n      quotient.sign = this.sign * that.sign;\n    }\n\n    rlimbcnt = _bigint_asm.tst(pA, blimbcnt << 2) >> 2;\n    if (rlimbcnt) {\n      remainder = new BigNumber();\n      remainder.limbs = new Uint32Array(_bigint_heap.subarray(pA >> 2, (pA >> 2) + rlimbcnt));\n      remainder.bitLength = bbitlen < rlimbcnt << 5 ? bbitlen : rlimbcnt << 5;\n      remainder.sign = this.sign;\n    }\n\n    return {\n      quotient: quotient,\n      remainder: remainder,\n    };\n  }\n\n  multiply(that: BigNumber): BigNumber {\n    if (!this.sign || !that.sign) return BigNumber.ZERO;\n\n    var abitlen = this.bitLength,\n      alimbs = this.limbs,\n      alimbcnt = alimbs.length,\n      bbitlen = that.bitLength,\n      blimbs = that.limbs,\n      blimbcnt = blimbs.length,\n      rbitlen,\n      rlimbcnt,\n      result = new BigNumber();\n\n    rbitlen = abitlen + bbitlen;\n    rlimbcnt = (rbitlen + 31) >> 5;\n\n    _bigint_asm.sreset();\n\n    var pA = _bigint_asm.salloc(alimbcnt << 2),\n      pB = _bigint_asm.salloc(blimbcnt << 2),\n      pR = _bigint_asm.salloc(rlimbcnt << 2);\n\n    _bigint_asm.z(pR - pA + (rlimbcnt << 2), 0, pA);\n\n    _bigint_heap.set(alimbs, pA >> 2);\n    _bigint_heap.set(blimbs, pB >> 2);\n\n    _bigint_asm.mul(pA, alimbcnt << 2, pB, blimbcnt << 2, pR, rlimbcnt << 2);\n\n    result.limbs = new Uint32Array(_bigint_heap.subarray(pR >> 2, (pR >> 2) + rlimbcnt));\n    result.sign = this.sign * that.sign;\n    result.bitLength = rbitlen;\n\n    return result;\n  }\n\n  public isMillerRabinProbablePrime(rounds: number): boolean {\n    var t = BigNumber.fromConfig(this),\n      s = 0;\n    t.limbs[0] -= 1;\n    while (t.limbs[s >> 5] === 0) s += 32;\n    while (((t.limbs[s >> 5] >> (s & 31)) & 1) === 0) s++;\n    t = t.slice(s);\n\n    var m = new Modulus(this),\n      m1 = this.subtract(BigNumber.ONE),\n      a = BigNumber.fromConfig(this),\n      l = this.limbs.length - 1;\n    while (a.limbs[l] === 0) l--;\n\n    while (--rounds >= 0) {\n      getRandomValues(a.limbs);\n      if (a.limbs[0] < 2) a.limbs[0] += 2;\n      while (a.compare(m1) >= 0) a.limbs[l] >>>= 1;\n\n      var x = m.power(a, t);\n      if (x.compare(BigNumber.ONE) === 0) continue;\n      if (x.compare(m1) === 0) continue;\n\n      var c = s;\n      while (--c > 0) {\n        x = x.square().divide(m).remainder;\n        if (x.compare(BigNumber.ONE) === 0) return false;\n        if (x.compare(m1) === 0) break;\n      }\n\n      if (c === 0) return false;\n    }\n\n    return true;\n  }\n\n  isProbablePrime(paranoia: number = 80): boolean {\n    var limbs = this.limbs;\n    var i = 0;\n\n    // Oddity test\n    // (50% false positive probability)\n    if ((limbs[0] & 1) === 0) return false;\n    if (paranoia <= 1) return true;\n\n    // Magic divisors (3, 5, 17) test\n    // (~25% false positive probability)\n    var s3 = 0,\n      s5 = 0,\n      s17 = 0;\n    for (i = 0; i < limbs.length; i++) {\n      var l3 = limbs[i];\n      while (l3) {\n        s3 += l3 & 3;\n        l3 >>>= 2;\n      }\n\n      var l5 = limbs[i];\n      while (l5) {\n        s5 += l5 & 3;\n        l5 >>>= 2;\n        s5 -= l5 & 3;\n        l5 >>>= 2;\n      }\n\n      var l17 = limbs[i];\n      while (l17) {\n        s17 += l17 & 15;\n        l17 >>>= 4;\n        s17 -= l17 & 15;\n        l17 >>>= 4;\n      }\n    }\n    if (!(s3 % 3) || !(s5 % 5) || !(s17 % 17)) return false;\n    if (paranoia <= 2) return true;\n\n    // Miller-Rabin test\n    // (≤ 4^(-k) false positive probability)\n    return this.isMillerRabinProbablePrime(paranoia >>> 1);\n  }\n}\n\nexport class Modulus extends BigNumber {\n  // @ts-ignore\n  private comodulus!: BigNumber;\n  private comodulusRemainder!: BigNumber;\n  private comodulusRemainderSquare!: BigNumber;\n  private coefficient!: number;\n\n  constructor(number: BigNumber) {\n    super();\n    this.limbs = number.limbs;\n    this.bitLength = number.bitLength;\n    this.sign = number.sign;\n\n    if (this.valueOf() < 1) throw new RangeError();\n\n    if (this.bitLength <= 32) return;\n\n    let comodulus: BigNumber;\n\n    if (this.limbs[0] & 1) {\n      const bitlen = ((this.bitLength + 31) & -32) + 1;\n      const limbs = new Uint32Array((bitlen + 31) >> 5);\n      limbs[limbs.length - 1] = 1;\n      comodulus = new BigNumber();\n      comodulus.sign = 1;\n      comodulus.bitLength = bitlen;\n      comodulus.limbs = limbs;\n\n      const k = Number_extGCD(0x100000000, this.limbs[0]).y;\n      this.coefficient = k < 0 ? -k : 0x100000000 - k;\n    } else {\n      /**\n       * TODO even modulus reduction\n       * Modulus represented as `N = 2^U * V`, where `V` is odd and thus `GCD(2^U, V) = 1`.\n       * Calculation `A = TR' mod V` is made as for odd modulo using Montgomery method.\n       * Calculation `B = TR' mod 2^U` is easy as modulus is a power of 2.\n       * Using Chinese Remainder Theorem and Garner's Algorithm restore `TR' mod N` from `A` and `B`.\n       */\n      return;\n    }\n\n    this.comodulus = comodulus;\n    this.comodulusRemainder = comodulus.divide(this).remainder;\n    this.comodulusRemainderSquare = comodulus.square().divide(this).remainder;\n  }\n\n  /**\n   * Modular reduction\n   */\n  reduce(a: BigNumber): BigNumber {\n    if (a.bitLength <= 32 && this.bitLength <= 32) return BigNumber.fromNumber(a.valueOf() % this.valueOf());\n\n    if (a.compare(this) < 0) return a;\n\n    return a.divide(this).remainder;\n  }\n\n  /**\n   * Modular inverse\n   */\n  inverse(a: BigNumber): BigNumber {\n    a = this.reduce(a);\n\n    const r = BigNumber_extGCD(this, a);\n    if (r.gcd.valueOf() !== 1) throw new Error('GCD is not 1');\n\n    if (r.y.sign < 0) return r.y.add(this).clamp(this.bitLength);\n\n    return r.y;\n  }\n\n  /**\n   * Modular exponentiation\n   */\n  power(g: BigNumber, e: BigNumber): BigNumber {\n    // count exponent set bits\n    let c = 0;\n    for (let i = 0; i < e.limbs.length; i++) {\n      let t = e.limbs[i];\n      while (t) {\n        if (t & 1) c++;\n        t >>>= 1;\n      }\n    }\n\n    // window size parameter\n    let k = 8;\n    if (e.bitLength <= 4536) k = 7;\n    if (e.bitLength <= 1736) k = 6;\n    if (e.bitLength <= 630) k = 5;\n    if (e.bitLength <= 210) k = 4;\n    if (e.bitLength <= 60) k = 3;\n    if (e.bitLength <= 12) k = 2;\n    if (c <= 1 << (k - 1)) k = 1;\n\n    // montgomerize base\n    g = Modulus._Montgomery_reduce(this.reduce(g).multiply(this.comodulusRemainderSquare), this);\n\n    // precompute odd powers\n    const g2 = Modulus._Montgomery_reduce(g.square(), this),\n      gn = new Array(1 << (k - 1));\n    gn[0] = g;\n    gn[1] = Modulus._Montgomery_reduce(g.multiply(g2), this);\n    for (let i = 2; i < 1 << (k - 1); i++) {\n      gn[i] = Modulus._Montgomery_reduce(gn[i - 1].multiply(g2), this);\n    }\n\n    // perform exponentiation\n    const u = this.comodulusRemainder;\n    let r = u;\n    for (let i = e.limbs.length - 1; i >= 0; i--) {\n      let t = e.limbs[i];\n      for (let j = 32; j > 0; ) {\n        if (t & 0x80000000) {\n          let n = t >>> (32 - k),\n            l = k;\n          while ((n & 1) === 0) {\n            n >>>= 1;\n            l--;\n          }\n          var m = gn[n >>> 1];\n          while (n) {\n            n >>>= 1;\n            if (r !== u) r = Modulus._Montgomery_reduce(r.square(), this);\n          }\n          r = r !== u ? Modulus._Montgomery_reduce(r.multiply(m), this) : m;\n          (t <<= l), (j -= l);\n        } else {\n          if (r !== u) r = Modulus._Montgomery_reduce(r.square(), this);\n          (t <<= 1), j--;\n        }\n      }\n    }\n\n    // de-montgomerize result\n    return Modulus._Montgomery_reduce(r, this);\n  }\n\n  static _Montgomery_reduce(a: BigNumber, n: Modulus): BigNumber {\n    const alimbs = a.limbs;\n    const alimbcnt = alimbs.length;\n    const nlimbs = n.limbs;\n    const nlimbcnt = nlimbs.length;\n    const y = n.coefficient;\n\n    _bigint_asm.sreset();\n\n    const pA = _bigint_asm.salloc(alimbcnt << 2),\n      pN = _bigint_asm.salloc(nlimbcnt << 2),\n      pR = _bigint_asm.salloc(nlimbcnt << 2);\n\n    _bigint_asm.z(pR - pA + (nlimbcnt << 2), 0, pA);\n\n    _bigint_heap.set(alimbs, pA >> 2);\n    _bigint_heap.set(nlimbs, pN >> 2);\n\n    _bigint_asm.mredc(pA, alimbcnt << 2, pN, nlimbcnt << 2, y, pR);\n\n    const result = new BigNumber();\n    result.limbs = new Uint32Array(_bigint_heap.subarray(pR >> 2, (pR >> 2) + nlimbcnt));\n    result.bitLength = n.bitLength;\n    result.sign = 1;\n\n    return result;\n  }\n}\n"
  },
  {
    "path": "src/bignum/extgcd.ts",
    "content": "import { BigNumber } from './bignum';\n\nexport function Number_extGCD(a: number, b: number): { gcd: number; x: number; y: number } {\n  var sa = a < 0 ? -1 : 1,\n    sb = b < 0 ? -1 : 1,\n    xi = 1,\n    xj = 0,\n    yi = 0,\n    yj = 1,\n    r,\n    q,\n    t,\n    a_cmp_b;\n\n  a *= sa;\n  b *= sb;\n\n  a_cmp_b = a < b;\n  if (a_cmp_b) {\n    t = a;\n    (a = b), (b = t);\n    t = sa;\n    sa = sb;\n    sb = t;\n  }\n\n  (q = Math.floor(a / b)), (r = a - q * b);\n  while (r) {\n    (t = xi - q * xj), (xi = xj), (xj = t);\n    (t = yi - q * yj), (yi = yj), (yj = t);\n    (a = b), (b = r);\n\n    (q = Math.floor(a / b)), (r = a - q * b);\n  }\n\n  xj *= sa;\n  yj *= sb;\n\n  if (a_cmp_b) {\n    t = xj;\n    (xj = yj), (yj = t);\n  }\n\n  return {\n    gcd: b,\n    x: xj,\n    y: yj,\n  };\n}\n\nexport function BigNumber_extGCD(a: BigNumber, b: BigNumber): { gcd: BigNumber; x: BigNumber; y: BigNumber } {\n  let sa = a.sign;\n  let sb = b.sign;\n\n  if (sa < 0) a = a.negate();\n\n  if (sb < 0) b = b.negate();\n\n  const a_cmp_b = a.compare(b);\n  if (a_cmp_b < 0) {\n    let t = a;\n    (a = b), (b = t);\n    let t2 = sa;\n    sa = sb;\n    sb = t2;\n  }\n\n  var xi = BigNumber.ONE,\n    xj = BigNumber.ZERO,\n    lx = b.bitLength,\n    yi = BigNumber.ZERO,\n    yj = BigNumber.ONE,\n    ly = a.bitLength,\n    z,\n    r,\n    q;\n\n  z = a.divide(b);\n  while ((r = z.remainder) !== BigNumber.ZERO) {\n    q = z.quotient;\n\n    (z = xi.subtract(q.multiply(xj).clamp(lx)).clamp(lx)), (xi = xj), (xj = z);\n    (z = yi.subtract(q.multiply(yj).clamp(ly)).clamp(ly)), (yi = yj), (yj = z);\n\n    (a = b), (b = r);\n\n    z = a.divide(b);\n  }\n\n  if (sa < 0) xj = xj.negate();\n\n  if (sb < 0) yj = yj.negate();\n\n  if (a_cmp_b < 0) {\n    let t = xj;\n    (xj = yj), (yj = t);\n  }\n\n  return {\n    gcd: b,\n    x: xj,\n    y: yj,\n  };\n}\n"
  },
  {
    "path": "src/entry-default.ts",
    "content": "export * from './other/exportedUtils';\n\nexport * from './other/errors';\nexport * from './aes/cbc';\nexport * from './aes/gcm';\nexport * from './hash/sha1/sha1';\nexport * from './hash/sha256/sha256';\nexport * from './hmac/hmac-sha1';\nexport * from './hmac/hmac-sha256';\nexport * from './pbkdf2/pbkdf2-hmac-sha1';\nexport * from './pbkdf2/pbkdf2-hmac-sha256';\nexport * from './bignum/bignum';\nexport * from './rsa/pkcs1';\n"
  },
  {
    "path": "src/entry-export_all.ts",
    "content": "export {\n  string_to_bytes,\n  hex_to_bytes,\n  base64_to_bytes,\n  bytes_to_string,\n  bytes_to_hex,\n  bytes_to_base64,\n} from './other/exportedUtils';\nexport { IllegalStateError, IllegalArgumentError, SecurityError } from './other/errors';\nexport { AES_CBC } from './aes/cbc';\nexport { AES_CCM } from './aes/ccm';\nexport { AES_CFB } from './aes/cfb';\nexport { AES_CMAC } from './aes/cmac';\nexport { AES_CTR } from './aes/ctr';\nexport { AES_ECB } from './aes/ecb';\nexport { AES_GCM } from './aes/gcm';\nexport { AES_OFB } from './aes/ofb';\nexport { BigNumber, Modulus } from './bignum/bignum';\nexport { Sha1 } from './hash/sha1/sha1';\nexport { Sha256 } from './hash/sha256/sha256';\nexport { Sha512 } from './hash/sha512/sha512';\nexport { HmacSha1 } from './hmac/hmac-sha1';\nexport { HmacSha256 } from './hmac/hmac-sha256';\nexport { HmacSha512 } from './hmac/hmac-sha512';\nexport { Pbkdf2HmacSha1 } from './pbkdf2/pbkdf2-hmac-sha1';\nexport { Pbkdf2HmacSha256 } from './pbkdf2/pbkdf2-hmac-sha256';\nexport { Pbkdf2HmacSha512 } from './pbkdf2/pbkdf2-hmac-sha512';\nexport { RSA_OAEP, RSA_PKCS1_v1_5, RSA_PSS } from './rsa/pkcs1';\nexport { RSA } from './rsa/rsa';\n"
  },
  {
    "path": "src/hash/hash.ts",
    "content": "import { _heap_write } from '../other/utils';\nimport { IllegalStateError } from '../other/errors';\nimport { sha1result } from './sha1/sha1.asm';\nimport { sha256result } from './sha256/sha256.asm';\nimport { sha512result } from './sha512/sha512.asm';\n\nexport abstract class Hash<T extends sha1result | sha256result | sha512result> {\n  public result!: Uint8Array | null;\n  public pos: number = 0;\n  public len: number = 0;\n  public asm!: T;\n  public heap!: Uint8Array;\n  public BLOCK_SIZE!: number;\n  public HASH_SIZE!: number;\n\n  reset() {\n    this.result = null;\n    this.pos = 0;\n    this.len = 0;\n\n    this.asm.reset();\n\n    return this;\n  }\n\n  process(data: Uint8Array) {\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    let asm = this.asm;\n    let heap = this.heap;\n    let hpos = this.pos;\n    let hlen = this.len;\n    let dpos = 0;\n    let dlen = data.length;\n    let wlen = 0;\n\n    while (dlen > 0) {\n      wlen = _heap_write(heap, hpos + hlen, data, dpos, dlen);\n      hlen += wlen;\n      dpos += wlen;\n      dlen -= wlen;\n\n      wlen = asm.process(hpos, hlen);\n\n      hpos += wlen;\n      hlen -= wlen;\n\n      if (!hlen) hpos = 0;\n    }\n\n    this.pos = hpos;\n    this.len = hlen;\n\n    return this;\n  }\n\n  finish() {\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    this.asm.finish(this.pos, this.len, 0);\n\n    this.result = new Uint8Array(this.HASH_SIZE);\n    this.result.set(this.heap.subarray(0, this.HASH_SIZE));\n\n    this.pos = 0;\n    this.len = 0;\n\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/hash/sha1/sha1.asm.d.ts",
    "content": "declare interface sha1result {\n  // SHA1\n  reset: () => void;\n  init: (h0: number, h1: number, h2: number, h3: number, h4: number, total0: number, total1: number) => void;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @returns hashed\n   */\n  process: (offset: number, length: number) => number;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @param output - multiple of 32\n   * @returns hashed\n   */\n  finish: (offset: number, length: number, output: number) => number;\n\n  // HMAC-SHA;\n  hmac_reset: () => void;\n  hmac_init: (\n    p0: number,\n    p1: number,\n    p2: number,\n    p3: number,\n    p4: number,\n    p5: number,\n    p6: number,\n    p7: number,\n    p8: number,\n    p9: number,\n    p10: number,\n    p11: number,\n    p12: number,\n    p13: number,\n    p14: number,\n    p15: number,\n  ) => void;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @param output - multiple of 32\n   * @returns hashed\n   */\n  hmac_finish: (offset: number, length: number, output: number) => number;\n\n  // ;\n  /**\n   * PBKDF2-HMAC-SHA\n   * @param offset - multiple of 64\n   * @param length\n   * @param block\n   * @param count\n   * @param output - multiple of 32\n   */\n  pbkdf2_generate_block: (offset: number, length: number, block: number, count: number, output: number) => 0 | -1;\n}\n\nexport function sha1_asm(stdlib: any, foreign: any, buffer: ArrayBuffer): sha1result;\n"
  },
  {
    "path": "src/hash/sha1/sha1.asm.js",
    "content": "export var sha1_asm = function ( stdlib, foreign, buffer ) {\n    \"use asm\";\n\n    // SHA256 state\n    var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0,\n        TOTAL0 = 0, TOTAL1 = 0;\n\n    // HMAC state\n    var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0,\n        O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0;\n\n    // I/O buffer\n    var HEAP = new stdlib.Uint8Array(buffer);\n\n    function _core ( w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 ) {\n        w0 = w0|0;\n        w1 = w1|0;\n        w2 = w2|0;\n        w3 = w3|0;\n        w4 = w4|0;\n        w5 = w5|0;\n        w6 = w6|0;\n        w7 = w7|0;\n        w8 = w8|0;\n        w9 = w9|0;\n        w10 = w10|0;\n        w11 = w11|0;\n        w12 = w12|0;\n        w13 = w13|0;\n        w14 = w14|0;\n        w15 = w15|0;\n\n        var a = 0, b = 0, c = 0, d = 0, e = 0, n = 0, t = 0,\n            w16 = 0, w17 = 0, w18 = 0, w19 = 0,\n            w20 = 0, w21 = 0, w22 = 0, w23 = 0, w24 = 0, w25 = 0, w26 = 0, w27 = 0, w28 = 0, w29 = 0,\n            w30 = 0, w31 = 0, w32 = 0, w33 = 0, w34 = 0, w35 = 0, w36 = 0, w37 = 0, w38 = 0, w39 = 0,\n            w40 = 0, w41 = 0, w42 = 0, w43 = 0, w44 = 0, w45 = 0, w46 = 0, w47 = 0, w48 = 0, w49 = 0,\n            w50 = 0, w51 = 0, w52 = 0, w53 = 0, w54 = 0, w55 = 0, w56 = 0, w57 = 0, w58 = 0, w59 = 0,\n            w60 = 0, w61 = 0, w62 = 0, w63 = 0, w64 = 0, w65 = 0, w66 = 0, w67 = 0, w68 = 0, w69 = 0,\n            w70 = 0, w71 = 0, w72 = 0, w73 = 0, w74 = 0, w75 = 0, w76 = 0, w77 = 0, w78 = 0, w79 = 0;\n\n        a = H0;\n        b = H1;\n        c = H2;\n        d = H3;\n        e = H4;\n\n        // 0\n        t = ( w0 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 1\n        t = ( w1 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 2\n        t = ( w2 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 3\n        t = ( w3 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 4\n        t = ( w4 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 5\n        t = ( w5 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 6\n        t = ( w6 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 7\n        t = ( w7 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 8\n        t = ( w8 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 9\n        t = ( w9 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 10\n        t = ( w10 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 11\n        t = ( w11 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 12\n        t = ( w12 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 13\n        t = ( w13 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 14\n        t = ( w14 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 15\n        t = ( w15 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 16\n        n = w13 ^ w8 ^ w2 ^ w0;\n        w16 = (n << 1) | (n >>> 31);\n        t = (w16 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 17\n        n = w14 ^ w9 ^ w3 ^ w1;\n        w17 = (n << 1) | (n >>> 31);\n        t = (w17 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 18\n        n = w15 ^ w10 ^ w4 ^ w2;\n        w18 = (n << 1) | (n >>> 31);\n        t = (w18 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 19\n        n = w16 ^ w11 ^ w5 ^ w3;\n        w19 = (n << 1) | (n >>> 31);\n        t = (w19 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (~b & d)) + 0x5a827999 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 20\n        n = w17 ^ w12 ^ w6 ^ w4;\n        w20 = (n << 1) | (n >>> 31);\n        t = (w20 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 21\n        n = w18 ^ w13 ^ w7 ^ w5;\n        w21 = (n << 1) | (n >>> 31);\n        t = (w21 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 22\n        n = w19 ^ w14 ^ w8 ^ w6;\n        w22 = (n << 1) | (n >>> 31);\n        t = (w22 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 23\n        n = w20 ^ w15 ^ w9 ^ w7;\n        w23 = (n << 1) | (n >>> 31);\n        t = (w23 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 24\n        n = w21 ^ w16 ^ w10 ^ w8;\n        w24 = (n << 1) | (n >>> 31);\n        t = (w24 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 25\n        n = w22 ^ w17 ^ w11 ^ w9;\n        w25 = (n << 1) | (n >>> 31);\n        t = (w25 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 26\n        n = w23 ^ w18 ^ w12 ^ w10;\n        w26 = (n << 1) | (n >>> 31);\n        t = (w26 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 27\n        n = w24 ^ w19 ^ w13 ^ w11;\n        w27 = (n << 1) | (n >>> 31);\n        t = (w27 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 28\n        n = w25 ^ w20 ^ w14 ^ w12;\n        w28 = (n << 1) | (n >>> 31);\n        t = (w28 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 29\n        n = w26 ^ w21 ^ w15 ^ w13;\n        w29 = (n << 1) | (n >>> 31);\n        t = (w29 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 30\n        n = w27 ^ w22 ^ w16 ^ w14;\n        w30 = (n << 1) | (n >>> 31);\n        t = (w30 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 31\n        n = w28 ^ w23 ^ w17 ^ w15;\n        w31 = (n << 1) | (n >>> 31);\n        t = (w31 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 32\n        n = w29 ^ w24 ^ w18 ^ w16;\n        w32 = (n << 1) | (n >>> 31);\n        t = (w32 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 33\n        n = w30 ^ w25 ^ w19 ^ w17;\n        w33 = (n << 1) | (n >>> 31);\n        t = (w33 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 34\n        n = w31 ^ w26 ^ w20 ^ w18;\n        w34 = (n << 1) | (n >>> 31);\n        t = (w34 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 35\n        n = w32 ^ w27 ^ w21 ^ w19;\n        w35 = (n << 1) | (n >>> 31);\n        t = (w35 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 36\n        n = w33 ^ w28 ^ w22 ^ w20;\n        w36 = (n << 1) | (n >>> 31);\n        t = (w36 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 37\n        n = w34 ^ w29 ^ w23 ^ w21;\n        w37 = (n << 1) | (n >>> 31);\n        t = (w37 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 38\n        n = w35 ^ w30 ^ w24 ^ w22;\n        w38 = (n << 1) | (n >>> 31);\n        t = (w38 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 39\n        n = w36 ^ w31 ^ w25 ^ w23;\n        w39 = (n << 1) | (n >>> 31);\n        t = (w39 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) + 0x6ed9eba1 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 40\n        n = w37 ^ w32 ^ w26 ^ w24;\n        w40 = (n << 1) | (n >>> 31);\n        t = (w40 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 41\n        n = w38 ^ w33 ^ w27 ^ w25;\n        w41 = (n << 1) | (n >>> 31);\n        t = (w41 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 42\n        n = w39 ^ w34 ^ w28 ^ w26;\n        w42 = (n << 1) | (n >>> 31);\n        t = (w42 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 43\n        n = w40 ^ w35 ^ w29 ^ w27;\n        w43 = (n << 1) | (n >>> 31);\n        t = (w43 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 44\n        n = w41 ^ w36 ^ w30 ^ w28;\n        w44 = (n << 1) | (n >>> 31);\n        t = (w44 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 45\n        n = w42 ^ w37 ^ w31 ^ w29;\n        w45 = (n << 1) | (n >>> 31);\n        t = (w45 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 46\n        n = w43 ^ w38 ^ w32 ^ w30;\n        w46 = (n << 1) | (n >>> 31);\n        t = (w46 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 47\n        n = w44 ^ w39 ^ w33 ^ w31;\n        w47 = (n << 1) | (n >>> 31);\n        t = (w47 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 48\n        n = w45 ^ w40 ^ w34 ^ w32;\n        w48 = (n << 1) | (n >>> 31);\n        t = (w48 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 49\n        n = w46 ^ w41 ^ w35 ^ w33;\n        w49 = (n << 1) | (n >>> 31);\n        t = (w49 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 50\n        n = w47 ^ w42 ^ w36 ^ w34;\n        w50 = (n << 1) | (n >>> 31);\n        t = (w50 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 51\n        n = w48 ^ w43 ^ w37 ^ w35;\n        w51 = (n << 1) | (n >>> 31);\n        t = (w51 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 52\n        n = w49 ^ w44 ^ w38 ^ w36;\n        w52 = (n << 1) | (n >>> 31);\n        t = (w52 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 53\n        n = w50 ^ w45 ^ w39 ^ w37;\n        w53 = (n << 1) | (n >>> 31);\n        t = (w53 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 54\n        n = w51 ^ w46 ^ w40 ^ w38;\n        w54 = (n << 1) | (n >>> 31);\n        t = (w54 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 55\n        n = w52 ^ w47 ^ w41 ^ w39;\n        w55 = (n << 1) | (n >>> 31);\n        t = (w55 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 56\n        n = w53 ^ w48 ^ w42 ^ w40;\n        w56 = (n << 1) | (n >>> 31);\n        t = (w56 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 57\n        n = w54 ^ w49 ^ w43 ^ w41;\n        w57 = (n << 1) | (n >>> 31);\n        t = (w57 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 58\n        n = w55 ^ w50 ^ w44 ^ w42;\n        w58 = (n << 1) | (n >>> 31);\n        t = (w58 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 59\n        n = w56 ^ w51 ^ w45 ^ w43;\n        w59 = (n << 1) | (n >>> 31);\n        t = (w59 + ((a << 5) | (a >>> 27)) + e + ((b & c) | (b & d) | (c & d)) - 0x70e44324 )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 60\n        n = w57 ^ w52 ^ w46 ^ w44;\n        w60 = (n << 1) | (n >>> 31);\n        t = (w60 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 61\n        n = w58 ^ w53 ^ w47 ^ w45;\n        w61 = (n << 1) | (n >>> 31);\n        t = (w61 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 62\n        n = w59 ^ w54 ^ w48 ^ w46;\n        w62 = (n << 1) | (n >>> 31);\n        t = (w62 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 63\n        n = w60 ^ w55 ^ w49 ^ w47;\n        w63 = (n << 1) | (n >>> 31);\n        t = (w63 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 64\n        n = w61 ^ w56 ^ w50 ^ w48;\n        w64 = (n << 1) | (n >>> 31);\n        t = (w64 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 65\n        n = w62 ^ w57 ^ w51 ^ w49;\n        w65 = (n << 1) | (n >>> 31);\n        t = (w65 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 66\n        n = w63 ^ w58 ^ w52 ^ w50;\n        w66 = (n << 1) | (n >>> 31);\n        t = (w66 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 67\n        n = w64 ^ w59 ^ w53 ^ w51;\n        w67 = (n << 1) | (n >>> 31);\n        t = (w67 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 68\n        n = w65 ^ w60 ^ w54 ^ w52;\n        w68 = (n << 1) | (n >>> 31);\n        t = (w68 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 69\n        n = w66 ^ w61 ^ w55 ^ w53;\n        w69 = (n << 1) | (n >>> 31);\n        t = (w69 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 70\n        n = w67 ^ w62 ^ w56 ^ w54;\n        w70 = (n << 1) | (n >>> 31);\n        t = (w70 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 71\n        n = w68 ^ w63 ^ w57 ^ w55;\n        w71 = (n << 1) | (n >>> 31);\n        t = (w71 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 72\n        n = w69 ^ w64 ^ w58 ^ w56;\n        w72 = (n << 1) | (n >>> 31);\n        t = (w72 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 73\n        n = w70 ^ w65 ^ w59 ^ w57;\n        w73 = (n << 1) | (n >>> 31);\n        t = (w73 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 74\n        n = w71 ^ w66 ^ w60 ^ w58;\n        w74 = (n << 1) | (n >>> 31);\n        t = (w74 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 75\n        n = w72 ^ w67 ^ w61 ^ w59;\n        w75 = (n << 1) | (n >>> 31);\n        t = (w75 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 76\n        n = w73 ^ w68 ^ w62 ^ w60;\n        w76 = (n << 1) | (n >>> 31);\n        t = (w76 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 77\n        n = w74 ^ w69 ^ w63 ^ w61;\n        w77 = (n << 1) | (n >>> 31);\n        t = (w77 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 78\n        n = w75 ^ w70 ^ w64 ^ w62;\n        w78 = (n << 1) | (n >>> 31);\n        t = (w78 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        // 79\n        n = w76 ^ w71 ^ w65 ^ w63;\n        w79 = (n << 1) | (n >>> 31);\n        t = (w79 + ((a << 5) | (a >>> 27)) + e + (b ^ c ^ d) - 0x359d3e2a )|0;\n        e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t;\n\n        H0 = ( H0 + a )|0;\n        H1 = ( H1 + b )|0;\n        H2 = ( H2 + c )|0;\n        H3 = ( H3 + d )|0;\n        H4 = ( H4 + e )|0;\n\n    }\n\n    function _core_heap ( offset ) {\n        offset = offset|0;\n\n        _core(\n            HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n            HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n            HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n            HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n            HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n            HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n            HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n            HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n            HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n            HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n            HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n            HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n            HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n            HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n            HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n            HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63]\n        );\n    }\n\n    // offset — multiple of 32\n    function _state_to_heap ( output ) {\n        output = output|0;\n\n        HEAP[output|0] = H0>>>24;\n        HEAP[output|1] = H0>>>16&255;\n        HEAP[output|2] = H0>>>8&255;\n        HEAP[output|3] = H0&255;\n        HEAP[output|4] = H1>>>24;\n        HEAP[output|5] = H1>>>16&255;\n        HEAP[output|6] = H1>>>8&255;\n        HEAP[output|7] = H1&255;\n        HEAP[output|8] = H2>>>24;\n        HEAP[output|9] = H2>>>16&255;\n        HEAP[output|10] = H2>>>8&255;\n        HEAP[output|11] = H2&255;\n        HEAP[output|12] = H3>>>24;\n        HEAP[output|13] = H3>>>16&255;\n        HEAP[output|14] = H3>>>8&255;\n        HEAP[output|15] = H3&255;\n        HEAP[output|16] = H4>>>24;\n        HEAP[output|17] = H4>>>16&255;\n        HEAP[output|18] = H4>>>8&255;\n        HEAP[output|19] = H4&255;\n    }\n\n    function reset () {\n        H0 = 0x67452301;\n        H1 = 0xefcdab89;\n        H2 = 0x98badcfe;\n        H3 = 0x10325476;\n        H4 = 0xc3d2e1f0;\n        TOTAL0 = TOTAL1 = 0;\n    }\n\n    function init ( h0, h1, h2, h3, h4, total0, total1 ) {\n        h0 = h0|0;\n        h1 = h1|0;\n        h2 = h2|0;\n        h3 = h3|0;\n        h4 = h4|0;\n        total0 = total0|0;\n        total1 = total1|0;\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n        TOTAL0 = total0;\n        TOTAL1 = total1;\n    }\n\n    // offset — multiple of 64\n    function process ( offset, length ) {\n        offset = offset|0;\n        length = length|0;\n\n        var hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        while ( (length|0) >= 64 ) {\n            _core_heap(offset);\n\n            offset = ( offset + 64 )|0;\n            length = ( length - 64 )|0;\n\n            hashed = ( hashed + 64 )|0;\n        }\n\n        TOTAL0 = ( TOTAL0 + hashed )|0;\n        if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        return hashed|0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var hashed = 0,\n            i = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        if ( (length|0) >= 64 ) {\n            hashed = process( offset, length )|0;\n            if ( (hashed|0) == -1 )\n                return -1;\n\n            offset = ( offset + hashed )|0;\n            length = ( length - hashed )|0;\n        }\n\n        hashed = ( hashed + length )|0;\n        TOTAL0 = ( TOTAL0 + length )|0;\n        if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = (TOTAL1 + 1)|0;\n\n        HEAP[offset|length] = 0x80;\n\n        if ( (length|0) >= 56 ) {\n            for ( i = (length+1)|0; (i|0) < 64; i = (i+1)|0 )\n                HEAP[offset|i] = 0x00;\n            _core_heap(offset);\n\n            length = 0;\n\n            HEAP[offset|0] = 0;\n        }\n\n        for ( i = (length+1)|0; (i|0) < 59; i = (i+1)|0 )\n            HEAP[offset|i] = 0;\n\n        HEAP[offset|56] = TOTAL1>>>21&255;\n        HEAP[offset|57] = TOTAL1>>>13&255;\n        HEAP[offset|58] = TOTAL1>>>5&255;\n        HEAP[offset|59] = TOTAL1<<3&255 | TOTAL0>>>29;\n        HEAP[offset|60] = TOTAL0>>>21&255;\n        HEAP[offset|61] = TOTAL0>>>13&255;\n        HEAP[offset|62] = TOTAL0>>>5&255;\n        HEAP[offset|63] = TOTAL0<<3&255;\n        _core_heap(offset);\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    function hmac_reset () {\n        H0 = I0;\n        H1 = I1;\n        H2 = I2;\n        H3 = I3;\n        H4 = I4;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function _hmac_opad () {\n        H0 = O0;\n        H1 = O1;\n        H2 = O2;\n        H3 = O3;\n        H4 = O4;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function hmac_init ( p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) {\n        p0 = p0|0;\n        p1 = p1|0;\n        p2 = p2|0;\n        p3 = p3|0;\n        p4 = p4|0;\n        p5 = p5|0;\n        p6 = p6|0;\n        p7 = p7|0;\n        p8 = p8|0;\n        p9 = p9|0;\n        p10 = p10|0;\n        p11 = p11|0;\n        p12 = p12|0;\n        p13 = p13|0;\n        p14 = p14|0;\n        p15 = p15|0;\n\n        // opad\n        reset();\n        _core(\n            p0 ^ 0x5c5c5c5c,\n            p1 ^ 0x5c5c5c5c,\n            p2 ^ 0x5c5c5c5c,\n            p3 ^ 0x5c5c5c5c,\n            p4 ^ 0x5c5c5c5c,\n            p5 ^ 0x5c5c5c5c,\n            p6 ^ 0x5c5c5c5c,\n            p7 ^ 0x5c5c5c5c,\n            p8 ^ 0x5c5c5c5c,\n            p9 ^ 0x5c5c5c5c,\n            p10 ^ 0x5c5c5c5c,\n            p11 ^ 0x5c5c5c5c,\n            p12 ^ 0x5c5c5c5c,\n            p13 ^ 0x5c5c5c5c,\n            p14 ^ 0x5c5c5c5c,\n            p15 ^ 0x5c5c5c5c\n        );\n        O0 = H0;\n        O1 = H1;\n        O2 = H2;\n        O3 = H3;\n        O4 = H4;\n\n        // ipad\n        reset();\n        _core(\n            p0 ^ 0x36363636,\n            p1 ^ 0x36363636,\n            p2 ^ 0x36363636,\n            p3 ^ 0x36363636,\n            p4 ^ 0x36363636,\n            p5 ^ 0x36363636,\n            p6 ^ 0x36363636,\n            p7 ^ 0x36363636,\n            p8 ^ 0x36363636,\n            p9 ^ 0x36363636,\n            p10 ^ 0x36363636,\n            p11 ^ 0x36363636,\n            p12 ^ 0x36363636,\n            p13 ^ 0x36363636,\n            p14 ^ 0x36363636,\n            p15 ^ 0x36363636\n        );\n        I0 = H0;\n        I1 = H1;\n        I2 = H2;\n        I3 = H3;\n        I4 = H4;\n\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function hmac_finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        hashed = finish( offset, length, -1 )|0;\n        t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n        _hmac_opad();\n        _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    // salt is assumed to be already processed\n    // offset — multiple of 64\n    // output — multiple of 32\n    function pbkdf2_generate_block ( offset, length, block, count, output ) {\n        offset = offset|0;\n        length = length|0;\n        block = block|0;\n        count = count|0;\n        output = output|0;\n\n        var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0,\n            t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        // pad block number into heap\n        // FIXME probable OOB write\n        HEAP[(offset+length)|0]   = block>>>24;\n        HEAP[(offset+length+1)|0] = block>>>16&255;\n        HEAP[(offset+length+2)|0] = block>>>8&255;\n        HEAP[(offset+length+3)|0] = block&255;\n\n        // finish first iteration\n        hmac_finish( offset, (length+4)|0, -1 )|0;\n        h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4;\n        count = (count-1)|0;\n\n        // perform the rest iterations\n        while ( (count|0) > 0 ) {\n            hmac_reset();\n            _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n            _hmac_opad();\n            _core( t0, t1, t2, t3, t4, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 672 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4;\n\n            h0 = h0 ^ H0;\n            h1 = h1 ^ H1;\n            h2 = h2 ^ H2;\n            h3 = h3 ^ H3;\n            h4 = h4 ^ H4;\n\n            count = (count-1)|0;\n        }\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return 0;\n    }\n\n    return {\n      // SHA1\n      reset: reset,\n      init: init,\n      process: process,\n      finish: finish,\n\n      // HMAC-SHA1\n      hmac_reset: hmac_reset,\n      hmac_init: hmac_init,\n      hmac_finish: hmac_finish,\n\n      // PBKDF2-HMAC-SHA1\n      pbkdf2_generate_block: pbkdf2_generate_block\n    }\n}\n"
  },
  {
    "path": "src/hash/sha1/sha1.ts",
    "content": "import { sha1_asm, sha1result } from './sha1.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\n\nexport const _sha1_block_size = 64;\nexport const _sha1_hash_size = 20;\n\nexport class Sha1 extends Hash<sha1result> {\n  static NAME = 'sha1';\n  public NAME = 'sha1';\n  public BLOCK_SIZE = _sha1_block_size;\n  public HASH_SIZE = _sha1_hash_size;\n\n  constructor() {\n    super();\n\n    this.heap = _heap_init();\n    this.asm = sha1_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n\n    this.reset();\n  }\n}\n"
  },
  {
    "path": "src/hash/sha256/sha256.asm.d.ts",
    "content": "declare interface sha256result {\n  // SHA1\n  reset: () => void;\n  init: (h0: number, h1: number, h2: number, h3: number, h4: number, total0: number, total1: number) => void;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @returns hashed\n   */\n  process: (offset: number, length: number) => number;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @param output - multiple of 32\n   * @returns hashed\n   */\n  finish: (offset: number, length: number, output: number) => number;\n\n  // HMAC-SHA;\n  hmac_reset: () => void;\n  hmac_init: (\n    p0: number,\n    p1: number,\n    p2: number,\n    p3: number,\n    p4: number,\n    p5: number,\n    p6: number,\n    p7: number,\n    p8: number,\n    p9: number,\n    p10: number,\n    p11: number,\n    p12: number,\n    p13: number,\n    p14: number,\n    p15: number,\n  ) => void;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @param output - multiple of 32\n   * @returns hashed\n   */\n  hmac_finish: (offset: number, length: number, output: number) => number;\n\n  // ;\n  /**\n   * PBKDF2-HMAC-SHA\n   * @param offset - multiple of 64\n   * @param length\n   * @param block\n   * @param count\n   * @param output - multiple of 32\n   */\n  pbkdf2_generate_block: (offset: number, length: number, block: number, count: number, output: number) => 0 | -1;\n}\n\nexport function sha256_asm(stdlib: any, foreign: any, buffer: ArrayBuffer): sha256result;\n"
  },
  {
    "path": "src/hash/sha256/sha256.asm.js",
    "content": "export var sha256_asm = function ( stdlib, foreign, buffer ) {\n    \"use asm\";\n\n    // SHA256 state\n    var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0,\n        TOTAL0 = 0, TOTAL1 = 0;\n\n    // HMAC state\n    var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0, I5 = 0, I6 = 0, I7 = 0,\n        O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0, O5 = 0, O6 = 0, O7 = 0;\n\n    // I/O buffer\n    var HEAP = new stdlib.Uint8Array(buffer);\n\n    function _core ( w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15 ) {\n        w0 = w0|0;\n        w1 = w1|0;\n        w2 = w2|0;\n        w3 = w3|0;\n        w4 = w4|0;\n        w5 = w5|0;\n        w6 = w6|0;\n        w7 = w7|0;\n        w8 = w8|0;\n        w9 = w9|0;\n        w10 = w10|0;\n        w11 = w11|0;\n        w12 = w12|0;\n        w13 = w13|0;\n        w14 = w14|0;\n        w15 = w15|0;\n\n        var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0;\n\n        a = H0;\n        b = H1;\n        c = H2;\n        d = H3;\n        e = H4;\n        f = H5;\n        g = H6;\n        h = H7;\n        \n        // 0\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x428a2f98 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 1\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x71374491 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 2\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0xb5c0fbcf )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 3\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0xe9b5dba5 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 4\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x3956c25b )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 5\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x59f111f1 )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 6\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x923f82a4 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 7\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0xab1c5ed5 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 8\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0xd807aa98 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 9\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x12835b01 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 10\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x243185be )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 11\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x550c7dc3 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 12\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x72be5d74 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 13\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x80deb1fe )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 14\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x9bdc06a7 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 15\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0xc19bf174 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 16\n        w0 = ( ( w1>>>7  ^ w1>>>18 ^ w1>>>3  ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0xe49b69c1 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 17\n        w1 = ( ( w2>>>7  ^ w2>>>18 ^ w2>>>3  ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0xefbe4786 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 18\n        w2 = ( ( w3>>>7  ^ w3>>>18 ^ w3>>>3  ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x0fc19dc6 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 19\n        w3 = ( ( w4>>>7  ^ w4>>>18 ^ w4>>>3  ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x240ca1cc )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 20\n        w4 = ( ( w5>>>7  ^ w5>>>18 ^ w5>>>3  ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x2de92c6f )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 21\n        w5 = ( ( w6>>>7  ^ w6>>>18 ^ w6>>>3  ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x4a7484aa )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 22\n        w6 = ( ( w7>>>7  ^ w7>>>18 ^ w7>>>3  ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x5cb0a9dc )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 23\n        w7 = ( ( w8>>>7  ^ w8>>>18 ^ w8>>>3  ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x76f988da )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 24\n        w8 = ( ( w9>>>7  ^ w9>>>18 ^ w9>>>3  ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x983e5152 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 25\n        w9 = ( ( w10>>>7  ^ w10>>>18 ^ w10>>>3  ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0xa831c66d )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 26\n        w10 = ( ( w11>>>7  ^ w11>>>18 ^ w11>>>3  ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0xb00327c8 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 27\n        w11 = ( ( w12>>>7  ^ w12>>>18 ^ w12>>>3  ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0xbf597fc7 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 28\n        w12 = ( ( w13>>>7  ^ w13>>>18 ^ w13>>>3  ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0xc6e00bf3 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 29\n        w13 = ( ( w14>>>7  ^ w14>>>18 ^ w14>>>3  ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0xd5a79147 )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 30\n        w14 = ( ( w15>>>7  ^ w15>>>18 ^ w15>>>3  ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x06ca6351 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 31\n        w15 = ( ( w0>>>7  ^ w0>>>18 ^ w0>>>3  ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x14292967 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 32\n        w0 = ( ( w1>>>7  ^ w1>>>18 ^ w1>>>3  ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x27b70a85 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 33\n        w1 = ( ( w2>>>7  ^ w2>>>18 ^ w2>>>3  ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x2e1b2138 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 34\n        w2 = ( ( w3>>>7  ^ w3>>>18 ^ w3>>>3  ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x4d2c6dfc )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 35\n        w3 = ( ( w4>>>7  ^ w4>>>18 ^ w4>>>3  ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x53380d13 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 36\n        w4 = ( ( w5>>>7  ^ w5>>>18 ^ w5>>>3  ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x650a7354 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 37\n        w5 = ( ( w6>>>7  ^ w6>>>18 ^ w6>>>3  ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x766a0abb )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 38\n        w6 = ( ( w7>>>7  ^ w7>>>18 ^ w7>>>3  ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x81c2c92e )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 39\n        w7 = ( ( w8>>>7  ^ w8>>>18 ^ w8>>>3  ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x92722c85 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 40\n        w8 = ( ( w9>>>7  ^ w9>>>18 ^ w9>>>3  ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0xa2bfe8a1 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 41\n        w9 = ( ( w10>>>7  ^ w10>>>18 ^ w10>>>3  ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0xa81a664b )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 42\n        w10 = ( ( w11>>>7  ^ w11>>>18 ^ w11>>>3  ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0xc24b8b70 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 43\n        w11 = ( ( w12>>>7  ^ w12>>>18 ^ w12>>>3  ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0xc76c51a3 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 44\n        w12 = ( ( w13>>>7  ^ w13>>>18 ^ w13>>>3  ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0xd192e819 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 45\n        w13 = ( ( w14>>>7  ^ w14>>>18 ^ w14>>>3  ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0xd6990624 )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 46\n        w14 = ( ( w15>>>7  ^ w15>>>18 ^ w15>>>3  ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0xf40e3585 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 47\n        w15 = ( ( w0>>>7  ^ w0>>>18 ^ w0>>>3  ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x106aa070 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 48\n        w0 = ( ( w1>>>7  ^ w1>>>18 ^ w1>>>3  ^ w1<<25 ^ w1<<14 ) + ( w14>>>17 ^ w14>>>19 ^ w14>>>10 ^ w14<<15 ^ w14<<13 ) + w0 + w9 )|0;\n        h = ( w0 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x19a4c116 )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 49\n        w1 = ( ( w2>>>7  ^ w2>>>18 ^ w2>>>3  ^ w2<<25 ^ w2<<14 ) + ( w15>>>17 ^ w15>>>19 ^ w15>>>10 ^ w15<<15 ^ w15<<13 ) + w1 + w10 )|0;\n        g = ( w1 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x1e376c08 )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 50\n        w2 = ( ( w3>>>7  ^ w3>>>18 ^ w3>>>3  ^ w3<<25 ^ w3<<14 ) + ( w0>>>17 ^ w0>>>19 ^ w0>>>10 ^ w0<<15 ^ w0<<13 ) + w2 + w11 )|0;\n        f = ( w2 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x2748774c )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 51\n        w3 = ( ( w4>>>7  ^ w4>>>18 ^ w4>>>3  ^ w4<<25 ^ w4<<14 ) + ( w1>>>17 ^ w1>>>19 ^ w1>>>10 ^ w1<<15 ^ w1<<13 ) + w3 + w12 )|0;\n        e = ( w3 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x34b0bcb5 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 52\n        w4 = ( ( w5>>>7  ^ w5>>>18 ^ w5>>>3  ^ w5<<25 ^ w5<<14 ) + ( w2>>>17 ^ w2>>>19 ^ w2>>>10 ^ w2<<15 ^ w2<<13 ) + w4 + w13 )|0;\n        d = ( w4 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x391c0cb3 )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 53\n        w5 = ( ( w6>>>7  ^ w6>>>18 ^ w6>>>3  ^ w6<<25 ^ w6<<14 ) + ( w3>>>17 ^ w3>>>19 ^ w3>>>10 ^ w3<<15 ^ w3<<13 ) + w5 + w14 )|0;\n        c = ( w5 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0x4ed8aa4a )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 54\n        w6 = ( ( w7>>>7  ^ w7>>>18 ^ w7>>>3  ^ w7<<25 ^ w7<<14 ) + ( w4>>>17 ^ w4>>>19 ^ w4>>>10 ^ w4<<15 ^ w4<<13 ) + w6 + w15 )|0;\n        b = ( w6 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0x5b9cca4f )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 55\n        w7 = ( ( w8>>>7  ^ w8>>>18 ^ w8>>>3  ^ w8<<25 ^ w8<<14 ) + ( w5>>>17 ^ w5>>>19 ^ w5>>>10 ^ w5<<15 ^ w5<<13 ) + w7 + w0 )|0;\n        a = ( w7 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0x682e6ff3 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        // 56\n        w8 = ( ( w9>>>7  ^ w9>>>18 ^ w9>>>3  ^ w9<<25 ^ w9<<14 ) + ( w6>>>17 ^ w6>>>19 ^ w6>>>10 ^ w6<<15 ^ w6<<13 ) + w8 + w1 )|0;\n        h = ( w8 + h + ( e>>>6 ^ e>>>11 ^ e>>>25 ^ e<<26 ^ e<<21 ^ e<<7 ) +  ( g ^ e & (f^g) ) + 0x748f82ee )|0;\n        d = ( d + h )|0;\n        h = ( h + ( (a & b) ^ ( c & (a ^ b) ) ) + ( a>>>2 ^ a>>>13 ^ a>>>22 ^ a<<30 ^ a<<19 ^ a<<10 ) )|0;\n\n        // 57\n        w9 = ( ( w10>>>7  ^ w10>>>18 ^ w10>>>3  ^ w10<<25 ^ w10<<14 ) + ( w7>>>17 ^ w7>>>19 ^ w7>>>10 ^ w7<<15 ^ w7<<13 ) + w9 + w2 )|0;\n        g = ( w9 + g + ( d>>>6 ^ d>>>11 ^ d>>>25 ^ d<<26 ^ d<<21 ^ d<<7 ) +  ( f ^ d & (e^f) ) + 0x78a5636f )|0;\n        c = ( c + g )|0;\n        g = ( g + ( (h & a) ^ ( b & (h ^ a) ) ) + ( h>>>2 ^ h>>>13 ^ h>>>22 ^ h<<30 ^ h<<19 ^ h<<10 ) )|0;\n\n        // 58\n        w10 = ( ( w11>>>7  ^ w11>>>18 ^ w11>>>3  ^ w11<<25 ^ w11<<14 ) + ( w8>>>17 ^ w8>>>19 ^ w8>>>10 ^ w8<<15 ^ w8<<13 ) + w10 + w3 )|0;\n        f = ( w10 + f + ( c>>>6 ^ c>>>11 ^ c>>>25 ^ c<<26 ^ c<<21 ^ c<<7 ) +  ( e ^ c & (d^e) ) + 0x84c87814 )|0;\n        b = ( b + f )|0;\n        f = ( f + ( (g & h) ^ ( a & (g ^ h) ) ) + ( g>>>2 ^ g>>>13 ^ g>>>22 ^ g<<30 ^ g<<19 ^ g<<10 ) )|0;\n\n        // 59\n        w11 = ( ( w12>>>7  ^ w12>>>18 ^ w12>>>3  ^ w12<<25 ^ w12<<14 ) + ( w9>>>17 ^ w9>>>19 ^ w9>>>10 ^ w9<<15 ^ w9<<13 ) + w11 + w4 )|0;\n        e = ( w11 + e + ( b>>>6 ^ b>>>11 ^ b>>>25 ^ b<<26 ^ b<<21 ^ b<<7 ) +  ( d ^ b & (c^d) ) + 0x8cc70208 )|0;\n        a = ( a + e )|0;\n        e = ( e + ( (f & g) ^ ( h & (f ^ g) ) ) + ( f>>>2 ^ f>>>13 ^ f>>>22 ^ f<<30 ^ f<<19 ^ f<<10 ) )|0;\n\n        // 60\n        w12 = ( ( w13>>>7  ^ w13>>>18 ^ w13>>>3  ^ w13<<25 ^ w13<<14 ) + ( w10>>>17 ^ w10>>>19 ^ w10>>>10 ^ w10<<15 ^ w10<<13 ) + w12 + w5 )|0;\n        d = ( w12 + d + ( a>>>6 ^ a>>>11 ^ a>>>25 ^ a<<26 ^ a<<21 ^ a<<7 ) +  ( c ^ a & (b^c) ) + 0x90befffa )|0;\n        h = ( h + d )|0;\n        d = ( d + ( (e & f) ^ ( g & (e ^ f) ) ) + ( e>>>2 ^ e>>>13 ^ e>>>22 ^ e<<30 ^ e<<19 ^ e<<10 ) )|0;\n\n        // 61\n        w13 = ( ( w14>>>7  ^ w14>>>18 ^ w14>>>3  ^ w14<<25 ^ w14<<14 ) + ( w11>>>17 ^ w11>>>19 ^ w11>>>10 ^ w11<<15 ^ w11<<13 ) + w13 + w6 )|0;\n        c = ( w13 + c + ( h>>>6 ^ h>>>11 ^ h>>>25 ^ h<<26 ^ h<<21 ^ h<<7 ) +  ( b ^ h & (a^b) ) + 0xa4506ceb )|0;\n        g = ( g + c )|0;\n        c = ( c + ( (d & e) ^ ( f & (d ^ e) ) ) + ( d>>>2 ^ d>>>13 ^ d>>>22 ^ d<<30 ^ d<<19 ^ d<<10 ) )|0;\n\n        // 62\n        w14 = ( ( w15>>>7  ^ w15>>>18 ^ w15>>>3  ^ w15<<25 ^ w15<<14 ) + ( w12>>>17 ^ w12>>>19 ^ w12>>>10 ^ w12<<15 ^ w12<<13 ) + w14 + w7 )|0;\n        b = ( w14 + b + ( g>>>6 ^ g>>>11 ^ g>>>25 ^ g<<26 ^ g<<21 ^ g<<7 ) +  ( a ^ g & (h^a) ) + 0xbef9a3f7 )|0;\n        f = ( f + b )|0;\n        b = ( b + ( (c & d) ^ ( e & (c ^ d) ) ) + ( c>>>2 ^ c>>>13 ^ c>>>22 ^ c<<30 ^ c<<19 ^ c<<10 ) )|0;\n\n        // 63\n        w15 = ( ( w0>>>7  ^ w0>>>18 ^ w0>>>3  ^ w0<<25 ^ w0<<14 ) + ( w13>>>17 ^ w13>>>19 ^ w13>>>10 ^ w13<<15 ^ w13<<13 ) + w15 + w8 )|0;\n        a = ( w15 + a + ( f>>>6 ^ f>>>11 ^ f>>>25 ^ f<<26 ^ f<<21 ^ f<<7 ) +  ( h ^ f & (g^h) ) + 0xc67178f2 )|0;\n        e = ( e + a )|0;\n        a = ( a + ( (b & c) ^ ( d & (b ^ c) ) ) + ( b>>>2 ^ b>>>13 ^ b>>>22 ^ b<<30 ^ b<<19 ^ b<<10 ) )|0;\n\n        H0 = ( H0 + a )|0;\n        H1 = ( H1 + b )|0;\n        H2 = ( H2 + c )|0;\n        H3 = ( H3 + d )|0;\n        H4 = ( H4 + e )|0;\n        H5 = ( H5 + f )|0;\n        H6 = ( H6 + g )|0;\n        H7 = ( H7 + h )|0;\n    }\n\n    function _core_heap ( offset ) {\n        offset = offset|0;\n\n        _core(\n            HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n            HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n            HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n            HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n            HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n            HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n            HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n            HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n            HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n            HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n            HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n            HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n            HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n            HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n            HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n            HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63]\n        );\n    }\n\n    // offset — multiple of 32\n    function _state_to_heap ( output ) {\n        output = output|0;\n\n        HEAP[output|0] = H0>>>24;\n        HEAP[output|1] = H0>>>16&255;\n        HEAP[output|2] = H0>>>8&255;\n        HEAP[output|3] = H0&255;\n        HEAP[output|4] = H1>>>24;\n        HEAP[output|5] = H1>>>16&255;\n        HEAP[output|6] = H1>>>8&255;\n        HEAP[output|7] = H1&255;\n        HEAP[output|8] = H2>>>24;\n        HEAP[output|9] = H2>>>16&255;\n        HEAP[output|10] = H2>>>8&255;\n        HEAP[output|11] = H2&255;\n        HEAP[output|12] = H3>>>24;\n        HEAP[output|13] = H3>>>16&255;\n        HEAP[output|14] = H3>>>8&255;\n        HEAP[output|15] = H3&255;\n        HEAP[output|16] = H4>>>24;\n        HEAP[output|17] = H4>>>16&255;\n        HEAP[output|18] = H4>>>8&255;\n        HEAP[output|19] = H4&255;\n        HEAP[output|20] = H5>>>24;\n        HEAP[output|21] = H5>>>16&255;\n        HEAP[output|22] = H5>>>8&255;\n        HEAP[output|23] = H5&255;\n        HEAP[output|24] = H6>>>24;\n        HEAP[output|25] = H6>>>16&255;\n        HEAP[output|26] = H6>>>8&255;\n        HEAP[output|27] = H6&255;\n        HEAP[output|28] = H7>>>24;\n        HEAP[output|29] = H7>>>16&255;\n        HEAP[output|30] = H7>>>8&255;\n        HEAP[output|31] = H7&255;\n    }\n\n    function reset () {\n        H0 = 0x6a09e667;\n        H1 = 0xbb67ae85;\n        H2 = 0x3c6ef372;\n        H3 = 0xa54ff53a;\n        H4 = 0x510e527f;\n        H5 = 0x9b05688c;\n        H6 = 0x1f83d9ab;\n        H7 = 0x5be0cd19;\n        TOTAL0 = TOTAL1 = 0;\n    }\n\n    function init ( h0, h1, h2, h3, h4, h5, h6, h7, total0, total1 ) {\n        h0 = h0|0;\n        h1 = h1|0;\n        h2 = h2|0;\n        h3 = h3|0;\n        h4 = h4|0;\n        h5 = h5|0;\n        h6 = h6|0;\n        h7 = h7|0;\n        total0 = total0|0;\n        total1 = total1|0;\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n        H5 = h5;\n        H6 = h6;\n        H7 = h7;\n        TOTAL0 = total0;\n        TOTAL1 = total1;\n    }\n\n    // offset — multiple of 64\n    function process ( offset, length ) {\n        offset = offset|0;\n        length = length|0;\n\n        var hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        while ( (length|0) >= 64 ) {\n            _core_heap(offset);\n\n            offset = ( offset + 64 )|0;\n            length = ( length - 64 )|0;\n\n            hashed = ( hashed + 64 )|0;\n        }\n\n        TOTAL0 = ( TOTAL0 + hashed )|0;\n        if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        return hashed|0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var hashed = 0,\n            i = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        if ( (length|0) >= 64 ) {\n            hashed = process( offset, length )|0;\n            if ( (hashed|0) == -1 )\n                return -1;\n\n            offset = ( offset + hashed )|0;\n            length = ( length - hashed )|0;\n        }\n\n        hashed = ( hashed + length )|0;\n        TOTAL0 = ( TOTAL0 + length )|0;\n        if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        HEAP[offset|length] = 0x80;\n\n        if ( (length|0) >= 56 ) {\n            for ( i = (length+1)|0; (i|0) < 64; i = (i+1)|0 )\n                HEAP[offset|i] = 0x00;\n\n            _core_heap(offset);\n\n            length = 0;\n\n            HEAP[offset|0] = 0;\n        }\n\n        for ( i = (length+1)|0; (i|0) < 59; i = (i+1)|0 )\n            HEAP[offset|i] = 0;\n\n        HEAP[offset|56] = TOTAL1>>>21&255;\n        HEAP[offset|57] = TOTAL1>>>13&255;\n        HEAP[offset|58] = TOTAL1>>>5&255;\n        HEAP[offset|59] = TOTAL1<<3&255 | TOTAL0>>>29;\n        HEAP[offset|60] = TOTAL0>>>21&255;\n        HEAP[offset|61] = TOTAL0>>>13&255;\n        HEAP[offset|62] = TOTAL0>>>5&255;\n        HEAP[offset|63] = TOTAL0<<3&255;\n        _core_heap(offset);\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    function hmac_reset () {\n        H0 = I0;\n        H1 = I1;\n        H2 = I2;\n        H3 = I3;\n        H4 = I4;\n        H5 = I5;\n        H6 = I6;\n        H7 = I7;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function _hmac_opad () {\n        H0 = O0;\n        H1 = O1;\n        H2 = O2;\n        H3 = O3;\n        H4 = O4;\n        H5 = O5;\n        H6 = O6;\n        H7 = O7;\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    function hmac_init ( p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15 ) {\n        p0 = p0|0;\n        p1 = p1|0;\n        p2 = p2|0;\n        p3 = p3|0;\n        p4 = p4|0;\n        p5 = p5|0;\n        p6 = p6|0;\n        p7 = p7|0;\n        p8 = p8|0;\n        p9 = p9|0;\n        p10 = p10|0;\n        p11 = p11|0;\n        p12 = p12|0;\n        p13 = p13|0;\n        p14 = p14|0;\n        p15 = p15|0;\n\n        // opad\n        reset();\n        _core(\n            p0 ^ 0x5c5c5c5c,\n            p1 ^ 0x5c5c5c5c,\n            p2 ^ 0x5c5c5c5c,\n            p3 ^ 0x5c5c5c5c,\n            p4 ^ 0x5c5c5c5c,\n            p5 ^ 0x5c5c5c5c,\n            p6 ^ 0x5c5c5c5c,\n            p7 ^ 0x5c5c5c5c,\n            p8 ^ 0x5c5c5c5c,\n            p9 ^ 0x5c5c5c5c,\n            p10 ^ 0x5c5c5c5c,\n            p11 ^ 0x5c5c5c5c,\n            p12 ^ 0x5c5c5c5c,\n            p13 ^ 0x5c5c5c5c,\n            p14 ^ 0x5c5c5c5c,\n            p15 ^ 0x5c5c5c5c\n        );\n        O0 = H0;\n        O1 = H1;\n        O2 = H2;\n        O3 = H3;\n        O4 = H4;\n        O5 = H5;\n        O6 = H6;\n        O7 = H7;\n\n        // ipad\n        reset();\n        _core(\n            p0 ^ 0x36363636,\n            p1 ^ 0x36363636,\n            p2 ^ 0x36363636,\n            p3 ^ 0x36363636,\n            p4 ^ 0x36363636,\n            p5 ^ 0x36363636,\n            p6 ^ 0x36363636,\n            p7 ^ 0x36363636,\n            p8 ^ 0x36363636,\n            p9 ^ 0x36363636,\n            p10 ^ 0x36363636,\n            p11 ^ 0x36363636,\n            p12 ^ 0x36363636,\n            p13 ^ 0x36363636,\n            p14 ^ 0x36363636,\n            p15 ^ 0x36363636\n        );\n        I0 = H0;\n        I1 = H1;\n        I2 = H2;\n        I3 = H3;\n        I4 = H4;\n        I5 = H5;\n        I6 = H6;\n        I7 = H7;\n\n        TOTAL0 = 64;\n        TOTAL1 = 0;\n    }\n\n    // offset — multiple of 64\n    // output — multiple of 32\n    function hmac_finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0,\n            hashed = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        hashed = finish( offset, length, -1 )|0;\n        t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n        _hmac_opad();\n        _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    // salt is assumed to be already processed\n    // offset — multiple of 64\n    // output — multiple of 32\n    function pbkdf2_generate_block ( offset, length, block, count, output ) {\n        offset = offset|0;\n        length = length|0;\n        block = block|0;\n        count = count|0;\n        output = output|0;\n\n        var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0, h7 = 0,\n            t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0;\n\n        if ( offset & 63 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 31 )\n                return -1;\n\n        // pad block number into heap\n        // FIXME probable OOB write\n        HEAP[(offset+length)|0]   = block>>>24;\n        HEAP[(offset+length+1)|0] = block>>>16&255;\n        HEAP[(offset+length+2)|0] = block>>>8&255;\n        HEAP[(offset+length+3)|0] = block&255;\n\n        // finish first iteration\n        hmac_finish( offset, (length+4)|0, -1 )|0;\n        h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5, h6 = t6 = H6, h7 = t7 = H7;\n        count = (count-1)|0;\n\n        // perform the rest iterations\n        while ( (count|0) > 0 ) {\n            hmac_reset();\n            _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n            _hmac_opad();\n            _core( t0, t1, t2, t3, t4, t5, t6, t7, 0x80000000, 0, 0, 0, 0, 0, 0, 768 );\n            t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;\n\n            h0 = h0 ^ H0;\n            h1 = h1 ^ H1;\n            h2 = h2 ^ H2;\n            h3 = h3 ^ H3;\n            h4 = h4 ^ H4;\n            h5 = h5 ^ H5;\n            h6 = h6 ^ H6;\n            h7 = h7 ^ H7;\n\n            count = (count-1)|0;\n        }\n\n        H0 = h0;\n        H1 = h1;\n        H2 = h2;\n        H3 = h3;\n        H4 = h4;\n        H5 = h5;\n        H6 = h6;\n        H7 = h7;\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return 0;\n    }\n\n    return {\n      // SHA256\n      reset: reset,\n      init: init,\n      process: process,\n      finish: finish,\n\n      // HMAC-SHA256\n      hmac_reset: hmac_reset,\n      hmac_init: hmac_init,\n      hmac_finish: hmac_finish,\n\n      // PBKDF2-HMAC-SHA256\n      pbkdf2_generate_block: pbkdf2_generate_block\n    }\n}\n"
  },
  {
    "path": "src/hash/sha256/sha256.ts",
    "content": "import { sha256_asm, sha256result } from './sha256.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\n\nexport const _sha256_block_size = 64;\nexport const _sha256_hash_size = 32;\n\nexport class Sha256 extends Hash<sha256result> {\n  static NAME = 'sha256';\n  public NAME = 'sha256';\n  public BLOCK_SIZE = _sha256_block_size;\n  public HASH_SIZE = _sha256_hash_size;\n\n  constructor() {\n    super();\n\n    this.heap = _heap_init();\n    this.asm = sha256_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n\n    this.reset();\n  }\n}\n"
  },
  {
    "path": "src/hash/sha512/sha512.asm.d.ts",
    "content": "declare interface sha512result {\n  // SHA1\n  reset: () => void;\n  init: (h0: number, h1: number, h2: number, h3: number, h4: number, total0: number, total1: number) => void;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @returns hashed\n   */\n  process: (offset: number, length: number) => number;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @param output - multiple of 32\n   * @returns hashed\n   */\n  finish: (offset: number, length: number, output: number) => number;\n\n  // HMAC-SHA;\n  hmac_reset: () => void;\n  hmac_init: (\n    p0h: number,\n    p0l: number,\n    p1h: number,\n    p1l: number,\n    p2h: number,\n    p2l: number,\n    p3h: number,\n    p3l: number,\n    p4h: number,\n    p4l: number,\n    p5h: number,\n    p5l: number,\n    p6h: number,\n    p6l: number,\n    p7h: number,\n    p7l: number,\n    p8h: number,\n    p8l: number,\n    p9h: number,\n    p9l: number,\n    p10h: number,\n    p10l: number,\n    p11h: number,\n    p11l: number,\n    p12h: number,\n    p12l: number,\n    p13h: number,\n    p13l: number,\n    p14h: number,\n    p14l: number,\n    p15h: number,\n    p15l: number,\n  ) => void;\n\n  /**\n   * @param offset - multiple of 64\n   * @param length\n   * @param output - multiple of 32\n   * @returns hashed\n   */\n  hmac_finish: (offset: number, length: number, output: number) => number;\n\n  // ;\n  /**\n   * PBKDF2-HMAC-SHA\n   * @param offset - multiple of 64\n   * @param length\n   * @param block\n   * @param count\n   * @param output - multiple of 32\n   */\n  pbkdf2_generate_block: (offset: number, length: number, block: number, count: number, output: number) => 0 | -1;\n}\n\nexport function sha512_asm(stdlib: any, foreign: any, buffer: ArrayBuffer): sha512result;\n"
  },
  {
    "path": "src/hash/sha512/sha512.asm.js",
    "content": "export var sha512_asm = function ( stdlib, foreign, buffer ) {\n    \"use asm\";\n\n    // SHA512 state\n    var H0h = 0, H0l = 0, H1h = 0, H1l = 0, H2h = 0, H2l = 0, H3h = 0, H3l = 0,\n        H4h = 0, H4l = 0, H5h = 0, H5l = 0, H6h = 0, H6l = 0, H7h = 0, H7l = 0,\n        TOTAL0 = 0, TOTAL1 = 0;\n\n    // HMAC state\n    var I0h = 0, I0l = 0, I1h = 0, I1l = 0, I2h = 0, I2l = 0, I3h = 0, I3l = 0,\n        I4h = 0, I4l = 0, I5h = 0, I5l = 0, I6h = 0, I6l = 0, I7h = 0, I7l = 0,\n        O0h = 0, O0l = 0, O1h = 0, O1l = 0, O2h = 0, O2l = 0, O3h = 0, O3l = 0,\n        O4h = 0, O4l = 0, O5h = 0, O5l = 0, O6h = 0, O6l = 0, O7h = 0, O7l = 0;\n\n    // I/O buffer\n    var HEAP = new stdlib.Uint8Array(buffer);\n\n    function _core ( w0h, w0l, w1h, w1l, w2h, w2l, w3h, w3l, w4h, w4l, w5h, w5l, w6h, w6l, w7h, w7l, w8h, w8l, w9h, w9l, w10h, w10l, w11h, w11l, w12h, w12l, w13h, w13l, w14h, w14l, w15h, w15l ) {\n        w0h = w0h|0;\n        w0l = w0l|0;\n        w1h = w1h|0;\n        w1l = w1l|0;\n        w2h = w2h|0;\n        w2l = w2l|0;\n        w3h = w3h|0;\n        w3l = w3l|0;\n        w4h = w4h|0;\n        w4l = w4l|0;\n        w5h = w5h|0;\n        w5l = w5l|0;\n        w6h = w6h|0;\n        w6l = w6l|0;\n        w7h = w7h|0;\n        w7l = w7l|0;\n        w8h = w8h|0;\n        w8l = w8l|0;\n        w9h = w9h|0;\n        w9l = w9l|0;\n        w10h = w10h|0;\n        w10l = w10l|0;\n        w11h = w11h|0;\n        w11l = w11l|0;\n        w12h = w12h|0;\n        w12l = w12l|0;\n        w13h = w13h|0;\n        w13l = w13l|0;\n        w14h = w14h|0;\n        w14l = w14l|0;\n        w15h = w15h|0;\n        w15l = w15l|0;\n\n        var ah = 0, al = 0, bh = 0, bl = 0, ch = 0, cl = 0, dh = 0, dl = 0, eh = 0, el = 0, fh = 0, fl = 0, gh = 0, gl = 0, hh = 0, hl = 0,\n            th = 0, tl = 0, xl = 0;\n\n        ah = H0h;\n        al = H0l;\n        bh = H1h;\n        bl = H1l;\n        ch = H2h;\n        cl = H2l;\n        dh = H3h;\n        dl = H3l;\n        eh = H4h;\n        el = H4l;\n        fh = H5h;\n        fl = H5l;\n        gh = H6h;\n        gl = H6l;\n        hh = H7h;\n        hl = H7l;\n\n        // 0\n        tl = ( 0xd728ae22 + w0l )|0;\n        th = ( 0x428a2f98 + w0h + ((tl >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 1\n        tl = ( 0x23ef65cd + w1l )|0;\n        th = ( 0x71374491 + w1h + ((tl >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 2\n        tl = ( 0xec4d3b2f + w2l )|0;\n        th = ( 0xb5c0fbcf + w2h + ((tl >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 3\n        tl = ( 0x8189dbbc + w3l )|0;\n        th = ( 0xe9b5dba5 + w3h + ((tl >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 4\n        tl = ( 0xf348b538 + w4l )|0;\n        th = ( 0x3956c25b + w4h + ((tl >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 5\n        tl = ( 0xb605d019 + w5l )|0;\n        th = ( 0x59f111f1 + w5h + ((tl >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 6\n        tl = ( 0xaf194f9b + w6l )|0;\n        th = ( 0x923f82a4 + w6h + ((tl >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 7\n        tl = ( 0xda6d8118 + w7l )|0;\n        th = ( 0xab1c5ed5 + w7h + ((tl >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 8\n        tl = ( 0xa3030242 + w8l )|0;\n        th = ( 0xd807aa98 + w8h + ((tl >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 9\n        tl = ( 0x45706fbe + w9l )|0;\n        th = ( 0x12835b01 + w9h + ((tl >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 10\n        tl = ( 0x4ee4b28c + w10l )|0;\n        th = ( 0x243185be + w10h + ((tl >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 11\n        tl = ( 0xd5ffb4e2 + w11l )|0;\n        th = ( 0x550c7dc3 + w11h + ((tl >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 12\n        tl = ( 0xf27b896f + w12l )|0;\n        th = ( 0x72be5d74 + w12h + ((tl >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 13\n        tl = ( 0x3b1696b1 + w13l )|0;\n        th = ( 0x80deb1fe + w13h + ((tl >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 14\n        tl = ( 0x25c71235 + w14l )|0;\n        th = ( 0x9bdc06a7 + w14h + ((tl >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 15\n        tl = ( 0xcf692694 + w15l )|0;\n        th = ( 0xc19bf174 + w15h + ((tl >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 16\n        w0l = ( w0l + w9l )|0;\n        w0h = ( w0h + w9h + ((w0l >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 1) | (w1h << 31)) ^ ((w1l >>> 8) | (w1h << 24)) ^ ((w1l >>> 7) | (w1h << 25)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w1h >>> 1) | (w1l << 31)) ^ ((w1h >>> 8) | (w1l << 24)) ^ (w1h >>> 7) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 19) | (w14h << 13)) ^ ((w14l << 3) | (w14h >>> 29)) ^ ((w14l >>> 6) | (w14h << 26)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w14h >>> 19) | (w14l << 13)) ^ ((w14h << 3) | (w14l >>> 29)) ^ (w14h >>> 6) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x9ef14ad2 + w0l )|0;\n        th = ( 0xe49b69c1 + w0h + ((tl >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 17\n        w1l = ( w1l + w10l )|0;\n        w1h = ( w1h + w10h + ((w1l >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 1) | (w2h << 31)) ^ ((w2l >>> 8) | (w2h << 24)) ^ ((w2l >>> 7) | (w2h << 25)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w2h >>> 1) | (w2l << 31)) ^ ((w2h >>> 8) | (w2l << 24)) ^ (w2h >>> 7) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 19) | (w15h << 13)) ^ ((w15l << 3) | (w15h >>> 29)) ^ ((w15l >>> 6) | (w15h << 26)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w15h >>> 19) | (w15l << 13)) ^ ((w15h << 3) | (w15l >>> 29)) ^ (w15h >>> 6) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x384f25e3 + w1l )|0;\n        th = ( 0xefbe4786 + w1h + ((tl >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 18\n        w2l = ( w2l + w11l )|0;\n        w2h = ( w2h + w11h + ((w2l >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 1) | (w3h << 31)) ^ ((w3l >>> 8) | (w3h << 24)) ^ ((w3l >>> 7) | (w3h << 25)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w3h >>> 1) | (w3l << 31)) ^ ((w3h >>> 8) | (w3l << 24)) ^ (w3h >>> 7) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 19) | (w0h << 13)) ^ ((w0l << 3) | (w0h >>> 29)) ^ ((w0l >>> 6) | (w0h << 26)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w0h >>> 19) | (w0l << 13)) ^ ((w0h << 3) | (w0l >>> 29)) ^ (w0h >>> 6) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x8b8cd5b5 + w2l )|0;\n        th = ( 0xfc19dc6 + w2h + ((tl >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 19\n        w3l = ( w3l + w12l )|0;\n        w3h = ( w3h + w12h + ((w3l >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 1) | (w4h << 31)) ^ ((w4l >>> 8) | (w4h << 24)) ^ ((w4l >>> 7) | (w4h << 25)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w4h >>> 1) | (w4l << 31)) ^ ((w4h >>> 8) | (w4l << 24)) ^ (w4h >>> 7) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 19) | (w1h << 13)) ^ ((w1l << 3) | (w1h >>> 29)) ^ ((w1l >>> 6) | (w1h << 26)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w1h >>> 19) | (w1l << 13)) ^ ((w1h << 3) | (w1l >>> 29)) ^ (w1h >>> 6) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x77ac9c65 + w3l )|0;\n        th = ( 0x240ca1cc + w3h + ((tl >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 20\n        w4l = ( w4l + w13l )|0;\n        w4h = ( w4h + w13h + ((w4l >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 1) | (w5h << 31)) ^ ((w5l >>> 8) | (w5h << 24)) ^ ((w5l >>> 7) | (w5h << 25)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w5h >>> 1) | (w5l << 31)) ^ ((w5h >>> 8) | (w5l << 24)) ^ (w5h >>> 7) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 19) | (w2h << 13)) ^ ((w2l << 3) | (w2h >>> 29)) ^ ((w2l >>> 6) | (w2h << 26)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w2h >>> 19) | (w2l << 13)) ^ ((w2h << 3) | (w2l >>> 29)) ^ (w2h >>> 6) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x592b0275 + w4l )|0;\n        th = ( 0x2de92c6f + w4h + ((tl >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 21\n        w5l = ( w5l + w14l )|0;\n        w5h = ( w5h + w14h + ((w5l >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 1) | (w6h << 31)) ^ ((w6l >>> 8) | (w6h << 24)) ^ ((w6l >>> 7) | (w6h << 25)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w6h >>> 1) | (w6l << 31)) ^ ((w6h >>> 8) | (w6l << 24)) ^ (w6h >>> 7) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 19) | (w3h << 13)) ^ ((w3l << 3) | (w3h >>> 29)) ^ ((w3l >>> 6) | (w3h << 26)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w3h >>> 19) | (w3l << 13)) ^ ((w3h << 3) | (w3l >>> 29)) ^ (w3h >>> 6) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x6ea6e483 + w5l )|0;\n        th = ( 0x4a7484aa + w5h + ((tl >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 22\n        w6l = ( w6l + w15l )|0;\n        w6h = ( w6h + w15h + ((w6l >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 1) | (w7h << 31)) ^ ((w7l >>> 8) | (w7h << 24)) ^ ((w7l >>> 7) | (w7h << 25)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w7h >>> 1) | (w7l << 31)) ^ ((w7h >>> 8) | (w7l << 24)) ^ (w7h >>> 7) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 19) | (w4h << 13)) ^ ((w4l << 3) | (w4h >>> 29)) ^ ((w4l >>> 6) | (w4h << 26)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w4h >>> 19) | (w4l << 13)) ^ ((w4h << 3) | (w4l >>> 29)) ^ (w4h >>> 6) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xbd41fbd4 + w6l )|0;\n        th = ( 0x5cb0a9dc + w6h + ((tl >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 23\n        w7l = ( w7l + w0l )|0;\n        w7h = ( w7h + w0h + ((w7l >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 1) | (w8h << 31)) ^ ((w8l >>> 8) | (w8h << 24)) ^ ((w8l >>> 7) | (w8h << 25)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w8h >>> 1) | (w8l << 31)) ^ ((w8h >>> 8) | (w8l << 24)) ^ (w8h >>> 7) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 19) | (w5h << 13)) ^ ((w5l << 3) | (w5h >>> 29)) ^ ((w5l >>> 6) | (w5h << 26)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w5h >>> 19) | (w5l << 13)) ^ ((w5h << 3) | (w5l >>> 29)) ^ (w5h >>> 6) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x831153b5 + w7l )|0;\n        th = ( 0x76f988da + w7h + ((tl >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 24\n        w8l = ( w8l + w1l )|0;\n        w8h = ( w8h + w1h + ((w8l >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 1) | (w9h << 31)) ^ ((w9l >>> 8) | (w9h << 24)) ^ ((w9l >>> 7) | (w9h << 25)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w9h >>> 1) | (w9l << 31)) ^ ((w9h >>> 8) | (w9l << 24)) ^ (w9h >>> 7) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 19) | (w6h << 13)) ^ ((w6l << 3) | (w6h >>> 29)) ^ ((w6l >>> 6) | (w6h << 26)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w6h >>> 19) | (w6l << 13)) ^ ((w6h << 3) | (w6l >>> 29)) ^ (w6h >>> 6) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xee66dfab + w8l )|0;\n        th = ( 0x983e5152 + w8h + ((tl >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 25\n        w9l = ( w9l + w2l )|0;\n        w9h = ( w9h + w2h + ((w9l >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 1) | (w10h << 31)) ^ ((w10l >>> 8) | (w10h << 24)) ^ ((w10l >>> 7) | (w10h << 25)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w10h >>> 1) | (w10l << 31)) ^ ((w10h >>> 8) | (w10l << 24)) ^ (w10h >>> 7) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 19) | (w7h << 13)) ^ ((w7l << 3) | (w7h >>> 29)) ^ ((w7l >>> 6) | (w7h << 26)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w7h >>> 19) | (w7l << 13)) ^ ((w7h << 3) | (w7l >>> 29)) ^ (w7h >>> 6) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x2db43210 + w9l )|0;\n        th = ( 0xa831c66d + w9h + ((tl >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 26\n        w10l = ( w10l + w3l )|0;\n        w10h = ( w10h + w3h + ((w10l >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 1) | (w11h << 31)) ^ ((w11l >>> 8) | (w11h << 24)) ^ ((w11l >>> 7) | (w11h << 25)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w11h >>> 1) | (w11l << 31)) ^ ((w11h >>> 8) | (w11l << 24)) ^ (w11h >>> 7) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 19) | (w8h << 13)) ^ ((w8l << 3) | (w8h >>> 29)) ^ ((w8l >>> 6) | (w8h << 26)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w8h >>> 19) | (w8l << 13)) ^ ((w8h << 3) | (w8l >>> 29)) ^ (w8h >>> 6) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x98fb213f + w10l )|0;\n        th = ( 0xb00327c8 + w10h + ((tl >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 27\n        w11l = ( w11l + w4l )|0;\n        w11h = ( w11h + w4h + ((w11l >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 1) | (w12h << 31)) ^ ((w12l >>> 8) | (w12h << 24)) ^ ((w12l >>> 7) | (w12h << 25)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w12h >>> 1) | (w12l << 31)) ^ ((w12h >>> 8) | (w12l << 24)) ^ (w12h >>> 7) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 19) | (w9h << 13)) ^ ((w9l << 3) | (w9h >>> 29)) ^ ((w9l >>> 6) | (w9h << 26)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w9h >>> 19) | (w9l << 13)) ^ ((w9h << 3) | (w9l >>> 29)) ^ (w9h >>> 6) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xbeef0ee4 + w11l )|0;\n        th = ( 0xbf597fc7 + w11h + ((tl >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 28\n        w12l = ( w12l + w5l )|0;\n        w12h = ( w12h + w5h + ((w12l >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 1) | (w13h << 31)) ^ ((w13l >>> 8) | (w13h << 24)) ^ ((w13l >>> 7) | (w13h << 25)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w13h >>> 1) | (w13l << 31)) ^ ((w13h >>> 8) | (w13l << 24)) ^ (w13h >>> 7) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 19) | (w10h << 13)) ^ ((w10l << 3) | (w10h >>> 29)) ^ ((w10l >>> 6) | (w10h << 26)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w10h >>> 19) | (w10l << 13)) ^ ((w10h << 3) | (w10l >>> 29)) ^ (w10h >>> 6) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x3da88fc2 + w12l )|0;\n        th = ( 0xc6e00bf3 + w12h + ((tl >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 29\n        w13l = ( w13l + w6l )|0;\n        w13h = ( w13h + w6h + ((w13l >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 1) | (w14h << 31)) ^ ((w14l >>> 8) | (w14h << 24)) ^ ((w14l >>> 7) | (w14h << 25)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w14h >>> 1) | (w14l << 31)) ^ ((w14h >>> 8) | (w14l << 24)) ^ (w14h >>> 7) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 19) | (w11h << 13)) ^ ((w11l << 3) | (w11h >>> 29)) ^ ((w11l >>> 6) | (w11h << 26)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w11h >>> 19) | (w11l << 13)) ^ ((w11h << 3) | (w11l >>> 29)) ^ (w11h >>> 6) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x930aa725 + w13l )|0;\n        th = ( 0xd5a79147 + w13h + ((tl >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 30\n        w14l = ( w14l + w7l )|0;\n        w14h = ( w14h + w7h + ((w14l >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 1) | (w15h << 31)) ^ ((w15l >>> 8) | (w15h << 24)) ^ ((w15l >>> 7) | (w15h << 25)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w15h >>> 1) | (w15l << 31)) ^ ((w15h >>> 8) | (w15l << 24)) ^ (w15h >>> 7) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 19) | (w12h << 13)) ^ ((w12l << 3) | (w12h >>> 29)) ^ ((w12l >>> 6) | (w12h << 26)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w12h >>> 19) | (w12l << 13)) ^ ((w12h << 3) | (w12l >>> 29)) ^ (w12h >>> 6) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xe003826f + w14l )|0;\n        th = ( 0x6ca6351 + w14h + ((tl >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 31\n        w15l = ( w15l + w8l )|0;\n        w15h = ( w15h + w8h + ((w15l >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 1) | (w0h << 31)) ^ ((w0l >>> 8) | (w0h << 24)) ^ ((w0l >>> 7) | (w0h << 25)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w0h >>> 1) | (w0l << 31)) ^ ((w0h >>> 8) | (w0l << 24)) ^ (w0h >>> 7) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 19) | (w13h << 13)) ^ ((w13l << 3) | (w13h >>> 29)) ^ ((w13l >>> 6) | (w13h << 26)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w13h >>> 19) | (w13l << 13)) ^ ((w13h << 3) | (w13l >>> 29)) ^ (w13h >>> 6) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xa0e6e70 + w15l )|0;\n        th = ( 0x14292967 + w15h + ((tl >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 32\n        w0l = ( w0l + w9l )|0;\n        w0h = ( w0h + w9h + ((w0l >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 1) | (w1h << 31)) ^ ((w1l >>> 8) | (w1h << 24)) ^ ((w1l >>> 7) | (w1h << 25)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w1h >>> 1) | (w1l << 31)) ^ ((w1h >>> 8) | (w1l << 24)) ^ (w1h >>> 7) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 19) | (w14h << 13)) ^ ((w14l << 3) | (w14h >>> 29)) ^ ((w14l >>> 6) | (w14h << 26)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w14h >>> 19) | (w14l << 13)) ^ ((w14h << 3) | (w14l >>> 29)) ^ (w14h >>> 6) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x46d22ffc + w0l )|0;\n        th = ( 0x27b70a85 + w0h + ((tl >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 33\n        w1l = ( w1l + w10l )|0;\n        w1h = ( w1h + w10h + ((w1l >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 1) | (w2h << 31)) ^ ((w2l >>> 8) | (w2h << 24)) ^ ((w2l >>> 7) | (w2h << 25)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w2h >>> 1) | (w2l << 31)) ^ ((w2h >>> 8) | (w2l << 24)) ^ (w2h >>> 7) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 19) | (w15h << 13)) ^ ((w15l << 3) | (w15h >>> 29)) ^ ((w15l >>> 6) | (w15h << 26)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w15h >>> 19) | (w15l << 13)) ^ ((w15h << 3) | (w15l >>> 29)) ^ (w15h >>> 6) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x5c26c926 + w1l )|0;\n        th = ( 0x2e1b2138 + w1h + ((tl >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 34\n        w2l = ( w2l + w11l )|0;\n        w2h = ( w2h + w11h + ((w2l >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 1) | (w3h << 31)) ^ ((w3l >>> 8) | (w3h << 24)) ^ ((w3l >>> 7) | (w3h << 25)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w3h >>> 1) | (w3l << 31)) ^ ((w3h >>> 8) | (w3l << 24)) ^ (w3h >>> 7) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 19) | (w0h << 13)) ^ ((w0l << 3) | (w0h >>> 29)) ^ ((w0l >>> 6) | (w0h << 26)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w0h >>> 19) | (w0l << 13)) ^ ((w0h << 3) | (w0l >>> 29)) ^ (w0h >>> 6) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x5ac42aed + w2l )|0;\n        th = ( 0x4d2c6dfc + w2h + ((tl >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 35\n        w3l = ( w3l + w12l )|0;\n        w3h = ( w3h + w12h + ((w3l >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 1) | (w4h << 31)) ^ ((w4l >>> 8) | (w4h << 24)) ^ ((w4l >>> 7) | (w4h << 25)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w4h >>> 1) | (w4l << 31)) ^ ((w4h >>> 8) | (w4l << 24)) ^ (w4h >>> 7) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 19) | (w1h << 13)) ^ ((w1l << 3) | (w1h >>> 29)) ^ ((w1l >>> 6) | (w1h << 26)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w1h >>> 19) | (w1l << 13)) ^ ((w1h << 3) | (w1l >>> 29)) ^ (w1h >>> 6) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x9d95b3df + w3l )|0;\n        th = ( 0x53380d13 + w3h + ((tl >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 36\n        w4l = ( w4l + w13l )|0;\n        w4h = ( w4h + w13h + ((w4l >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 1) | (w5h << 31)) ^ ((w5l >>> 8) | (w5h << 24)) ^ ((w5l >>> 7) | (w5h << 25)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w5h >>> 1) | (w5l << 31)) ^ ((w5h >>> 8) | (w5l << 24)) ^ (w5h >>> 7) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 19) | (w2h << 13)) ^ ((w2l << 3) | (w2h >>> 29)) ^ ((w2l >>> 6) | (w2h << 26)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w2h >>> 19) | (w2l << 13)) ^ ((w2h << 3) | (w2l >>> 29)) ^ (w2h >>> 6) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x8baf63de + w4l )|0;\n        th = ( 0x650a7354 + w4h + ((tl >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 37\n        w5l = ( w5l + w14l )|0;\n        w5h = ( w5h + w14h + ((w5l >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 1) | (w6h << 31)) ^ ((w6l >>> 8) | (w6h << 24)) ^ ((w6l >>> 7) | (w6h << 25)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w6h >>> 1) | (w6l << 31)) ^ ((w6h >>> 8) | (w6l << 24)) ^ (w6h >>> 7) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 19) | (w3h << 13)) ^ ((w3l << 3) | (w3h >>> 29)) ^ ((w3l >>> 6) | (w3h << 26)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w3h >>> 19) | (w3l << 13)) ^ ((w3h << 3) | (w3l >>> 29)) ^ (w3h >>> 6) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x3c77b2a8 + w5l )|0;\n        th = ( 0x766a0abb + w5h + ((tl >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 38\n        w6l = ( w6l + w15l )|0;\n        w6h = ( w6h + w15h + ((w6l >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 1) | (w7h << 31)) ^ ((w7l >>> 8) | (w7h << 24)) ^ ((w7l >>> 7) | (w7h << 25)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w7h >>> 1) | (w7l << 31)) ^ ((w7h >>> 8) | (w7l << 24)) ^ (w7h >>> 7) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 19) | (w4h << 13)) ^ ((w4l << 3) | (w4h >>> 29)) ^ ((w4l >>> 6) | (w4h << 26)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w4h >>> 19) | (w4l << 13)) ^ ((w4h << 3) | (w4l >>> 29)) ^ (w4h >>> 6) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x47edaee6 + w6l )|0;\n        th = ( 0x81c2c92e + w6h + ((tl >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 39\n        w7l = ( w7l + w0l )|0;\n        w7h = ( w7h + w0h + ((w7l >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 1) | (w8h << 31)) ^ ((w8l >>> 8) | (w8h << 24)) ^ ((w8l >>> 7) | (w8h << 25)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w8h >>> 1) | (w8l << 31)) ^ ((w8h >>> 8) | (w8l << 24)) ^ (w8h >>> 7) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 19) | (w5h << 13)) ^ ((w5l << 3) | (w5h >>> 29)) ^ ((w5l >>> 6) | (w5h << 26)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w5h >>> 19) | (w5l << 13)) ^ ((w5h << 3) | (w5l >>> 29)) ^ (w5h >>> 6) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x1482353b + w7l )|0;\n        th = ( 0x92722c85 + w7h + ((tl >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 40\n        w8l = ( w8l + w1l )|0;\n        w8h = ( w8h + w1h + ((w8l >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 1) | (w9h << 31)) ^ ((w9l >>> 8) | (w9h << 24)) ^ ((w9l >>> 7) | (w9h << 25)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w9h >>> 1) | (w9l << 31)) ^ ((w9h >>> 8) | (w9l << 24)) ^ (w9h >>> 7) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 19) | (w6h << 13)) ^ ((w6l << 3) | (w6h >>> 29)) ^ ((w6l >>> 6) | (w6h << 26)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w6h >>> 19) | (w6l << 13)) ^ ((w6h << 3) | (w6l >>> 29)) ^ (w6h >>> 6) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x4cf10364 + w8l )|0;\n        th = ( 0xa2bfe8a1 + w8h + ((tl >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 41\n        w9l = ( w9l + w2l )|0;\n        w9h = ( w9h + w2h + ((w9l >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 1) | (w10h << 31)) ^ ((w10l >>> 8) | (w10h << 24)) ^ ((w10l >>> 7) | (w10h << 25)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w10h >>> 1) | (w10l << 31)) ^ ((w10h >>> 8) | (w10l << 24)) ^ (w10h >>> 7) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 19) | (w7h << 13)) ^ ((w7l << 3) | (w7h >>> 29)) ^ ((w7l >>> 6) | (w7h << 26)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w7h >>> 19) | (w7l << 13)) ^ ((w7h << 3) | (w7l >>> 29)) ^ (w7h >>> 6) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xbc423001 + w9l )|0;\n        th = ( 0xa81a664b + w9h + ((tl >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 42\n        w10l = ( w10l + w3l )|0;\n        w10h = ( w10h + w3h + ((w10l >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 1) | (w11h << 31)) ^ ((w11l >>> 8) | (w11h << 24)) ^ ((w11l >>> 7) | (w11h << 25)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w11h >>> 1) | (w11l << 31)) ^ ((w11h >>> 8) | (w11l << 24)) ^ (w11h >>> 7) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 19) | (w8h << 13)) ^ ((w8l << 3) | (w8h >>> 29)) ^ ((w8l >>> 6) | (w8h << 26)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w8h >>> 19) | (w8l << 13)) ^ ((w8h << 3) | (w8l >>> 29)) ^ (w8h >>> 6) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xd0f89791 + w10l )|0;\n        th = ( 0xc24b8b70 + w10h + ((tl >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 43\n        w11l = ( w11l + w4l )|0;\n        w11h = ( w11h + w4h + ((w11l >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 1) | (w12h << 31)) ^ ((w12l >>> 8) | (w12h << 24)) ^ ((w12l >>> 7) | (w12h << 25)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w12h >>> 1) | (w12l << 31)) ^ ((w12h >>> 8) | (w12l << 24)) ^ (w12h >>> 7) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 19) | (w9h << 13)) ^ ((w9l << 3) | (w9h >>> 29)) ^ ((w9l >>> 6) | (w9h << 26)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w9h >>> 19) | (w9l << 13)) ^ ((w9h << 3) | (w9l >>> 29)) ^ (w9h >>> 6) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x654be30 + w11l )|0;\n        th = ( 0xc76c51a3 + w11h + ((tl >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 44\n        w12l = ( w12l + w5l )|0;\n        w12h = ( w12h + w5h + ((w12l >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 1) | (w13h << 31)) ^ ((w13l >>> 8) | (w13h << 24)) ^ ((w13l >>> 7) | (w13h << 25)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w13h >>> 1) | (w13l << 31)) ^ ((w13h >>> 8) | (w13l << 24)) ^ (w13h >>> 7) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 19) | (w10h << 13)) ^ ((w10l << 3) | (w10h >>> 29)) ^ ((w10l >>> 6) | (w10h << 26)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w10h >>> 19) | (w10l << 13)) ^ ((w10h << 3) | (w10l >>> 29)) ^ (w10h >>> 6) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xd6ef5218 + w12l )|0;\n        th = ( 0xd192e819 + w12h + ((tl >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 45\n        w13l = ( w13l + w6l )|0;\n        w13h = ( w13h + w6h + ((w13l >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 1) | (w14h << 31)) ^ ((w14l >>> 8) | (w14h << 24)) ^ ((w14l >>> 7) | (w14h << 25)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w14h >>> 1) | (w14l << 31)) ^ ((w14h >>> 8) | (w14l << 24)) ^ (w14h >>> 7) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 19) | (w11h << 13)) ^ ((w11l << 3) | (w11h >>> 29)) ^ ((w11l >>> 6) | (w11h << 26)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w11h >>> 19) | (w11l << 13)) ^ ((w11h << 3) | (w11l >>> 29)) ^ (w11h >>> 6) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x5565a910 + w13l )|0;\n        th = ( 0xd6990624 + w13h + ((tl >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 46\n        w14l = ( w14l + w7l )|0;\n        w14h = ( w14h + w7h + ((w14l >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 1) | (w15h << 31)) ^ ((w15l >>> 8) | (w15h << 24)) ^ ((w15l >>> 7) | (w15h << 25)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w15h >>> 1) | (w15l << 31)) ^ ((w15h >>> 8) | (w15l << 24)) ^ (w15h >>> 7) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 19) | (w12h << 13)) ^ ((w12l << 3) | (w12h >>> 29)) ^ ((w12l >>> 6) | (w12h << 26)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w12h >>> 19) | (w12l << 13)) ^ ((w12h << 3) | (w12l >>> 29)) ^ (w12h >>> 6) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x5771202a + w14l )|0;\n        th = ( 0xf40e3585 + w14h + ((tl >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 47\n        w15l = ( w15l + w8l )|0;\n        w15h = ( w15h + w8h + ((w15l >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 1) | (w0h << 31)) ^ ((w0l >>> 8) | (w0h << 24)) ^ ((w0l >>> 7) | (w0h << 25)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w0h >>> 1) | (w0l << 31)) ^ ((w0h >>> 8) | (w0l << 24)) ^ (w0h >>> 7) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 19) | (w13h << 13)) ^ ((w13l << 3) | (w13h >>> 29)) ^ ((w13l >>> 6) | (w13h << 26)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w13h >>> 19) | (w13l << 13)) ^ ((w13h << 3) | (w13l >>> 29)) ^ (w13h >>> 6) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x32bbd1b8 + w15l )|0;\n        th = ( 0x106aa070 + w15h + ((tl >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 48\n        w0l = ( w0l + w9l )|0;\n        w0h = ( w0h + w9h + ((w0l >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 1) | (w1h << 31)) ^ ((w1l >>> 8) | (w1h << 24)) ^ ((w1l >>> 7) | (w1h << 25)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w1h >>> 1) | (w1l << 31)) ^ ((w1h >>> 8) | (w1l << 24)) ^ (w1h >>> 7) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 19) | (w14h << 13)) ^ ((w14l << 3) | (w14h >>> 29)) ^ ((w14l >>> 6) | (w14h << 26)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w14h >>> 19) | (w14l << 13)) ^ ((w14h << 3) | (w14l >>> 29)) ^ (w14h >>> 6) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xb8d2d0c8 + w0l )|0;\n        th = ( 0x19a4c116 + w0h + ((tl >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 49\n        w1l = ( w1l + w10l )|0;\n        w1h = ( w1h + w10h + ((w1l >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 1) | (w2h << 31)) ^ ((w2l >>> 8) | (w2h << 24)) ^ ((w2l >>> 7) | (w2h << 25)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w2h >>> 1) | (w2l << 31)) ^ ((w2h >>> 8) | (w2l << 24)) ^ (w2h >>> 7) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 19) | (w15h << 13)) ^ ((w15l << 3) | (w15h >>> 29)) ^ ((w15l >>> 6) | (w15h << 26)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w15h >>> 19) | (w15l << 13)) ^ ((w15h << 3) | (w15l >>> 29)) ^ (w15h >>> 6) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x5141ab53 + w1l )|0;\n        th = ( 0x1e376c08 + w1h + ((tl >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 50\n        w2l = ( w2l + w11l )|0;\n        w2h = ( w2h + w11h + ((w2l >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 1) | (w3h << 31)) ^ ((w3l >>> 8) | (w3h << 24)) ^ ((w3l >>> 7) | (w3h << 25)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w3h >>> 1) | (w3l << 31)) ^ ((w3h >>> 8) | (w3l << 24)) ^ (w3h >>> 7) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 19) | (w0h << 13)) ^ ((w0l << 3) | (w0h >>> 29)) ^ ((w0l >>> 6) | (w0h << 26)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w0h >>> 19) | (w0l << 13)) ^ ((w0h << 3) | (w0l >>> 29)) ^ (w0h >>> 6) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xdf8eeb99 + w2l )|0;\n        th = ( 0x2748774c + w2h + ((tl >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 51\n        w3l = ( w3l + w12l )|0;\n        w3h = ( w3h + w12h + ((w3l >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 1) | (w4h << 31)) ^ ((w4l >>> 8) | (w4h << 24)) ^ ((w4l >>> 7) | (w4h << 25)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w4h >>> 1) | (w4l << 31)) ^ ((w4h >>> 8) | (w4l << 24)) ^ (w4h >>> 7) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 19) | (w1h << 13)) ^ ((w1l << 3) | (w1h >>> 29)) ^ ((w1l >>> 6) | (w1h << 26)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w1h >>> 19) | (w1l << 13)) ^ ((w1h << 3) | (w1l >>> 29)) ^ (w1h >>> 6) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xe19b48a8 + w3l )|0;\n        th = ( 0x34b0bcb5 + w3h + ((tl >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 52\n        w4l = ( w4l + w13l )|0;\n        w4h = ( w4h + w13h + ((w4l >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 1) | (w5h << 31)) ^ ((w5l >>> 8) | (w5h << 24)) ^ ((w5l >>> 7) | (w5h << 25)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w5h >>> 1) | (w5l << 31)) ^ ((w5h >>> 8) | (w5l << 24)) ^ (w5h >>> 7) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 19) | (w2h << 13)) ^ ((w2l << 3) | (w2h >>> 29)) ^ ((w2l >>> 6) | (w2h << 26)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w2h >>> 19) | (w2l << 13)) ^ ((w2h << 3) | (w2l >>> 29)) ^ (w2h >>> 6) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xc5c95a63 + w4l )|0;\n        th = ( 0x391c0cb3 + w4h + ((tl >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 53\n        w5l = ( w5l + w14l )|0;\n        w5h = ( w5h + w14h + ((w5l >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 1) | (w6h << 31)) ^ ((w6l >>> 8) | (w6h << 24)) ^ ((w6l >>> 7) | (w6h << 25)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w6h >>> 1) | (w6l << 31)) ^ ((w6h >>> 8) | (w6l << 24)) ^ (w6h >>> 7) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 19) | (w3h << 13)) ^ ((w3l << 3) | (w3h >>> 29)) ^ ((w3l >>> 6) | (w3h << 26)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w3h >>> 19) | (w3l << 13)) ^ ((w3h << 3) | (w3l >>> 29)) ^ (w3h >>> 6) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xe3418acb + w5l )|0;\n        th = ( 0x4ed8aa4a + w5h + ((tl >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 54\n        w6l = ( w6l + w15l )|0;\n        w6h = ( w6h + w15h + ((w6l >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 1) | (w7h << 31)) ^ ((w7l >>> 8) | (w7h << 24)) ^ ((w7l >>> 7) | (w7h << 25)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w7h >>> 1) | (w7l << 31)) ^ ((w7h >>> 8) | (w7l << 24)) ^ (w7h >>> 7) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 19) | (w4h << 13)) ^ ((w4l << 3) | (w4h >>> 29)) ^ ((w4l >>> 6) | (w4h << 26)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w4h >>> 19) | (w4l << 13)) ^ ((w4h << 3) | (w4l >>> 29)) ^ (w4h >>> 6) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x7763e373 + w6l )|0;\n        th = ( 0x5b9cca4f + w6h + ((tl >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 55\n        w7l = ( w7l + w0l )|0;\n        w7h = ( w7h + w0h + ((w7l >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 1) | (w8h << 31)) ^ ((w8l >>> 8) | (w8h << 24)) ^ ((w8l >>> 7) | (w8h << 25)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w8h >>> 1) | (w8l << 31)) ^ ((w8h >>> 8) | (w8l << 24)) ^ (w8h >>> 7) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 19) | (w5h << 13)) ^ ((w5l << 3) | (w5h >>> 29)) ^ ((w5l >>> 6) | (w5h << 26)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w5h >>> 19) | (w5l << 13)) ^ ((w5h << 3) | (w5l >>> 29)) ^ (w5h >>> 6) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xd6b2b8a3 + w7l )|0;\n        th = ( 0x682e6ff3 + w7h + ((tl >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 56\n        w8l = ( w8l + w1l )|0;\n        w8h = ( w8h + w1h + ((w8l >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 1) | (w9h << 31)) ^ ((w9l >>> 8) | (w9h << 24)) ^ ((w9l >>> 7) | (w9h << 25)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w9h >>> 1) | (w9l << 31)) ^ ((w9h >>> 8) | (w9l << 24)) ^ (w9h >>> 7) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 19) | (w6h << 13)) ^ ((w6l << 3) | (w6h >>> 29)) ^ ((w6l >>> 6) | (w6h << 26)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w6h >>> 19) | (w6l << 13)) ^ ((w6h << 3) | (w6l >>> 29)) ^ (w6h >>> 6) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x5defb2fc + w8l )|0;\n        th = ( 0x748f82ee + w8h + ((tl >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 57\n        w9l = ( w9l + w2l )|0;\n        w9h = ( w9h + w2h + ((w9l >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 1) | (w10h << 31)) ^ ((w10l >>> 8) | (w10h << 24)) ^ ((w10l >>> 7) | (w10h << 25)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w10h >>> 1) | (w10l << 31)) ^ ((w10h >>> 8) | (w10l << 24)) ^ (w10h >>> 7) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 19) | (w7h << 13)) ^ ((w7l << 3) | (w7h >>> 29)) ^ ((w7l >>> 6) | (w7h << 26)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w7h >>> 19) | (w7l << 13)) ^ ((w7h << 3) | (w7l >>> 29)) ^ (w7h >>> 6) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x43172f60 + w9l )|0;\n        th = ( 0x78a5636f + w9h + ((tl >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 58\n        w10l = ( w10l + w3l )|0;\n        w10h = ( w10h + w3h + ((w10l >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 1) | (w11h << 31)) ^ ((w11l >>> 8) | (w11h << 24)) ^ ((w11l >>> 7) | (w11h << 25)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w11h >>> 1) | (w11l << 31)) ^ ((w11h >>> 8) | (w11l << 24)) ^ (w11h >>> 7) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 19) | (w8h << 13)) ^ ((w8l << 3) | (w8h >>> 29)) ^ ((w8l >>> 6) | (w8h << 26)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w8h >>> 19) | (w8l << 13)) ^ ((w8h << 3) | (w8l >>> 29)) ^ (w8h >>> 6) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xa1f0ab72 + w10l )|0;\n        th = ( 0x84c87814 + w10h + ((tl >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 59\n        w11l = ( w11l + w4l )|0;\n        w11h = ( w11h + w4h + ((w11l >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 1) | (w12h << 31)) ^ ((w12l >>> 8) | (w12h << 24)) ^ ((w12l >>> 7) | (w12h << 25)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w12h >>> 1) | (w12l << 31)) ^ ((w12h >>> 8) | (w12l << 24)) ^ (w12h >>> 7) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 19) | (w9h << 13)) ^ ((w9l << 3) | (w9h >>> 29)) ^ ((w9l >>> 6) | (w9h << 26)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w9h >>> 19) | (w9l << 13)) ^ ((w9h << 3) | (w9l >>> 29)) ^ (w9h >>> 6) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x1a6439ec + w11l )|0;\n        th = ( 0x8cc70208 + w11h + ((tl >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 60\n        w12l = ( w12l + w5l )|0;\n        w12h = ( w12h + w5h + ((w12l >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 1) | (w13h << 31)) ^ ((w13l >>> 8) | (w13h << 24)) ^ ((w13l >>> 7) | (w13h << 25)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w13h >>> 1) | (w13l << 31)) ^ ((w13h >>> 8) | (w13l << 24)) ^ (w13h >>> 7) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 19) | (w10h << 13)) ^ ((w10l << 3) | (w10h >>> 29)) ^ ((w10l >>> 6) | (w10h << 26)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w10h >>> 19) | (w10l << 13)) ^ ((w10h << 3) | (w10l >>> 29)) ^ (w10h >>> 6) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x23631e28 + w12l )|0;\n        th = ( 0x90befffa + w12h + ((tl >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 61\n        w13l = ( w13l + w6l )|0;\n        w13h = ( w13h + w6h + ((w13l >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 1) | (w14h << 31)) ^ ((w14l >>> 8) | (w14h << 24)) ^ ((w14l >>> 7) | (w14h << 25)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w14h >>> 1) | (w14l << 31)) ^ ((w14h >>> 8) | (w14l << 24)) ^ (w14h >>> 7) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 19) | (w11h << 13)) ^ ((w11l << 3) | (w11h >>> 29)) ^ ((w11l >>> 6) | (w11h << 26)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w11h >>> 19) | (w11l << 13)) ^ ((w11h << 3) | (w11l >>> 29)) ^ (w11h >>> 6) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xde82bde9 + w13l )|0;\n        th = ( 0xa4506ceb + w13h + ((tl >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 62\n        w14l = ( w14l + w7l )|0;\n        w14h = ( w14h + w7h + ((w14l >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 1) | (w15h << 31)) ^ ((w15l >>> 8) | (w15h << 24)) ^ ((w15l >>> 7) | (w15h << 25)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w15h >>> 1) | (w15l << 31)) ^ ((w15h >>> 8) | (w15l << 24)) ^ (w15h >>> 7) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 19) | (w12h << 13)) ^ ((w12l << 3) | (w12h >>> 29)) ^ ((w12l >>> 6) | (w12h << 26)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w12h >>> 19) | (w12l << 13)) ^ ((w12h << 3) | (w12l >>> 29)) ^ (w12h >>> 6) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xb2c67915 + w14l )|0;\n        th = ( 0xbef9a3f7 + w14h + ((tl >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 63\n        w15l = ( w15l + w8l )|0;\n        w15h = ( w15h + w8h + ((w15l >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 1) | (w0h << 31)) ^ ((w0l >>> 8) | (w0h << 24)) ^ ((w0l >>> 7) | (w0h << 25)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w0h >>> 1) | (w0l << 31)) ^ ((w0h >>> 8) | (w0l << 24)) ^ (w0h >>> 7) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 19) | (w13h << 13)) ^ ((w13l << 3) | (w13h >>> 29)) ^ ((w13l >>> 6) | (w13h << 26)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w13h >>> 19) | (w13l << 13)) ^ ((w13h << 3) | (w13l >>> 29)) ^ (w13h >>> 6) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xe372532b + w15l )|0;\n        th = ( 0xc67178f2 + w15h + ((tl >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 64\n        w0l = ( w0l + w9l )|0;\n        w0h = ( w0h + w9h + ((w0l >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 1) | (w1h << 31)) ^ ((w1l >>> 8) | (w1h << 24)) ^ ((w1l >>> 7) | (w1h << 25)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w1h >>> 1) | (w1l << 31)) ^ ((w1h >>> 8) | (w1l << 24)) ^ (w1h >>> 7) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 19) | (w14h << 13)) ^ ((w14l << 3) | (w14h >>> 29)) ^ ((w14l >>> 6) | (w14h << 26)) )|0;\n        w0l = ( w0l + xl)|0;\n        w0h = ( w0h + ( ((w14h >>> 19) | (w14l << 13)) ^ ((w14h << 3) | (w14l >>> 29)) ^ (w14h >>> 6) ) + ((w0l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xea26619c + w0l )|0;\n        th = ( 0xca273ece + w0h + ((tl >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 65\n        w1l = ( w1l + w10l )|0;\n        w1h = ( w1h + w10h + ((w1l >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 1) | (w2h << 31)) ^ ((w2l >>> 8) | (w2h << 24)) ^ ((w2l >>> 7) | (w2h << 25)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w2h >>> 1) | (w2l << 31)) ^ ((w2h >>> 8) | (w2l << 24)) ^ (w2h >>> 7) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 19) | (w15h << 13)) ^ ((w15l << 3) | (w15h >>> 29)) ^ ((w15l >>> 6) | (w15h << 26)) )|0;\n        w1l = ( w1l + xl)|0;\n        w1h = ( w1h + ( ((w15h >>> 19) | (w15l << 13)) ^ ((w15h << 3) | (w15l >>> 29)) ^ (w15h >>> 6) ) + ((w1l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x21c0c207 + w1l )|0;\n        th = ( 0xd186b8c7 + w1h + ((tl >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 66\n        w2l = ( w2l + w11l )|0;\n        w2h = ( w2h + w11h + ((w2l >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 1) | (w3h << 31)) ^ ((w3l >>> 8) | (w3h << 24)) ^ ((w3l >>> 7) | (w3h << 25)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w3h >>> 1) | (w3l << 31)) ^ ((w3h >>> 8) | (w3l << 24)) ^ (w3h >>> 7) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 19) | (w0h << 13)) ^ ((w0l << 3) | (w0h >>> 29)) ^ ((w0l >>> 6) | (w0h << 26)) )|0;\n        w2l = ( w2l + xl)|0;\n        w2h = ( w2h + ( ((w0h >>> 19) | (w0l << 13)) ^ ((w0h << 3) | (w0l >>> 29)) ^ (w0h >>> 6) ) + ((w2l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xcde0eb1e + w2l )|0;\n        th = ( 0xeada7dd6 + w2h + ((tl >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 67\n        w3l = ( w3l + w12l )|0;\n        w3h = ( w3h + w12h + ((w3l >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 1) | (w4h << 31)) ^ ((w4l >>> 8) | (w4h << 24)) ^ ((w4l >>> 7) | (w4h << 25)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w4h >>> 1) | (w4l << 31)) ^ ((w4h >>> 8) | (w4l << 24)) ^ (w4h >>> 7) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w1l >>> 19) | (w1h << 13)) ^ ((w1l << 3) | (w1h >>> 29)) ^ ((w1l >>> 6) | (w1h << 26)) )|0;\n        w3l = ( w3l + xl)|0;\n        w3h = ( w3h + ( ((w1h >>> 19) | (w1l << 13)) ^ ((w1h << 3) | (w1l >>> 29)) ^ (w1h >>> 6) ) + ((w3l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xee6ed178 + w3l )|0;\n        th = ( 0xf57d4f7f + w3h + ((tl >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 68\n        w4l = ( w4l + w13l )|0;\n        w4h = ( w4h + w13h + ((w4l >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 1) | (w5h << 31)) ^ ((w5l >>> 8) | (w5h << 24)) ^ ((w5l >>> 7) | (w5h << 25)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w5h >>> 1) | (w5l << 31)) ^ ((w5h >>> 8) | (w5l << 24)) ^ (w5h >>> 7) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w2l >>> 19) | (w2h << 13)) ^ ((w2l << 3) | (w2h >>> 29)) ^ ((w2l >>> 6) | (w2h << 26)) )|0;\n        w4l = ( w4l + xl)|0;\n        w4h = ( w4h + ( ((w2h >>> 19) | (w2l << 13)) ^ ((w2h << 3) | (w2l >>> 29)) ^ (w2h >>> 6) ) + ((w4l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x72176fba + w4l )|0;\n        th = ( 0x6f067aa + w4h + ((tl >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 69\n        w5l = ( w5l + w14l )|0;\n        w5h = ( w5h + w14h + ((w5l >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 1) | (w6h << 31)) ^ ((w6l >>> 8) | (w6h << 24)) ^ ((w6l >>> 7) | (w6h << 25)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w6h >>> 1) | (w6l << 31)) ^ ((w6h >>> 8) | (w6l << 24)) ^ (w6h >>> 7) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w3l >>> 19) | (w3h << 13)) ^ ((w3l << 3) | (w3h >>> 29)) ^ ((w3l >>> 6) | (w3h << 26)) )|0;\n        w5l = ( w5l + xl)|0;\n        w5h = ( w5h + ( ((w3h >>> 19) | (w3l << 13)) ^ ((w3h << 3) | (w3l >>> 29)) ^ (w3h >>> 6) ) + ((w5l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xa2c898a6 + w5l )|0;\n        th = ( 0xa637dc5 + w5h + ((tl >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 70\n        w6l = ( w6l + w15l )|0;\n        w6h = ( w6h + w15h + ((w6l >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 1) | (w7h << 31)) ^ ((w7l >>> 8) | (w7h << 24)) ^ ((w7l >>> 7) | (w7h << 25)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w7h >>> 1) | (w7l << 31)) ^ ((w7h >>> 8) | (w7l << 24)) ^ (w7h >>> 7) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w4l >>> 19) | (w4h << 13)) ^ ((w4l << 3) | (w4h >>> 29)) ^ ((w4l >>> 6) | (w4h << 26)) )|0;\n        w6l = ( w6l + xl)|0;\n        w6h = ( w6h + ( ((w4h >>> 19) | (w4l << 13)) ^ ((w4h << 3) | (w4l >>> 29)) ^ (w4h >>> 6) ) + ((w6l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xbef90dae + w6l )|0;\n        th = ( 0x113f9804 + w6h + ((tl >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 71\n        w7l = ( w7l + w0l )|0;\n        w7h = ( w7h + w0h + ((w7l >>> 0) < (w0l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 1) | (w8h << 31)) ^ ((w8l >>> 8) | (w8h << 24)) ^ ((w8l >>> 7) | (w8h << 25)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w8h >>> 1) | (w8l << 31)) ^ ((w8h >>> 8) | (w8l << 24)) ^ (w8h >>> 7) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w5l >>> 19) | (w5h << 13)) ^ ((w5l << 3) | (w5h >>> 29)) ^ ((w5l >>> 6) | (w5h << 26)) )|0;\n        w7l = ( w7l + xl)|0;\n        w7h = ( w7h + ( ((w5h >>> 19) | (w5l << 13)) ^ ((w5h << 3) | (w5l >>> 29)) ^ (w5h >>> 6) ) + ((w7l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x131c471b + w7l )|0;\n        th = ( 0x1b710b35 + w7h + ((tl >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 72\n        w8l = ( w8l + w1l )|0;\n        w8h = ( w8h + w1h + ((w8l >>> 0) < (w1l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 1) | (w9h << 31)) ^ ((w9l >>> 8) | (w9h << 24)) ^ ((w9l >>> 7) | (w9h << 25)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w9h >>> 1) | (w9l << 31)) ^ ((w9h >>> 8) | (w9l << 24)) ^ (w9h >>> 7) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w6l >>> 19) | (w6h << 13)) ^ ((w6l << 3) | (w6h >>> 29)) ^ ((w6l >>> 6) | (w6h << 26)) )|0;\n        w8l = ( w8l + xl)|0;\n        w8h = ( w8h + ( ((w6h >>> 19) | (w6l << 13)) ^ ((w6h << 3) | (w6l >>> 29)) ^ (w6h >>> 6) ) + ((w8l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x23047d84 + w8l )|0;\n        th = ( 0x28db77f5 + w8h + ((tl >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 73\n        w9l = ( w9l + w2l )|0;\n        w9h = ( w9h + w2h + ((w9l >>> 0) < (w2l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 1) | (w10h << 31)) ^ ((w10l >>> 8) | (w10h << 24)) ^ ((w10l >>> 7) | (w10h << 25)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w10h >>> 1) | (w10l << 31)) ^ ((w10h >>> 8) | (w10l << 24)) ^ (w10h >>> 7) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w7l >>> 19) | (w7h << 13)) ^ ((w7l << 3) | (w7h >>> 29)) ^ ((w7l >>> 6) | (w7h << 26)) )|0;\n        w9l = ( w9l + xl)|0;\n        w9h = ( w9h + ( ((w7h >>> 19) | (w7l << 13)) ^ ((w7h << 3) | (w7l >>> 29)) ^ (w7h >>> 6) ) + ((w9l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x40c72493 + w9l )|0;\n        th = ( 0x32caab7b + w9h + ((tl >>> 0) < (w9l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 74\n        w10l = ( w10l + w3l )|0;\n        w10h = ( w10h + w3h + ((w10l >>> 0) < (w3l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 1) | (w11h << 31)) ^ ((w11l >>> 8) | (w11h << 24)) ^ ((w11l >>> 7) | (w11h << 25)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w11h >>> 1) | (w11l << 31)) ^ ((w11h >>> 8) | (w11l << 24)) ^ (w11h >>> 7) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w8l >>> 19) | (w8h << 13)) ^ ((w8l << 3) | (w8h >>> 29)) ^ ((w8l >>> 6) | (w8h << 26)) )|0;\n        w10l = ( w10l + xl)|0;\n        w10h = ( w10h + ( ((w8h >>> 19) | (w8l << 13)) ^ ((w8h << 3) | (w8l >>> 29)) ^ (w8h >>> 6) ) + ((w10l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x15c9bebc + w10l )|0;\n        th = ( 0x3c9ebe0a + w10h + ((tl >>> 0) < (w10l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 75\n        w11l = ( w11l + w4l )|0;\n        w11h = ( w11h + w4h + ((w11l >>> 0) < (w4l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 1) | (w12h << 31)) ^ ((w12l >>> 8) | (w12h << 24)) ^ ((w12l >>> 7) | (w12h << 25)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w12h >>> 1) | (w12l << 31)) ^ ((w12h >>> 8) | (w12l << 24)) ^ (w12h >>> 7) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w9l >>> 19) | (w9h << 13)) ^ ((w9l << 3) | (w9h >>> 29)) ^ ((w9l >>> 6) | (w9h << 26)) )|0;\n        w11l = ( w11l + xl)|0;\n        w11h = ( w11h + ( ((w9h >>> 19) | (w9l << 13)) ^ ((w9h << 3) | (w9l >>> 29)) ^ (w9h >>> 6) ) + ((w11l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x9c100d4c + w11l )|0;\n        th = ( 0x431d67c4 + w11h + ((tl >>> 0) < (w11l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 76\n        w12l = ( w12l + w5l )|0;\n        w12h = ( w12h + w5h + ((w12l >>> 0) < (w5l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 1) | (w13h << 31)) ^ ((w13l >>> 8) | (w13h << 24)) ^ ((w13l >>> 7) | (w13h << 25)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w13h >>> 1) | (w13l << 31)) ^ ((w13h >>> 8) | (w13l << 24)) ^ (w13h >>> 7) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w10l >>> 19) | (w10h << 13)) ^ ((w10l << 3) | (w10h >>> 29)) ^ ((w10l >>> 6) | (w10h << 26)) )|0;\n        w12l = ( w12l + xl)|0;\n        w12h = ( w12h + ( ((w10h >>> 19) | (w10l << 13)) ^ ((w10h << 3) | (w10l >>> 29)) ^ (w10h >>> 6) ) + ((w12l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xcb3e42b6 + w12l )|0;\n        th = ( 0x4cc5d4be + w12h + ((tl >>> 0) < (w12l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 77\n        w13l = ( w13l + w6l )|0;\n        w13h = ( w13h + w6h + ((w13l >>> 0) < (w6l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w14l >>> 1) | (w14h << 31)) ^ ((w14l >>> 8) | (w14h << 24)) ^ ((w14l >>> 7) | (w14h << 25)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w14h >>> 1) | (w14l << 31)) ^ ((w14h >>> 8) | (w14l << 24)) ^ (w14h >>> 7) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w11l >>> 19) | (w11h << 13)) ^ ((w11l << 3) | (w11h >>> 29)) ^ ((w11l >>> 6) | (w11h << 26)) )|0;\n        w13l = ( w13l + xl)|0;\n        w13h = ( w13h + ( ((w11h >>> 19) | (w11l << 13)) ^ ((w11h << 3) | (w11l >>> 29)) ^ (w11h >>> 6) ) + ((w13l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0xfc657e2a + w13l )|0;\n        th = ( 0x597f299c + w13h + ((tl >>> 0) < (w13l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 78\n        w14l = ( w14l + w7l )|0;\n        w14h = ( w14h + w7h + ((w14l >>> 0) < (w7l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w15l >>> 1) | (w15h << 31)) ^ ((w15l >>> 8) | (w15h << 24)) ^ ((w15l >>> 7) | (w15h << 25)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w15h >>> 1) | (w15l << 31)) ^ ((w15h >>> 8) | (w15l << 24)) ^ (w15h >>> 7) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w12l >>> 19) | (w12h << 13)) ^ ((w12l << 3) | (w12h >>> 29)) ^ ((w12l >>> 6) | (w12h << 26)) )|0;\n        w14l = ( w14l + xl)|0;\n        w14h = ( w14h + ( ((w12h >>> 19) | (w12l << 13)) ^ ((w12h << 3) | (w12l >>> 29)) ^ (w12h >>> 6) ) + ((w14l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x3ad6faec + w14l )|0;\n        th = ( 0x5fcb6fab + w14h + ((tl >>> 0) < (w14l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        // 79\n        w15l = ( w15l + w8l )|0;\n        w15h = ( w15h + w8h + ((w15l >>> 0) < (w8l >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w0l >>> 1) | (w0h << 31)) ^ ((w0l >>> 8) | (w0h << 24)) ^ ((w0l >>> 7) | (w0h << 25)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w0h >>> 1) | (w0l << 31)) ^ ((w0h >>> 8) | (w0l << 24)) ^ (w0h >>> 7) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((w13l >>> 19) | (w13h << 13)) ^ ((w13l << 3) | (w13h >>> 29)) ^ ((w13l >>> 6) | (w13h << 26)) )|0;\n        w15l = ( w15l + xl)|0;\n        w15h = ( w15h + ( ((w13h >>> 19) | (w13l << 13)) ^ ((w13h << 3) | (w13l >>> 29)) ^ (w13h >>> 6) ) + ((w15l >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        tl = ( 0x4a475817 + w15l )|0;\n        th = ( 0x6c44198c + w15h + ((tl >>> 0) < (w15l >>> 0) ? 1 : 0) )|0;\n        tl = ( tl + hl )|0;\n        th = ( th + hh + ((tl >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9)) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + (((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9))) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        xl = ( ( gl ^ el & (fl^gl) ) )|0;\n        tl = ( tl + xl )|0;\n        th = ( th + ( gh ^ eh & (fh^gh) ) + ((tl >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n        hl = gl; hh = gh;\n        gl = fl; gh = fh;\n        fl = el; fh = eh;\n        el = ( dl + tl )|0; eh = ( dh + th + ((el >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        dl = cl; dh = ch;\n        cl = bl; ch = bh;\n        bl = al; bh = ah;\n        al = ( tl + ( (bl & cl) ^ ( dl & (bl ^ cl) ) ) )|0;\n        ah = ( th + ( (bh & ch) ^ ( dh & (bh ^ ch) ) ) + ((al >>> 0) < (tl >>> 0) ? 1 : 0) )|0;\n        xl = ( ((bl >>> 28) | (bh << 4)) ^ ((bl << 30) | (bh >>> 2)) ^ ((bl << 25) | (bh >>> 7)) )|0;\n        al = ( al + xl )|0;\n        ah = ( ah + (((bh >>> 28) | (bl << 4)) ^ ((bh << 30) | (bl >>> 2)) ^ ((bh << 25) | (bl >>> 7))) + ((al >>> 0) < (xl >>> 0) ? 1 : 0) )|0;\n\n        H0l = ( H0l + al )|0;\n        H0h = ( H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0) )|0;\n        H1l = ( H1l + bl )|0;\n        H1h = ( H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0) )|0;\n        H2l = ( H2l + cl )|0;\n        H2h = ( H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0) )|0;\n        H3l = ( H3l + dl )|0;\n        H3h = ( H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0) )|0;\n        H4l = ( H4l + el )|0;\n        H4h = ( H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0) )|0;\n        H5l = ( H5l + fl )|0;\n        H5h = ( H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0) )|0;\n        H6l = ( H6l + gl )|0;\n        H6h = ( H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0) )|0;\n        H7l = ( H7l + hl )|0;\n        H7h = ( H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0) )|0;\n    }\n\n    function _core_heap ( offset ) {\n        offset = offset|0;\n\n        _core(\n            HEAP[offset|0]<<24 | HEAP[offset|1]<<16 | HEAP[offset|2]<<8 | HEAP[offset|3],\n            HEAP[offset|4]<<24 | HEAP[offset|5]<<16 | HEAP[offset|6]<<8 | HEAP[offset|7],\n            HEAP[offset|8]<<24 | HEAP[offset|9]<<16 | HEAP[offset|10]<<8 | HEAP[offset|11],\n            HEAP[offset|12]<<24 | HEAP[offset|13]<<16 | HEAP[offset|14]<<8 | HEAP[offset|15],\n            HEAP[offset|16]<<24 | HEAP[offset|17]<<16 | HEAP[offset|18]<<8 | HEAP[offset|19],\n            HEAP[offset|20]<<24 | HEAP[offset|21]<<16 | HEAP[offset|22]<<8 | HEAP[offset|23],\n            HEAP[offset|24]<<24 | HEAP[offset|25]<<16 | HEAP[offset|26]<<8 | HEAP[offset|27],\n            HEAP[offset|28]<<24 | HEAP[offset|29]<<16 | HEAP[offset|30]<<8 | HEAP[offset|31],\n            HEAP[offset|32]<<24 | HEAP[offset|33]<<16 | HEAP[offset|34]<<8 | HEAP[offset|35],\n            HEAP[offset|36]<<24 | HEAP[offset|37]<<16 | HEAP[offset|38]<<8 | HEAP[offset|39],\n            HEAP[offset|40]<<24 | HEAP[offset|41]<<16 | HEAP[offset|42]<<8 | HEAP[offset|43],\n            HEAP[offset|44]<<24 | HEAP[offset|45]<<16 | HEAP[offset|46]<<8 | HEAP[offset|47],\n            HEAP[offset|48]<<24 | HEAP[offset|49]<<16 | HEAP[offset|50]<<8 | HEAP[offset|51],\n            HEAP[offset|52]<<24 | HEAP[offset|53]<<16 | HEAP[offset|54]<<8 | HEAP[offset|55],\n            HEAP[offset|56]<<24 | HEAP[offset|57]<<16 | HEAP[offset|58]<<8 | HEAP[offset|59],\n            HEAP[offset|60]<<24 | HEAP[offset|61]<<16 | HEAP[offset|62]<<8 | HEAP[offset|63],\n            HEAP[offset|64]<<24 | HEAP[offset|65]<<16 | HEAP[offset|66]<<8 | HEAP[offset|67],\n            HEAP[offset|68]<<24 | HEAP[offset|69]<<16 | HEAP[offset|70]<<8 | HEAP[offset|71],\n            HEAP[offset|72]<<24 | HEAP[offset|73]<<16 | HEAP[offset|74]<<8 | HEAP[offset|75],\n            HEAP[offset|76]<<24 | HEAP[offset|77]<<16 | HEAP[offset|78]<<8 | HEAP[offset|79],\n            HEAP[offset|80]<<24 | HEAP[offset|81]<<16 | HEAP[offset|82]<<8 | HEAP[offset|83],\n            HEAP[offset|84]<<24 | HEAP[offset|85]<<16 | HEAP[offset|86]<<8 | HEAP[offset|87],\n            HEAP[offset|88]<<24 | HEAP[offset|89]<<16 | HEAP[offset|90]<<8 | HEAP[offset|91],\n            HEAP[offset|92]<<24 | HEAP[offset|93]<<16 | HEAP[offset|94]<<8 | HEAP[offset|95],\n            HEAP[offset|96]<<24 | HEAP[offset|97]<<16 | HEAP[offset|98]<<8 | HEAP[offset|99],\n            HEAP[offset|100]<<24 | HEAP[offset|101]<<16 | HEAP[offset|102]<<8 | HEAP[offset|103],\n            HEAP[offset|104]<<24 | HEAP[offset|105]<<16 | HEAP[offset|106]<<8 | HEAP[offset|107],\n            HEAP[offset|108]<<24 | HEAP[offset|109]<<16 | HEAP[offset|110]<<8 | HEAP[offset|111],\n            HEAP[offset|112]<<24 | HEAP[offset|113]<<16 | HEAP[offset|114]<<8 | HEAP[offset|115],\n            HEAP[offset|116]<<24 | HEAP[offset|117]<<16 | HEAP[offset|118]<<8 | HEAP[offset|119],\n            HEAP[offset|120]<<24 | HEAP[offset|121]<<16 | HEAP[offset|122]<<8 | HEAP[offset|123],\n            HEAP[offset|124]<<24 | HEAP[offset|125]<<16 | HEAP[offset|126]<<8 | HEAP[offset|127]\n        );\n    }\n\n    // offset — multiple of 32\n    function _state_to_heap ( output ) {\n        output = output|0;\n\n        HEAP[output|0] = H0h>>>24;\n        HEAP[output|1] = H0h>>>16&255;\n        HEAP[output|2] = H0h>>>8&255;\n        HEAP[output|3] = H0h&255;\n        HEAP[output|4] = H0l>>>24;\n        HEAP[output|5] = H0l>>>16&255;\n        HEAP[output|6] = H0l>>>8&255;\n        HEAP[output|7] = H0l&255;\n        HEAP[output|8] = H1h>>>24;\n        HEAP[output|9] = H1h>>>16&255;\n        HEAP[output|10] = H1h>>>8&255;\n        HEAP[output|11] = H1h&255;\n        HEAP[output|12] = H1l>>>24;\n        HEAP[output|13] = H1l>>>16&255;\n        HEAP[output|14] = H1l>>>8&255;\n        HEAP[output|15] = H1l&255;\n        HEAP[output|16] = H2h>>>24;\n        HEAP[output|17] = H2h>>>16&255;\n        HEAP[output|18] = H2h>>>8&255;\n        HEAP[output|19] = H2h&255;\n        HEAP[output|20] = H2l>>>24;\n        HEAP[output|21] = H2l>>>16&255;\n        HEAP[output|22] = H2l>>>8&255;\n        HEAP[output|23] = H2l&255;\n        HEAP[output|24] = H3h>>>24;\n        HEAP[output|25] = H3h>>>16&255;\n        HEAP[output|26] = H3h>>>8&255;\n        HEAP[output|27] = H3h&255;\n        HEAP[output|28] = H3l>>>24;\n        HEAP[output|29] = H3l>>>16&255;\n        HEAP[output|30] = H3l>>>8&255;\n        HEAP[output|31] = H3l&255;\n        HEAP[output|32] = H4h>>>24;\n        HEAP[output|33] = H4h>>>16&255;\n        HEAP[output|34] = H4h>>>8&255;\n        HEAP[output|35] = H4h&255;\n        HEAP[output|36] = H4l>>>24;\n        HEAP[output|37] = H4l>>>16&255;\n        HEAP[output|38] = H4l>>>8&255;\n        HEAP[output|39] = H4l&255;\n        HEAP[output|40] = H5h>>>24;\n        HEAP[output|41] = H5h>>>16&255;\n        HEAP[output|42] = H5h>>>8&255;\n        HEAP[output|43] = H5h&255;\n        HEAP[output|44] = H5l>>>24;\n        HEAP[output|45] = H5l>>>16&255;\n        HEAP[output|46] = H5l>>>8&255;\n        HEAP[output|47] = H5l&255;\n        HEAP[output|48] = H6h>>>24;\n        HEAP[output|49] = H6h>>>16&255;\n        HEAP[output|50] = H6h>>>8&255;\n        HEAP[output|51] = H6h&255;\n        HEAP[output|52] = H6l>>>24;\n        HEAP[output|53] = H6l>>>16&255;\n        HEAP[output|54] = H6l>>>8&255;\n        HEAP[output|55] = H6l&255;\n        HEAP[output|56] = H7h>>>24;\n        HEAP[output|57] = H7h>>>16&255;\n        HEAP[output|58] = H7h>>>8&255;\n        HEAP[output|59] = H7h&255;\n        HEAP[output|60] = H7l>>>24;\n        HEAP[output|61] = H7l>>>16&255;\n        HEAP[output|62] = H7l>>>8&255;\n        HEAP[output|63] = H7l&255;\n    }\n\n    function reset () {\n        H0h = 0x6a09e667;\n        H0l = 0xf3bcc908;\n        H1h = 0xbb67ae85;\n        H1l = 0x84caa73b;\n        H2h = 0x3c6ef372;\n        H2l = 0xfe94f82b;\n        H3h = 0xa54ff53a;\n        H3l = 0x5f1d36f1;\n        H4h = 0x510e527f;\n        H4l = 0xade682d1;\n        H5h = 0x9b05688c;\n        H5l = 0x2b3e6c1f;\n        H6h = 0x1f83d9ab;\n        H6l = 0xfb41bd6b;\n        H7h = 0x5be0cd19;\n        H7l = 0x137e2179;\n\n        TOTAL0 = TOTAL1 = 0;\n    }\n\n    function init ( h0h, h0l, h1h, h1l, h2h, h2l, h3h, h3l, h4h, h4l, h5h, h5l, h6h, h6l, h7h, h7l, total0, total1 ) {\n        h0h = h0h|0;\n        h0l = h0l|0;\n        h1h = h1h|0;\n        h1l = h1l|0;\n        h2h = h2h|0;\n        h2l = h2l|0;\n        h3h = h3h|0;\n        h3l = h3l|0;\n        h4h = h4h|0;\n        h4l = h4l|0;\n        h5h = h5h|0;\n        h5l = h5l|0;\n        h6h = h6h|0;\n        h6l = h6l|0;\n        h7h = h7h|0;\n        h7l = h7l|0;\n        total0 = total0|0;\n        total1 = total1|0;\n\n        H0h = h0h;\n        H0l = h0l;\n        H1h = h1h;\n        H1l = h1l;\n        H2h = h2h;\n        H2l = h2l;\n        H3h = h3h;\n        H3l = h3l;\n        H4h = h4h;\n        H4l = h4l;\n        H5h = h5h;\n        H5l = h5l;\n        H6h = h6h;\n        H6l = h6l;\n        H7h = h7h;\n        H7l = h7l;\n        TOTAL0 = total0;\n        TOTAL1 = total1;\n    }\n\n    // offset — multiple of 128\n    function process ( offset, length ) {\n        offset = offset|0;\n        length = length|0;\n\n        var hashed = 0;\n\n        if ( offset & 127 )\n            return -1;\n\n        while ( (length|0) >= 128 ) {\n            _core_heap(offset);\n\n            offset = ( offset + 128 )|0;\n            length = ( length - 128 )|0;\n\n            hashed = ( hashed + 128 )|0;\n        }\n\n        TOTAL0 = ( TOTAL0 + hashed )|0;\n        if ( TOTAL0>>>0 < hashed>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        return hashed|0;\n    }\n\n    // offset — multiple of 128\n    // output — multiple of 64\n    function finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var hashed = 0,\n            i = 0;\n\n        if ( offset & 127 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 63 )\n                return -1;\n\n        if ( (length|0) >= 128 ) {\n            hashed = process( offset, length )|0;\n            if ( (hashed|0) == -1 )\n                return -1;\n\n            offset = ( offset + hashed )|0;\n            length = ( length - hashed )|0;\n        }\n\n        hashed = ( hashed + length )|0;\n        TOTAL0 = ( TOTAL0 + length )|0;\n        if ( TOTAL0>>>0 < length>>>0 ) TOTAL1 = ( TOTAL1 + 1 )|0;\n\n        HEAP[offset|length] = 0x80;\n\n        if ( (length|0) >= 112 ) {\n            for ( i = (length+1)|0; (i|0) < 128; i = (i+1)|0 )\n                HEAP[offset|i] = 0x00;\n\n            _core_heap(offset);\n\n            length = 0;\n\n            HEAP[offset|0] = 0;\n        }\n\n        for ( i = (length+1)|0; (i|0) < 123; i = (i+1)|0 )\n            HEAP[offset|i] = 0;\n\n        HEAP[offset|120] = TOTAL1>>>21&255;\n        HEAP[offset|121] = TOTAL1>>>13&255;\n        HEAP[offset|122] = TOTAL1>>>5&255;\n        HEAP[offset|123] = TOTAL1<<3&255 | TOTAL0>>>29;\n        HEAP[offset|124] = TOTAL0>>>21&255;\n        HEAP[offset|125] = TOTAL0>>>13&255;\n        HEAP[offset|126] = TOTAL0>>>5&255;\n        HEAP[offset|127] = TOTAL0<<3&255;\n        _core_heap(offset);\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    function hmac_reset () {\n        H0h = I0h;\n        H0l = I0l;\n        H1h = I1h;\n        H1l = I1l;\n        H2h = I2h;\n        H2l = I2l;\n        H3h = I3h;\n        H3l = I3l;\n        H4h = I4h;\n        H4l = I4l;\n        H5h = I5h;\n        H5l = I5l;\n        H6h = I6h;\n        H6l = I6l;\n        H7h = I7h;\n        H7l = I7l;\n        TOTAL0 = 128;\n        TOTAL1 = 0;\n    }\n\n    function _hmac_opad () {\n        H0h = O0h;\n        H0l = O0l;\n        H1h = O1h;\n        H1l = O1l;\n        H2h = O2h;\n        H2l = O2l;\n        H3h = O3h;\n        H3l = O3l;\n        H4h = O4h;\n        H4l = O4l;\n        H5h = O5h;\n        H5l = O5l;\n        H6h = O6h;\n        H6l = O6l;\n        H7h = O7h;\n        H7l = O7l;\n        TOTAL0 = 128;\n        TOTAL1 = 0;\n    }\n\n    function hmac_init ( p0h, p0l, p1h, p1l, p2h, p2l, p3h, p3l, p4h, p4l, p5h, p5l, p6h, p6l, p7h, p7l, p8h, p8l, p9h, p9l, p10h, p10l, p11h, p11l, p12h, p12l, p13h, p13l, p14h, p14l, p15h, p15l ) {\n        p0h = p0h|0;\n        p0l = p0l|0;\n        p1h = p1h|0;\n        p1l = p1l|0;\n        p2h = p2h|0;\n        p2l = p2l|0;\n        p3h = p3h|0;\n        p3l = p3l|0;\n        p4h = p4h|0;\n        p4l = p4l|0;\n        p5h = p5h|0;\n        p5l = p5l|0;\n        p6h = p6h|0;\n        p6l = p6l|0;\n        p7h = p7h|0;\n        p7l = p7l|0;\n        p8h = p8h|0;\n        p8l = p8l|0;\n        p9h = p9h|0;\n        p9l = p9l|0;\n        p10h = p10h|0;\n        p10l = p10l|0;\n        p11h = p11h|0;\n        p11l = p11l|0;\n        p12h = p12h|0;\n        p12l = p12l|0;\n        p13h = p13h|0;\n        p13l = p13l|0;\n        p14h = p14h|0;\n        p14l = p14l|0;\n        p15h = p15h|0;\n        p15l = p15l|0;\n\n        // opad\n        reset();\n        _core(\n            p0h ^ 0x5c5c5c5c,\n            p0l ^ 0x5c5c5c5c,\n            p1h ^ 0x5c5c5c5c,\n            p1l ^ 0x5c5c5c5c,\n            p2h ^ 0x5c5c5c5c,\n            p2l ^ 0x5c5c5c5c,\n            p3h ^ 0x5c5c5c5c,\n            p3l ^ 0x5c5c5c5c,\n            p4h ^ 0x5c5c5c5c,\n            p4l ^ 0x5c5c5c5c,\n            p5h ^ 0x5c5c5c5c,\n            p5l ^ 0x5c5c5c5c,\n            p6h ^ 0x5c5c5c5c,\n            p6l ^ 0x5c5c5c5c,\n            p7h ^ 0x5c5c5c5c,\n            p7l ^ 0x5c5c5c5c,\n            p8h ^ 0x5c5c5c5c,\n            p8l ^ 0x5c5c5c5c,\n            p9h ^ 0x5c5c5c5c,\n            p9l ^ 0x5c5c5c5c,\n            p10h ^ 0x5c5c5c5c,\n            p10l ^ 0x5c5c5c5c,\n            p11h ^ 0x5c5c5c5c,\n            p11l ^ 0x5c5c5c5c,\n            p12h ^ 0x5c5c5c5c,\n            p12l ^ 0x5c5c5c5c,\n            p13h ^ 0x5c5c5c5c,\n            p13l ^ 0x5c5c5c5c,\n            p14h ^ 0x5c5c5c5c,\n            p14l ^ 0x5c5c5c5c,\n            p15h ^ 0x5c5c5c5c,\n            p15l ^ 0x5c5c5c5c\n        );\n        O0h = H0h;\n        O0l = H0l;\n        O1h = H1h;\n        O1l = H1l;\n        O2h = H2h;\n        O2l = H2l;\n        O3h = H3h;\n        O3l = H3l;\n        O4h = H4h;\n        O4l = H4l;\n        O5h = H5h;\n        O5l = H5l;\n        O6h = H6h;\n        O6l = H6l;\n        O7h = H7h;\n        O7l = H7l;\n\n        // ipad\n        reset();\n        _core(\n           p0h ^ 0x36363636,\n           p0l ^ 0x36363636,\n           p1h ^ 0x36363636,\n           p1l ^ 0x36363636,\n           p2h ^ 0x36363636,\n           p2l ^ 0x36363636,\n           p3h ^ 0x36363636,\n           p3l ^ 0x36363636,\n           p4h ^ 0x36363636,\n           p4l ^ 0x36363636,\n           p5h ^ 0x36363636,\n           p5l ^ 0x36363636,\n           p6h ^ 0x36363636,\n           p6l ^ 0x36363636,\n           p7h ^ 0x36363636,\n           p7l ^ 0x36363636,\n           p8h ^ 0x36363636,\n           p8l ^ 0x36363636,\n           p9h ^ 0x36363636,\n           p9l ^ 0x36363636,\n           p10h ^ 0x36363636,\n           p10l ^ 0x36363636,\n           p11h ^ 0x36363636,\n           p11l ^ 0x36363636,\n           p12h ^ 0x36363636,\n           p12l ^ 0x36363636,\n           p13h ^ 0x36363636,\n           p13l ^ 0x36363636,\n           p14h ^ 0x36363636,\n           p14l ^ 0x36363636,\n           p15h ^ 0x36363636,\n           p15l ^ 0x36363636\n        );\n        I0h = H0h;\n        I0l = H0l;\n        I1h = H1h;\n        I1l = H1l;\n        I2h = H2h;\n        I2l = H2l;\n        I3h = H3h;\n        I3l = H3l;\n        I4h = H4h;\n        I4l = H4l;\n        I5h = H5h;\n        I5l = H5l;\n        I6h = H6h;\n        I6l = H6l;\n        I7h = H7h;\n        I7l = H7l;\n\n        TOTAL0 = 128;\n        TOTAL1 = 0;\n    }\n\n    // offset — multiple of 128\n    // output — multiple of 64\n    function hmac_finish ( offset, length, output ) {\n        offset = offset|0;\n        length = length|0;\n        output = output|0;\n\n        var t0h = 0, t0l = 0, t1h = 0, t1l = 0, t2h = 0, t2l = 0, t3h = 0, t3l = 0,\n            t4h = 0, t4l = 0, t5h = 0, t5l = 0, t6h = 0, t6l = 0, t7h = 0, t7l = 0,\n            hashed = 0;\n\n        if ( offset & 127 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 63 )\n                return -1;\n\n        hashed = finish( offset, length, -1 )|0;\n        t0h = H0h;\n        t0l = H0l;\n        t1h = H1h;\n        t1l = H1l;\n        t2h = H2h;\n        t2l = H2l;\n        t3h = H3h;\n        t3l = H3l;\n        t4h = H4h;\n        t4l = H4l;\n        t5h = H5h;\n        t5l = H5l;\n        t6h = H6h;\n        t6l = H6l;\n        t7h = H7h;\n        t7l = H7l;\n\n        _hmac_opad();\n        _core( t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536 );\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return hashed|0;\n    }\n\n    // salt is assumed to be already processed\n    // offset — multiple of 128\n    // output — multiple of 64\n    function pbkdf2_generate_block ( offset, length, block, count, output ) {\n        offset = offset|0;\n        length = length|0;\n        block = block|0;\n        count = count|0;\n        output = output|0;\n\n        var h0h = 0, h0l = 0, h1h = 0, h1l = 0, h2h = 0, h2l = 0, h3h = 0, h3l = 0,\n            h4h = 0, h4l = 0, h5h = 0, h5l = 0, h6h = 0, h6l = 0, h7h = 0, h7l = 0,\n            t0h = 0, t0l = 0, t1h = 0, t1l = 0, t2h = 0, t2l = 0, t3h = 0, t3l = 0,\n            t4h = 0, t4l = 0, t5h = 0, t5l = 0, t6h = 0, t6l = 0, t7h = 0, t7l = 0;\n\n        if ( offset & 127 )\n            return -1;\n\n        if ( ~output )\n            if ( output & 63 )\n                return -1;\n\n        // pad block number into heap\n        // FIXME probable OOB write\n        HEAP[(offset+length)|0]   = block>>>24;\n        HEAP[(offset+length+1)|0] = block>>>16&255;\n        HEAP[(offset+length+2)|0] = block>>>8&255;\n        HEAP[(offset+length+3)|0] = block&255;\n\n        // finish first iteration\n        hmac_finish( offset, (length+4)|0, -1 )|0;\n\n        h0h = t0h = H0h;\n        h0l = t0l = H0l;\n        h1h = t1h = H1h;\n        h1l = t1l = H1l;\n        h2h = t2h = H2h;\n        h2l = t2l = H2l;\n        h3h = t3h = H3h;\n        h3l = t3l = H3l;\n        h4h = t4h = H4h;\n        h4l = t4l = H4l;\n        h5h = t5h = H5h;\n        h5l = t5l = H5l;\n        h6h = t6h = H6h;\n        h6l = t6l = H6l;\n        h7h = t7h = H7h;\n        h7l = t7l = H7l;\n\n        count = (count-1)|0;\n\n        // perform the rest iterations\n        while ( (count|0) > 0 ) {\n            hmac_reset();\n            _core( t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536 );\n\n            t0h = H0h;\n            t0l = H0l;\n            t1h = H1h;\n            t1l = H1l;\n            t2h = H2h;\n            t2l = H2l;\n            t3h = H3h;\n            t3l = H3l;\n            t4h = H4h;\n            t4l = H4l;\n            t5h = H5h;\n            t5l = H5l;\n            t6h = H6h;\n            t6l = H6l;\n            t7h = H7h;\n            t7l = H7l;\n\n            _hmac_opad();\n            _core( t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 0x80000000, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536 );\n\n            t0h = H0h;\n            t0l = H0l;\n            t1h = H1h;\n            t1l = H1l;\n            t2h = H2h;\n            t2l = H2l;\n            t3h = H3h;\n            t3l = H3l;\n            t4h = H4h;\n            t4l = H4l;\n            t5h = H5h;\n            t5l = H5l;\n            t6h = H6h;\n            t6l = H6l;\n            t7h = H7h;\n            t7l = H7l;\n\n            h0h = h0h ^ H0h;\n            h0l = h0l ^ H0l;\n            h1h = h1h ^ H1h;\n            h1l = h1l ^ H1l;\n            h2h = h2h ^ H2h;\n            h2l = h2l ^ H2l;\n            h3h = h3h ^ H3h;\n            h3l = h3l ^ H3l;\n            h4h = h4h ^ H4h;\n            h4l = h4l ^ H4l;\n            h5h = h5h ^ H5h;\n            h5l = h5l ^ H5l;\n            h6h = h6h ^ H6h;\n            h6l = h6l ^ H6l;\n            h7h = h7h ^ H7h;\n            h7l = h7l ^ H7l;\n\n            count = (count-1)|0;\n        }\n\n        H0h = h0h;\n        H0l = h0l;\n        H1h = h1h;\n        H1l = h1l;\n        H2h = h2h;\n        H2l = h2l;\n        H3h = h3h;\n        H3l = h3l;\n        H4h = h4h;\n        H4l = h4l;\n        H5h = h5h;\n        H5l = h5l;\n        H6h = h6h;\n        H6l = h6l;\n        H7h = h7h;\n        H7l = h7l;\n\n        if ( ~output )\n            _state_to_heap(output);\n\n        return 0;\n    }\n\n    return {\n      // SHA512\n      reset: reset,\n      init: init,\n      process: process,\n      finish: finish,\n\n      // HMAC-SHA512\n      hmac_reset: hmac_reset,\n      hmac_init: hmac_init,\n      hmac_finish: hmac_finish,\n\n      // PBKDF2-HMAC-SHA512\n      pbkdf2_generate_block: pbkdf2_generate_block\n    }\n}\n"
  },
  {
    "path": "src/hash/sha512/sha512.ts",
    "content": "import { sha512_asm, sha512result } from './sha512.asm';\nimport { Hash } from '../hash';\nimport { _heap_init } from '../../other/utils';\n\nexport const _sha512_block_size = 128;\nexport const _sha512_hash_size = 64;\n\nexport class Sha512 extends Hash<sha512result> {\n  static NAME = 'sha512';\n  public NAME = 'sha512';\n  public BLOCK_SIZE = _sha512_block_size;\n  public HASH_SIZE = _sha512_hash_size;\n\n  constructor() {\n    super();\n\n    this.heap = _heap_init();\n    this.asm = sha512_asm({ Uint8Array: Uint8Array }, null, this.heap.buffer);\n\n    this.reset();\n  }\n}\n"
  },
  {
    "path": "src/hmac/hmac-sha1.ts",
    "content": "import { Hmac } from './hmac';\nimport { _sha1_hash_size, Sha1 } from '../hash/sha1/sha1';\nimport { IllegalStateError } from '../other/errors';\nimport { sha1result } from '../hash/sha1/sha1.asm';\nimport { Hash } from '../hash/hash';\n\nexport class HmacSha1 extends Hmac<Hash<sha1result>> {\n  public result!: Uint8Array | null;\n\n  constructor(password: Uint8Array, verify?: Uint8Array) {\n    const hash = new Sha1();\n\n    // Calculate ipad, init the underlying engine, calculate this.key\n    super(hash, password, verify);\n\n    this.reset();\n\n    if (verify !== undefined) {\n      this._hmac_init_verify(verify);\n    } else {\n      this.verify = null;\n    }\n\n    return this;\n  }\n\n  reset(): this {\n    this.result = null;\n    const key = this.key;\n    this.hash\n      .reset()\n      .asm.hmac_init(\n        (key[0] << 24) | (key[1] << 16) | (key[2] << 8) | key[3],\n        (key[4] << 24) | (key[5] << 16) | (key[6] << 8) | key[7],\n        (key[8] << 24) | (key[9] << 16) | (key[10] << 8) | key[11],\n        (key[12] << 24) | (key[13] << 16) | (key[14] << 8) | key[15],\n        (key[16] << 24) | (key[17] << 16) | (key[18] << 8) | key[19],\n        (key[20] << 24) | (key[21] << 16) | (key[22] << 8) | key[23],\n        (key[24] << 24) | (key[25] << 16) | (key[26] << 8) | key[27],\n        (key[28] << 24) | (key[29] << 16) | (key[30] << 8) | key[31],\n        (key[32] << 24) | (key[33] << 16) | (key[34] << 8) | key[35],\n        (key[36] << 24) | (key[37] << 16) | (key[38] << 8) | key[39],\n        (key[40] << 24) | (key[41] << 16) | (key[42] << 8) | key[43],\n        (key[44] << 24) | (key[45] << 16) | (key[46] << 8) | key[47],\n        (key[48] << 24) | (key[49] << 16) | (key[50] << 8) | key[51],\n        (key[52] << 24) | (key[53] << 16) | (key[54] << 8) | key[55],\n        (key[56] << 24) | (key[57] << 16) | (key[58] << 8) | key[59],\n        (key[60] << 24) | (key[61] << 16) | (key[62] << 8) | key[63],\n      );\n    return this;\n  }\n\n  finish(): this {\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    const hash = this.hash;\n    const asm = this.hash.asm;\n    const heap = this.hash.heap;\n\n    asm.hmac_finish(hash.pos, hash.len, 0);\n\n    const verify = this.verify;\n    const result = new Uint8Array(_sha1_hash_size);\n    result.set(heap.subarray(0, _sha1_hash_size));\n\n    if (verify) {\n      if (verify.length === result.length) {\n        let diff = 0;\n        for (let i = 0; i < verify.length; i++) {\n          diff |= verify[i] ^ result[i];\n        }\n        if (diff !== 0) throw new Error(\"HMAC verification failed, hash value doesn't match\");\n      } else {\n        throw new Error(\"HMAC verification failed, lengths doesn't match\");\n      }\n    } else {\n      this.result = result;\n    }\n\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/hmac/hmac-sha256.ts",
    "content": "import { Hmac } from './hmac';\nimport { IllegalStateError } from '../other/errors';\nimport { _sha256_hash_size, Sha256 } from '../hash/sha256/sha256';\nimport { sha256result } from '../hash/sha256/sha256.asm';\nimport { Hash } from '../hash/hash';\n\nexport class HmacSha256 extends Hmac<Hash<sha256result>> {\n  public result!: Uint8Array | null;\n\n  constructor(password: Uint8Array, verify?: Uint8Array) {\n    const hash = new Sha256();\n\n    // Calculate ipad, init the underlying engine, calculate this.key\n    super(hash, password, verify);\n\n    this.reset();\n\n    if (verify !== undefined) {\n      this._hmac_init_verify(verify);\n    } else {\n      this.verify = null;\n    }\n\n    return this;\n  }\n\n  reset(): this {\n    const key = this.key;\n\n    this.hash\n      .reset()\n      .asm.hmac_init(\n        (key[0] << 24) | (key[1] << 16) | (key[2] << 8) | key[3],\n        (key[4] << 24) | (key[5] << 16) | (key[6] << 8) | key[7],\n        (key[8] << 24) | (key[9] << 16) | (key[10] << 8) | key[11],\n        (key[12] << 24) | (key[13] << 16) | (key[14] << 8) | key[15],\n        (key[16] << 24) | (key[17] << 16) | (key[18] << 8) | key[19],\n        (key[20] << 24) | (key[21] << 16) | (key[22] << 8) | key[23],\n        (key[24] << 24) | (key[25] << 16) | (key[26] << 8) | key[27],\n        (key[28] << 24) | (key[29] << 16) | (key[30] << 8) | key[31],\n        (key[32] << 24) | (key[33] << 16) | (key[34] << 8) | key[35],\n        (key[36] << 24) | (key[37] << 16) | (key[38] << 8) | key[39],\n        (key[40] << 24) | (key[41] << 16) | (key[42] << 8) | key[43],\n        (key[44] << 24) | (key[45] << 16) | (key[46] << 8) | key[47],\n        (key[48] << 24) | (key[49] << 16) | (key[50] << 8) | key[51],\n        (key[52] << 24) | (key[53] << 16) | (key[54] << 8) | key[55],\n        (key[56] << 24) | (key[57] << 16) | (key[58] << 8) | key[59],\n        (key[60] << 24) | (key[61] << 16) | (key[62] << 8) | key[63],\n      );\n\n    return this;\n  }\n\n  finish(): this {\n    if (this.key === null) throw new IllegalStateError('no key is associated with the instance');\n\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    const hash = this.hash;\n    const asm = this.hash.asm;\n    const heap = this.hash.heap;\n\n    asm.hmac_finish(hash.pos, hash.len, 0);\n\n    const verify = this.verify;\n    const result = new Uint8Array(_sha256_hash_size);\n    result.set(heap.subarray(0, _sha256_hash_size));\n\n    if (verify) {\n      if (verify.length === result.length) {\n        let diff = 0;\n        for (let i = 0; i < verify.length; i++) {\n          diff |= verify[i] ^ result[i];\n        }\n        if (diff !== 0) throw new Error(\"HMAC verification failed, hash value doesn't match\");\n      } else {\n        throw new Error(\"HMAC verification failed, lengths doesn't match\");\n      }\n    } else {\n      this.result = result;\n    }\n\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/hmac/hmac-sha512.ts",
    "content": "import { Hmac } from './hmac';\nimport { IllegalStateError } from '../other/errors';\nimport { _sha512_hash_size, Sha512 } from '../hash/sha512/sha512';\nimport { Hash } from '../hash/hash';\nimport { sha512result } from '../hash/sha512/sha512.asm';\n\nexport class HmacSha512 extends Hmac<Hash<sha512result>> {\n  public result!: Uint8Array | null;\n\n  constructor(password: Uint8Array, verify?: Uint8Array) {\n    const hash = new Sha512();\n\n    // Calculate ipad, init the underlying engine, calculate this.key\n    super(hash, password, verify);\n\n    this.reset();\n\n    if (verify !== undefined) {\n      this._hmac_init_verify(verify);\n    } else {\n      this.verify = null;\n    }\n\n    return this;\n  }\n\n  reset(): this {\n    const key = this.key;\n    this.hash\n      .reset()\n      .asm.hmac_init(\n        (key[0] << 24) | (key[1] << 16) | (key[2] << 8) | key[3],\n        (key[4] << 24) | (key[5] << 16) | (key[6] << 8) | key[7],\n        (key[8] << 24) | (key[9] << 16) | (key[10] << 8) | key[11],\n        (key[12] << 24) | (key[13] << 16) | (key[14] << 8) | key[15],\n        (key[16] << 24) | (key[17] << 16) | (key[18] << 8) | key[19],\n        (key[20] << 24) | (key[21] << 16) | (key[22] << 8) | key[23],\n        (key[24] << 24) | (key[25] << 16) | (key[26] << 8) | key[27],\n        (key[28] << 24) | (key[29] << 16) | (key[30] << 8) | key[31],\n        (key[32] << 24) | (key[33] << 16) | (key[34] << 8) | key[35],\n        (key[36] << 24) | (key[37] << 16) | (key[38] << 8) | key[39],\n        (key[40] << 24) | (key[41] << 16) | (key[42] << 8) | key[43],\n        (key[44] << 24) | (key[45] << 16) | (key[46] << 8) | key[47],\n        (key[48] << 24) | (key[49] << 16) | (key[50] << 8) | key[51],\n        (key[52] << 24) | (key[53] << 16) | (key[54] << 8) | key[55],\n        (key[56] << 24) | (key[57] << 16) | (key[58] << 8) | key[59],\n        (key[60] << 24) | (key[61] << 16) | (key[62] << 8) | key[63],\n        (key[64] << 24) | (key[65] << 16) | (key[66] << 8) | key[67],\n        (key[68] << 24) | (key[69] << 16) | (key[70] << 8) | key[71],\n        (key[72] << 24) | (key[73] << 16) | (key[74] << 8) | key[75],\n        (key[76] << 24) | (key[77] << 16) | (key[78] << 8) | key[79],\n        (key[80] << 24) | (key[81] << 16) | (key[82] << 8) | key[83],\n        (key[84] << 24) | (key[85] << 16) | (key[86] << 8) | key[87],\n        (key[88] << 24) | (key[89] << 16) | (key[90] << 8) | key[91],\n        (key[92] << 24) | (key[93] << 16) | (key[94] << 8) | key[95],\n        (key[96] << 24) | (key[97] << 16) | (key[98] << 8) | key[99],\n        (key[100] << 24) | (key[101] << 16) | (key[102] << 8) | key[103],\n        (key[104] << 24) | (key[105] << 16) | (key[106] << 8) | key[107],\n        (key[108] << 24) | (key[109] << 16) | (key[110] << 8) | key[111],\n        (key[112] << 24) | (key[113] << 16) | (key[114] << 8) | key[115],\n        (key[116] << 24) | (key[117] << 16) | (key[118] << 8) | key[119],\n        (key[120] << 24) | (key[121] << 16) | (key[122] << 8) | key[123],\n        (key[124] << 24) | (key[125] << 16) | (key[126] << 8) | key[127],\n      );\n    return this;\n  }\n\n  finish() {\n    if (this.key === null) throw new IllegalStateError('no key is associated with the instance');\n\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    const hash = this.hash;\n    const asm = this.hash.asm;\n    const heap = this.hash.heap;\n\n    asm.hmac_finish(hash.pos, hash.len, 0);\n\n    const verify = this.verify;\n    const result = new Uint8Array(_sha512_hash_size);\n    result.set(heap.subarray(0, _sha512_hash_size));\n\n    if (verify) {\n      if (verify.length === result.length) {\n        let diff = 0;\n        for (let i = 0; i < verify.length; i++) {\n          diff |= verify[i] ^ result[i];\n        }\n        if (diff !== 0) throw new Error(\"HMAC verification failed, hash value doesn't match\");\n      } else {\n        throw new Error(\"HMAC verification failed, lengths doesn't match\");\n      }\n    } else {\n      this.result = result;\n    }\n\n    return this;\n  }\n}\n"
  },
  {
    "path": "src/hmac/hmac.ts",
    "content": "import { IllegalArgumentError, IllegalStateError } from '../other/errors';\nimport { Hash } from '../hash/hash';\nimport { sha1result } from '../hash/sha1/sha1.asm';\nimport { sha256result } from '../hash/sha256/sha256.asm';\nimport { sha512result } from '../hash/sha512/sha512.asm';\n\nexport abstract class Hmac<T extends Hash<sha1result> | Hash<sha256result> | Hash<sha512result>> {\n  public hash: T;\n  protected BLOCK_SIZE: number;\n  public HMAC_SIZE: number;\n  protected key: Uint8Array;\n  protected verify!: Uint8Array | null;\n  public result!: Uint8Array | null;\n\n  protected constructor(hash: T, password: Uint8Array, verify?: Uint8Array) {\n    if (!hash.HASH_SIZE) throw new SyntaxError(\"option 'hash' supplied doesn't seem to be a valid hash function\");\n\n    this.hash = hash;\n    this.BLOCK_SIZE = this.hash.BLOCK_SIZE;\n    this.HMAC_SIZE = this.hash.HASH_SIZE;\n\n    this.result = null;\n\n    this.key = _hmac_key(this.hash, password);\n\n    const ipad = new Uint8Array(this.key);\n    for (let i = 0; i < ipad.length; ++i) ipad[i] ^= 0x36;\n\n    this.hash.reset().process(ipad);\n\n    if (verify !== undefined) {\n      this._hmac_init_verify(verify);\n    } else {\n      this.verify = null;\n    }\n  }\n\n  process(data: Uint8Array): this {\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    this.hash.process(data);\n\n    return this;\n  }\n\n  finish(): this {\n    if (this.result !== null) throw new IllegalStateError('state must be reset before processing new data');\n\n    const inner_result = this.hash.finish().result as Uint8Array;\n\n    const opad = new Uint8Array(this.key);\n    for (let i = 0; i < opad.length; ++i) opad[i] ^= 0x5c;\n\n    const verify = this.verify;\n    const result = this.hash\n      .reset()\n      .process(opad)\n      .process(inner_result)\n      .finish().result as Uint8Array;\n\n    if (verify) {\n      if (verify.length === result.length) {\n        let diff = 0;\n        for (let i = 0; i < verify.length; i++) {\n          diff |= verify[i] ^ result[i];\n        }\n        if (diff !== 0) throw new Error(\"HMAC verification failed, hash value doesn't match\");\n      } else {\n        throw new Error(\"HMAC verification failed, lengths doesn't match\");\n      }\n    }\n\n    this.result = result;\n\n    return this;\n  }\n\n  _hmac_init_verify(verify: Uint8Array): void {\n    if (verify.length !== this.HMAC_SIZE) throw new IllegalArgumentError('illegal verification tag size');\n\n    this.verify = verify;\n  }\n}\n\nexport function _hmac_key(hash: Hash<sha1result | sha256result | sha512result>, password: Uint8Array): Uint8Array {\n  const key = new Uint8Array(hash.BLOCK_SIZE);\n\n  if (password.length > hash.BLOCK_SIZE) {\n    key.set(hash\n      .reset()\n      .process(password)\n      .finish().result as Uint8Array);\n  } else {\n    key.set(password);\n  }\n\n  return key;\n}\n"
  },
  {
    "path": "src/other/errors.ts",
    "content": "export class IllegalStateError extends Error {\n  constructor(...args: any[]) {\n    super(...args);\n    Object.create(Error.prototype, { name: { value: 'IllegalStateError' } });\n  }\n}\n\nexport class IllegalArgumentError extends Error {\n  constructor(...args: any[]) {\n    super(...args);\n    Object.create(Error.prototype, { name: { value: 'IllegalArgumentError' } });\n  }\n}\n\nexport class SecurityError extends Error {\n  constructor(...args: any[]) {\n    super(...args);\n    Object.create(Error.prototype, { name: { value: 'SecurityError' } });\n  }\n}\n"
  },
  {
    "path": "src/other/exportedUtils.ts",
    "content": "/**\n * Util exports\n */\n\nexport {\n  string_to_bytes,\n  hex_to_bytes,\n  base64_to_bytes,\n  bytes_to_string,\n  bytes_to_hex,\n  bytes_to_base64,\n} from './utils';\n"
  },
  {
    "path": "src/other/get-random-values.ts",
    "content": "export function getRandomValues(buf: Uint32Array | Uint8Array): void {\n  if (typeof process !== 'undefined') {\n    const nodeCrypto = require('crypto');\n    const bytes = nodeCrypto.randomBytes(buf.length);\n    buf.set(bytes);\n    return;\n  }\n  if (window.crypto && window.crypto.getRandomValues) {\n    window.crypto.getRandomValues(buf);\n    return;\n  }\n  if (self.crypto && self.crypto.getRandomValues) {\n    self.crypto.getRandomValues(buf);\n    return;\n  }\n  // @ts-ignore\n  if (window.msCrypto && window.msCrypto.getRandomValues) {\n    // @ts-ignore\n    window.msCrypto.getRandomValues(buf);\n    return;\n  }\n  throw new Error('No secure random number generator available.');\n}\n"
  },
  {
    "path": "src/other/utils.ts",
    "content": "const local_atob = typeof atob === 'undefined' ? (str: string) => Buffer.from(str, 'base64').toString('binary') : atob;\nconst local_btoa = typeof btoa === 'undefined' ? (str: string) => Buffer.from(str, 'binary').toString('base64') : btoa;\n\nexport function string_to_bytes(str: string, utf8: boolean = false): Uint8Array {\n  var len = str.length,\n    bytes = new Uint8Array(utf8 ? 4 * len : len);\n\n  for (var i = 0, j = 0; i < len; i++) {\n    var c = str.charCodeAt(i);\n\n    if (utf8 && 0xd800 <= c && c <= 0xdbff) {\n      if (++i >= len) throw new Error('Malformed string, low surrogate expected at position ' + i);\n      c = ((c ^ 0xd800) << 10) | 0x10000 | (str.charCodeAt(i) ^ 0xdc00);\n    } else if (!utf8 && c >>> 8) {\n      throw new Error('Wide characters are not allowed.');\n    }\n\n    if (!utf8 || c <= 0x7f) {\n      bytes[j++] = c;\n    } else if (c <= 0x7ff) {\n      bytes[j++] = 0xc0 | (c >> 6);\n      bytes[j++] = 0x80 | (c & 0x3f);\n    } else if (c <= 0xffff) {\n      bytes[j++] = 0xe0 | (c >> 12);\n      bytes[j++] = 0x80 | ((c >> 6) & 0x3f);\n      bytes[j++] = 0x80 | (c & 0x3f);\n    } else {\n      bytes[j++] = 0xf0 | (c >> 18);\n      bytes[j++] = 0x80 | ((c >> 12) & 0x3f);\n      bytes[j++] = 0x80 | ((c >> 6) & 0x3f);\n      bytes[j++] = 0x80 | (c & 0x3f);\n    }\n  }\n\n  return bytes.subarray(0, j);\n}\n\nexport function hex_to_bytes(str: string): Uint8Array {\n  var len = str.length;\n  if (len & 1) {\n    str = '0' + str;\n    len++;\n  }\n  var bytes = new Uint8Array(len >> 1);\n  for (var i = 0; i < len; i += 2) {\n    bytes[i >> 1] = parseInt(str.substr(i, 2), 16);\n  }\n  return bytes;\n}\n\nexport function base64_to_bytes(str: string): Uint8Array {\n  return string_to_bytes(local_atob(str));\n}\n\nexport function bytes_to_string(bytes: Uint8Array, utf8: boolean = false): string {\n  var len = bytes.length,\n    chars = new Array(len);\n\n  for (var i = 0, j = 0; i < len; i++) {\n    var b = bytes[i];\n    if (!utf8 || b < 128) {\n      chars[j++] = b;\n    } else if (b >= 192 && b < 224 && i + 1 < len) {\n      chars[j++] = ((b & 0x1f) << 6) | (bytes[++i] & 0x3f);\n    } else if (b >= 224 && b < 240 && i + 2 < len) {\n      chars[j++] = ((b & 0xf) << 12) | ((bytes[++i] & 0x3f) << 6) | (bytes[++i] & 0x3f);\n    } else if (b >= 240 && b < 248 && i + 3 < len) {\n      var c = ((b & 7) << 18) | ((bytes[++i] & 0x3f) << 12) | ((bytes[++i] & 0x3f) << 6) | (bytes[++i] & 0x3f);\n      if (c <= 0xffff) {\n        chars[j++] = c;\n      } else {\n        c ^= 0x10000;\n        chars[j++] = 0xd800 | (c >> 10);\n        chars[j++] = 0xdc00 | (c & 0x3ff);\n      }\n    } else {\n      throw new Error('Malformed UTF8 character at byte offset ' + i);\n    }\n  }\n\n  var str = '',\n    bs = 16384;\n  for (var i = 0; i < j; i += bs) {\n    str += String.fromCharCode.apply(String, chars.slice(i, i + bs <= j ? i + bs : j));\n  }\n\n  return str;\n}\n\nexport function bytes_to_hex(arr: Uint8Array): string {\n  var str = '';\n  for (var i = 0; i < arr.length; i++) {\n    var h = (arr[i] & 0xff).toString(16);\n    if (h.length < 2) str += '0';\n    str += h;\n  }\n  return str;\n}\n\nexport function bytes_to_base64(arr: Uint8Array): string {\n  return local_btoa(bytes_to_string(arr));\n}\n\nexport function pow2_ceil(a: number): number {\n  a -= 1;\n  a |= a >>> 1;\n  a |= a >>> 2;\n  a |= a >>> 4;\n  a |= a >>> 8;\n  a |= a >>> 16;\n  a += 1;\n  return a;\n}\n\nexport function is_number(a: number): boolean {\n  return typeof a === 'number';\n}\n\nexport function is_string(a: string): boolean {\n  return typeof a === 'string';\n}\n\nexport function is_buffer(a: ArrayBuffer): boolean {\n  return a instanceof ArrayBuffer;\n}\n\nexport function is_bytes(a: Uint8Array): boolean {\n  return a instanceof Uint8Array;\n}\n\nexport function is_typed_array(a: any): boolean {\n  return (\n    a instanceof Int8Array ||\n    a instanceof Uint8Array ||\n    a instanceof Int16Array ||\n    a instanceof Uint16Array ||\n    a instanceof Int32Array ||\n    a instanceof Uint32Array ||\n    a instanceof Float32Array ||\n    a instanceof Float64Array\n  );\n}\n\nexport function _heap_init(heap?: Uint8Array, heapSize?: number): Uint8Array {\n  const size = heap ? heap.byteLength : heapSize || 65536;\n\n  if (size & 0xfff || size <= 0) throw new Error('heap size must be a positive integer and a multiple of 4096');\n\n  heap = heap || new Uint8Array(new ArrayBuffer(size));\n\n  return heap;\n}\n\nexport function _heap_write(heap: Uint8Array, hpos: number, data: Uint8Array, dpos: number, dlen: number): number {\n  const hlen = heap.length - hpos;\n  const wlen = hlen < dlen ? hlen : dlen;\n\n  heap.set(data.subarray(dpos, dpos + wlen), hpos);\n\n  return wlen;\n}\n\nexport function joinBytes(...arg: Uint8Array[]): Uint8Array {\n  const totalLenght = arg.reduce((sum, curr) => sum + curr.length, 0);\n  const ret = new Uint8Array(totalLenght);\n\n  let cursor = 0;\n  for (let i = 0; i < arg.length; i++) {\n    ret.set(arg[i], cursor);\n    cursor += arg[i].length;\n  }\n  return ret;\n}\n"
  },
  {
    "path": "src/pbkdf2/pbkdf2-core.ts",
    "content": "import { HmacSha1 } from \"../hmac/hmac-sha1\";\nimport { HmacSha256 } from \"../hmac/hmac-sha256\";\nimport { HmacSha512 } from \"../hmac/hmac-sha512\";\n\nexport function pbkdf2core(hmac: HmacSha1 | HmacSha256 | HmacSha512, salt: Uint8Array, length: number, count: number): Uint8Array {\n  const result = new Uint8Array(length);\n\n  const blocks = Math.ceil(length / hmac.HMAC_SIZE);\n\n  for (let i = 1; i <= blocks; ++i) {\n    const j = (i - 1) * hmac.HMAC_SIZE;\n    const l = (i < blocks ? 0 : length % hmac.HMAC_SIZE) || hmac.HMAC_SIZE;\n\n    hmac.reset().process(salt);\n    hmac.hash.asm.pbkdf2_generate_block(hmac.hash.pos, hmac.hash.len, i, count, 0);\n\n    result.set(hmac.hash.heap.subarray(0, l), j);\n  }\n\n  return result;\n}\n"
  },
  {
    "path": "src/pbkdf2/pbkdf2-hmac-sha1.ts",
    "content": "import { HmacSha1 } from '../hmac/hmac-sha1';\nimport { pbkdf2core } from './pbkdf2-core';\n\nexport function Pbkdf2HmacSha1(password: Uint8Array, salt: Uint8Array, count: number, length: number): Uint8Array {\n  const hmac = new HmacSha1(password);\n\n  return pbkdf2core(hmac, salt, length, count);\n}\n"
  },
  {
    "path": "src/pbkdf2/pbkdf2-hmac-sha256.ts",
    "content": "import { HmacSha256 } from '../hmac/hmac-sha256';\nimport { pbkdf2core } from './pbkdf2-core';\n\nexport function Pbkdf2HmacSha256(password: Uint8Array, salt: Uint8Array, count: number, length: number): Uint8Array {\n  const hmac = new HmacSha256(password);\n\n  return pbkdf2core(hmac, salt, length, count);\n}\n"
  },
  {
    "path": "src/pbkdf2/pbkdf2-hmac-sha512.ts",
    "content": "import { HmacSha512 } from '../hmac/hmac-sha512';\nimport { pbkdf2core } from './pbkdf2-core';\n\nexport function Pbkdf2HmacSha512(password: Uint8Array, salt: Uint8Array, count: number, length: number): Uint8Array {\n  const hmac = new HmacSha512(password);\n\n  return pbkdf2core(hmac, salt, length, count);\n}\n"
  },
  {
    "path": "src/rsa/pkcs1.ts",
    "content": "import { RSA } from './rsa';\nimport { IllegalArgumentError, IllegalStateError, SecurityError } from '../other/errors';\nimport { Sha512 } from '../hash/sha512/sha512';\nimport { Sha1 } from '../hash/sha1/sha1';\nimport { Sha256 } from '../hash/sha256/sha256';\nimport { BigNumber } from '../bignum/bignum';\nimport { getRandomValues } from '../other/get-random-values';\n\nexport class RSA_OAEP {\n  private readonly rsa: RSA;\n  private readonly label: Uint8Array | null;\n  private readonly hash: Sha1 | Sha256 | Sha512;\n\n  constructor(key: Uint8Array[], hash: Sha1 | Sha256 | Sha512, label?: Uint8Array) {\n    this.rsa = new RSA(key);\n\n    this.hash = hash;\n\n    if (label !== undefined) {\n      this.label = label.length > 0 ? label : null;\n    } else {\n      this.label = null;\n    }\n  }\n\n  encrypt(data: Uint8Array, random?: Uint8Array): Uint8Array {\n    const key_size = Math.ceil(this.rsa.key[0].bitLength / 8);\n    const hash_size = this.hash.HASH_SIZE;\n    const data_length = data.byteLength || data.length || 0;\n    const ps_length = key_size - data_length - 2 * hash_size - 2;\n\n    if (data_length > key_size - 2 * this.hash.HASH_SIZE - 2) throw new IllegalArgumentError('data too large');\n\n    const message = new Uint8Array(key_size);\n    const seed = message.subarray(1, hash_size + 1);\n    const data_block = message.subarray(hash_size + 1);\n\n    data_block.set(data, hash_size + ps_length + 1);\n\n    data_block.set(this.hash.process(this.label || new Uint8Array(0)).finish().result as Uint8Array, 0);\n    data_block[hash_size + ps_length] = 1;\n\n    if (random !== undefined) {\n      if (seed.length !== random.length) throw new IllegalArgumentError('random size must equal the hash size');\n      seed.set(random);\n    } else {\n      getRandomValues(seed);\n    }\n\n    const data_block_mask = this.RSA_MGF1_generate(seed, data_block.length);\n    for (let i = 0; i < data_block.length; i++) data_block[i] ^= data_block_mask[i];\n\n    const seed_mask = this.RSA_MGF1_generate(data_block, seed.length);\n    for (let i = 0; i < seed.length; i++) seed[i] ^= seed_mask[i];\n\n    this.rsa.encrypt(new BigNumber(message));\n\n    return new Uint8Array(this.rsa.result);\n  }\n\n  decrypt(data: Uint8Array): Uint8Array {\n    if (!this.rsa.key) throw new IllegalStateError('no key is associated with the instance');\n\n    const key_size = Math.ceil(this.rsa.key[0].bitLength / 8);\n    const hash_size = this.hash.HASH_SIZE;\n    const data_length = data.byteLength || data.length || 0;\n\n    if (data_length !== key_size) throw new IllegalArgumentError('bad data');\n\n    this.rsa.decrypt(new BigNumber(data));\n\n    const z = this.rsa.result[0];\n    const seed = this.rsa.result.subarray(1, hash_size + 1);\n    const data_block = this.rsa.result.subarray(hash_size + 1);\n\n    if (z !== 0) throw new SecurityError('decryption failed');\n\n    const seed_mask = this.RSA_MGF1_generate(data_block, seed.length);\n    for (let i = 0; i < seed.length; i++) seed[i] ^= seed_mask[i];\n\n    const data_block_mask = this.RSA_MGF1_generate(seed, data_block.length);\n    for (let i = 0; i < data_block.length; i++) data_block[i] ^= data_block_mask[i];\n\n    const lhash = this.hash\n      .reset()\n      .process(this.label || new Uint8Array(0))\n      .finish().result as Uint8Array;\n    for (let i = 0; i < hash_size; i++) {\n      if (lhash[i] !== data_block[i]) throw new SecurityError('decryption failed');\n    }\n\n    let ps_end = hash_size;\n    for (; ps_end < data_block.length; ps_end++) {\n      const psz = data_block[ps_end];\n      if (psz === 1) break;\n      if (psz !== 0) throw new SecurityError('decryption failed');\n    }\n    if (ps_end === data_block.length) throw new SecurityError('decryption failed');\n\n    this.rsa.result = data_block.subarray(ps_end + 1);\n\n    return new Uint8Array(this.rsa.result);\n  }\n\n  RSA_MGF1_generate(seed: Uint8Array, length: number = 0): Uint8Array {\n    const hash_size = this.hash.HASH_SIZE;\n    //    if ( length > (hash_size * 0x100000000) )\n    //        throw new IllegalArgumentError(\"mask length too large\");\n\n    const mask = new Uint8Array(length);\n    const counter = new Uint8Array(4);\n    const chunks = Math.ceil(length / hash_size);\n    for (let i = 0; i < chunks; i++) {\n      (counter[0] = i >>> 24), (counter[1] = (i >>> 16) & 255), (counter[2] = (i >>> 8) & 255), (counter[3] = i & 255);\n\n      const submask = mask.subarray(i * hash_size);\n\n      let chunk = this.hash\n        .reset()\n        .process(seed)\n        .process(counter)\n        .finish().result as Uint8Array;\n      if (chunk.length > submask.length) chunk = chunk.subarray(0, submask.length);\n\n      submask.set(chunk);\n    }\n\n    return mask;\n  }\n}\n\nexport class RSA_PSS {\n  private readonly rsa: RSA;\n  private readonly saltLength: number;\n  private readonly hash: Sha1 | Sha256 | Sha512;\n\n  constructor(key: Uint8Array[], hash: Sha1 | Sha256 | Sha512, saltLength: number = 4) {\n    this.rsa = new RSA(key);\n\n    this.hash = hash;\n    this.saltLength = saltLength;\n\n    if (this.saltLength < 0) throw new TypeError('saltLength should be a non-negative number');\n\n    if (\n      this.rsa.key !== null &&\n      Math.ceil((this.rsa.key[0].bitLength - 1) / 8) < this.hash.HASH_SIZE + this.saltLength + 2\n    )\n      throw new SyntaxError('saltLength is too large');\n  }\n\n  sign(data: Uint8Array, random?: Uint8Array): Uint8Array {\n    const key_bits = this.rsa.key[0].bitLength;\n    const hash_size = this.hash.HASH_SIZE;\n    const message_length = Math.ceil((key_bits - 1) / 8);\n    const salt_length = this.saltLength;\n    const ps_length = message_length - salt_length - hash_size - 2;\n\n    const message = new Uint8Array(message_length);\n    const h_block = message.subarray(message_length - hash_size - 1, message_length - 1);\n    const d_block = message.subarray(0, message_length - hash_size - 1);\n    const d_salt = d_block.subarray(ps_length + 1);\n\n    const m_block = new Uint8Array(8 + hash_size + salt_length);\n    const m_hash = m_block.subarray(8, 8 + hash_size);\n    const m_salt = m_block.subarray(8 + hash_size);\n\n    m_hash.set(this.hash.process(data).finish().result as Uint8Array);\n\n    if (salt_length > 0) {\n      if (random !== undefined) {\n        if (m_salt.length !== random.length) throw new IllegalArgumentError('random size must equal the salt size');\n        m_salt.set(random);\n      } else {\n        getRandomValues(m_salt);\n      }\n    }\n\n    d_block[ps_length] = 1;\n    d_salt.set(m_salt);\n\n    h_block.set(this.hash\n      .reset()\n      .process(m_block)\n      .finish().result as Uint8Array);\n\n    const d_block_mask = this.RSA_MGF1_generate(h_block, d_block.length);\n    for (let i = 0; i < d_block.length; i++) d_block[i] ^= d_block_mask[i];\n\n    message[message_length - 1] = 0xbc;\n\n    const zbits = 8 * message_length - key_bits + 1;\n    if (zbits % 8) message[0] &= 0xff >>> zbits;\n\n    this.rsa.decrypt(new BigNumber(message));\n\n    return this.rsa.result;\n  }\n\n  verify(signature: Uint8Array, data: Uint8Array): void {\n    const key_bits = this.rsa.key[0].bitLength;\n    const hash_size = this.hash.HASH_SIZE;\n    const message_length = Math.ceil((key_bits - 1) / 8);\n    const salt_length = this.saltLength;\n    const ps_length = message_length - salt_length - hash_size - 2;\n\n    this.rsa.encrypt(new BigNumber(signature));\n\n    const message = this.rsa.result;\n    if (message[message_length - 1] !== 0xbc) throw new SecurityError('bad signature');\n\n    const h_block = message.subarray(message_length - hash_size - 1, message_length - 1);\n    const d_block = message.subarray(0, message_length - hash_size - 1);\n    const d_salt = d_block.subarray(ps_length + 1);\n\n    const zbits = 8 * message_length - key_bits + 1;\n    if (zbits % 8 && message[0] >>> (8 - zbits)) throw new SecurityError('bad signature');\n\n    const d_block_mask = this.RSA_MGF1_generate(h_block, d_block.length);\n    for (let i = 0; i < d_block.length; i++) d_block[i] ^= d_block_mask[i];\n\n    if (zbits % 8) message[0] &= 0xff >>> zbits;\n\n    for (let i = 0; i < ps_length; i++) {\n      if (d_block[i] !== 0) throw new SecurityError('bad signature');\n    }\n    if (d_block[ps_length] !== 1) throw new SecurityError('bad signature');\n\n    const m_block = new Uint8Array(8 + hash_size + salt_length);\n    const m_hash = m_block.subarray(8, 8 + hash_size);\n    const m_salt = m_block.subarray(8 + hash_size);\n\n    m_hash.set(this.hash\n      .reset()\n      .process(data)\n      .finish().result as Uint8Array);\n    m_salt.set(d_salt);\n\n    const h_block_verify = this.hash\n      .reset()\n      .process(m_block)\n      .finish().result as Uint8Array;\n    for (let i = 0; i < hash_size; i++) {\n      if (h_block[i] !== h_block_verify[i]) throw new SecurityError('bad signature');\n    }\n  }\n\n  RSA_MGF1_generate(seed: Uint8Array, length: number = 0): Uint8Array {\n    const hash_size = this.hash.HASH_SIZE;\n    //    if ( length > (hash_size * 0x100000000) )\n    //        throw new IllegalArgumentError(\"mask length too large\");\n\n    const mask = new Uint8Array(length);\n    const counter = new Uint8Array(4);\n    const chunks = Math.ceil(length / hash_size);\n    for (let i = 0; i < chunks; i++) {\n      (counter[0] = i >>> 24), (counter[1] = (i >>> 16) & 255), (counter[2] = (i >>> 8) & 255), (counter[3] = i & 255);\n\n      const submask = mask.subarray(i * hash_size);\n\n      let chunk = this.hash\n        .reset()\n        .process(seed)\n        .process(counter)\n        .finish().result as Uint8Array;\n      if (chunk.length > submask.length) chunk = chunk.subarray(0, submask.length);\n\n      submask.set(chunk);\n    }\n\n    return mask;\n  }\n}\n\nexport class RSA_PKCS1_v1_5 {\n  private readonly rsa: RSA;\n  private readonly hash: Sha1 | Sha256 | Sha512;\n  constructor(key: Uint8Array[], hash: Sha1 | Sha256 | Sha512) {\n    this.rsa = new RSA(key);\n    this.hash = hash;\n  }\n\n  sign(data: Uint8Array): Uint8Array {\n    if (!this.rsa.key) {\n      throw new IllegalStateError('no key is associated with the instance');\n    }\n    const prefix = getHashPrefix(this.hash);\n    const hash_size = this.hash.HASH_SIZE;\n\n    const t_len = prefix.length + hash_size;\n    const k = (this.rsa.key[0].bitLength + 7) >> 3;\n    if (k < t_len + 11) {\n      throw new Error('Message too long');\n    }\n\n    const m_hash = new Uint8Array(hash_size);\n    m_hash.set(this.hash.process(data).finish().result as Uint8Array);\n\n    // EM = 0x00 || 0x01 || PS || 0x00 || T\n    const em = new Uint8Array(k);\n    let i = 0;\n    em[i++] = 0; // 0x00\n    em[i++] = 1; // 0x01\n    // PS\n    for (i; i < k - t_len - 1; i++) {\n      em[i] = 0xff;\n    }\n    em[i++] = 0;\n    em.set(prefix, i); // 0x00\n    // T\n    em.set(m_hash, em.length - hash_size);\n\n    this.rsa.decrypt(new BigNumber(em));\n\n    return this.rsa.result;\n  }\n\n  verify(signature: Uint8Array, data: Uint8Array): void {\n    const prefix = getHashPrefix(this.hash);\n    const hash_size = this.hash.HASH_SIZE;\n\n    const t_len = prefix.length + hash_size;\n    const k = (this.rsa.key[0].bitLength + 7) >> 3;\n    if (k < t_len + 11) {\n      throw new SecurityError('Bad signature');\n    }\n\n    this.rsa.encrypt(new BigNumber(signature));\n\n    const m_hash = new Uint8Array(hash_size);\n    m_hash.set(this.hash.process(data).finish().result as Uint8Array);\n\n    let res = 1;\n    // EM = 0x00 || 0x01 || PS || 0x00 || T\n    const decryptedSignature = this.rsa.result;\n    let i = 0;\n    res &= decryptedSignature[i++] === 0 ? 1 : 0; // 0x00\n    res &= decryptedSignature[i++] === 1 ? 1 : 0; // 0x01\n    // PS\n    for (i; i < k - t_len - 1; i++) {\n      res &= decryptedSignature[i] === 0xff ? 1 : 0;\n    }\n    res &= decryptedSignature[i++] === 0 ? 1 : 0; // 0x00\n    // T\n    let j = 0;\n    let n = i + prefix.length;\n    // prefix\n    for (i; i < n; i++) {\n      res &= decryptedSignature[i] === prefix[j++] ? 1 : 0;\n    }\n    j = 0;\n    n = i + m_hash.length;\n    // hash\n    for (i; i < n; i++) {\n      res &= decryptedSignature[i] === m_hash[j++] ? 1 : 0;\n    }\n\n    if (!res) {\n      throw new SecurityError('Bad signature');\n    }\n  }\n}\n\nconst HASH_PREFIXES: {\n  sha1: Uint8Array;\n  sha256: Uint8Array;\n  sha384: Uint8Array;\n  sha512: Uint8Array;\n  [key: string]: Uint8Array;\n} = {\n  sha1: new Uint8Array([0x30, 0x21, 0x30, 0x09, 0x06, 0x05, 0x2b, 0x0e, 0x03, 0x02, 0x1a, 0x05, 0x00, 0x04, 0x14]),\n  sha256: new Uint8Array([\n    0x30,\n    0x31,\n    0x30,\n    0x0d,\n    0x06,\n    0x09,\n    0x60,\n    0x86,\n    0x48,\n    0x01,\n    0x65,\n    0x03,\n    0x04,\n    0x02,\n    0x01,\n    0x05,\n    0x00,\n    0x04,\n    0x20,\n  ]),\n  sha384: new Uint8Array([\n    0x30,\n    0x41,\n    0x30,\n    0x0d,\n    0x06,\n    0x09,\n    0x60,\n    0x86,\n    0x48,\n    0x01,\n    0x65,\n    0x03,\n    0x04,\n    0x02,\n    0x02,\n    0x05,\n    0x00,\n    0x04,\n    0x30,\n  ]),\n  sha512: new Uint8Array([\n    0x30,\n    0x51,\n    0x30,\n    0x0d,\n    0x06,\n    0x09,\n    0x60,\n    0x86,\n    0x48,\n    0x01,\n    0x65,\n    0x03,\n    0x04,\n    0x02,\n    0x03,\n    0x05,\n    0x00,\n    0x04,\n    0x40,\n  ]),\n};\n\nfunction getHashPrefix(hash: Sha1 | Sha256 | Sha512): Uint8Array {\n  const prefix = HASH_PREFIXES[hash.NAME];\n  if (!prefix) {\n    throw new Error(\"Cannot get hash prefix for hash algorithm '\" + hash.NAME + \"'\");\n  }\n  return prefix;\n}\n"
  },
  {
    "path": "src/rsa/rsa.ts",
    "content": "import { BigNumber, Modulus } from '../bignum/bignum';\nimport { IllegalStateError } from '../other/errors';\n\nexport type key = {\n  0: Modulus;\n  1: BigNumber;\n  2?: BigNumber;\n  3?: Modulus;\n  4?: Modulus;\n  5?: BigNumber;\n  6?: BigNumber;\n  7?: BigNumber;\n};\n\nexport class RSA {\n  public readonly key: key;\n  public result!: Uint8Array;\n\n  constructor(key: Uint8Array[]) {\n    const l = key.length;\n    if (l !== 2 && l !== 3 && l !== 8) throw new SyntaxError('unexpected key type');\n\n    const k0 = new Modulus(new BigNumber(key[0]));\n    const k1 = new BigNumber(key[1]);\n    this.key = {\n      0: k0,\n      1: k1,\n    };\n    if (l > 2) {\n      this.key[2] = new BigNumber(key[2]);\n    }\n    if (l > 3) {\n      this.key[3] = new Modulus(new BigNumber(key[3]));\n      this.key[4] = new Modulus(new BigNumber(key[4]));\n      this.key[5] = new BigNumber(key[5]);\n      this.key[6] = new BigNumber(key[6]);\n      this.key[7] = new BigNumber(key[7]);\n    }\n  }\n\n  encrypt(msg: BigNumber): this {\n    if (!this.key) throw new IllegalStateError('no key is associated with the instance');\n\n    if (this.key[0].compare(msg) <= 0) throw new RangeError('data too large');\n\n    const m = this.key[0];\n    const e = this.key[1];\n\n    let result = m.power(msg, e).toBytes();\n\n    const bytelen = (m.bitLength + 7) >> 3;\n    if (result.length < bytelen) {\n      const r = new Uint8Array(bytelen);\n      r.set(result, bytelen - result.length);\n      result = r;\n    }\n\n    this.result = result;\n\n    return this;\n  }\n\n  decrypt(msg: BigNumber): this {\n    if (this.key[0].compare(msg) <= 0) throw new RangeError('data too large');\n\n    let result;\n    let m;\n    if (this.key[3] !== undefined) {\n      m = this.key[0] as BigNumber;\n      const p = this.key[3] as Modulus;\n      const q = this.key[4] as Modulus;\n      const dp = this.key[5] as BigNumber;\n      const dq = this.key[6] as BigNumber;\n      const u = this.key[7] as BigNumber;\n\n      const x = p.power(msg, dp);\n      const y = q.power(msg, dq);\n\n      let t = x.subtract(y);\n      while (t.sign < 0) t = t.add(p);\n\n      const h = p.reduce(u.multiply(t));\n\n      result = h\n        .multiply(q)\n        .add(y)\n        .clamp(m.bitLength)\n        .toBytes();\n    } else {\n      m = this.key[0];\n      const d = this.key[2] as BigNumber;\n\n      result = m.power(msg, d).toBytes();\n    }\n\n    const bytelen = (m.bitLength + 7) >> 3;\n    if (result.length < bytelen) {\n      let r = new Uint8Array(bytelen);\n      r.set(result, bytelen - result.length);\n      result = r;\n    }\n\n    this.result = result;\n\n    return this;\n  }\n}\n"
  },
  {
    "path": "test/aes.js",
    "content": "import * as asmCrypto from '../asmcrypto.all.es8';\nimport chai from 'chai';\nconst expect = chai.expect;\n\ndescribe('AES', () => {\n  describe('ECB', () => {\n    const ecb_aes_vectors = [\n      // AES-ECB-128\n      [\n        '2b7e151628aed2a6abf7158809cf4f3c', // key\n        '6bc1bee22e409f96e93d7e117393172a', // clear text\n        '3ad77bb40d7a3660a89ecaf32466ef97', // cipher text\n      ],\n      [\n        '2b7e151628aed2a6abf7158809cf4f3c', // key\n        'ae2d8a571e03ac9c9eb76fac45af8e51', // clear text\n        'f5d3d58503b9699de785895a96fdbaaf', // cipher text\n      ],\n      [\n        '2b7e151628aed2a6abf7158809cf4f3c', // key\n        '30c81c46a35ce411e5fbc1191a0a52ef', // clear text\n        '43b1cd7f598ece23881b00e3ed030688', // cipher text\n      ],\n      [\n        '2b7e151628aed2a6abf7158809cf4f3c', // key\n        'f69f2445df4f9b17ad2b417be66c3710', // clear text\n        '7b0c785e27e8ad3f8223207104725dd4', // cipher text\n      ],\n      [\n        // Two blocks\n        '2b7e151628aed2a6abf7158809cf4f3c', // key\n        'f69f2445df4f9b17ad2b417be66c3710f69f2445df4f9b17ad2b417be66c3710', // clear text\n        '7b0c785e27e8ad3f8223207104725dd47b0c785e27e8ad3f8223207104725dd4', // cipher text\n      ],\n      // AES-ECB-256\n      [\n        '603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', // key\n        '6bc1bee22e409f96e93d7e117393172a', // clear text\n        'f3eed1bdb5d2a03c064b5a7e3db181f8', // cipher text\n      ],\n      [\n        '603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', // key\n        'ae2d8a571e03ac9c9eb76fac45af8e51', // clear text\n        '591ccb10d410ed26dc5ba74a31362870', // cipher text\n      ],\n      [\n        '603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', // key\n        '30c81c46a35ce411e5fbc1191a0a52ef', // clear text\n        'b6ed21b99ca6f4f9f153e7b1beafed1d', // cipher text\n      ],\n      [\n        // Two blocks\n        '603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', // key\n        '30c81c46a35ce411e5fbc1191a0a52ef30c81c46a35ce411e5fbc1191a0a52ef', // clear text\n        'b6ed21b99ca6f4f9f153e7b1beafed1db6ed21b99ca6f4f9f153e7b1beafed1d', // cipher text\n      ],\n      [\n        '603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4', // key\n        'f69f2445df4f9b17ad2b417be66c3710', // clear text\n        '23304b7a39f9f3ff067d8d8f9e24ecc7', // cipher text\n      ],\n    ];\n\n    it('asmCrypto.AES_ECB.encrypt / asmCrypto.AES_ECB.decrypt', function () {\n      for (let i = 0; i < ecb_aes_vectors.length; ++i) {\n        const key = new Uint8Array(asmCrypto.hex_to_bytes(ecb_aes_vectors[i][0]));\n        const clear = new Uint8Array(asmCrypto.hex_to_bytes(ecb_aes_vectors[i][1]));\n        const cipher = new Uint8Array(asmCrypto.hex_to_bytes(ecb_aes_vectors[i][2]));\n\n        expect(asmCrypto.AES_ECB.encrypt(clear, key), `encrypt vector ${i}`).to.deep.equal(cipher);\n\n        expect(asmCrypto.AES_ECB.decrypt(cipher, key), `decrypt vector ${i}`).to.deep.equal(clear);\n      }\n    });\n  });\n\n  describe('CBC', () => {\n    const cbc_aes_vectors = [\n      [   // key\n        [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c],\n        // iv\n        [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],\n        // clear text\n        [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,\n          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,\n          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,\n          0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10],\n        // cipher text\n        [0x76, 0x49, 0xab, 0xac, 0x81, 0x19, 0xb2, 0x46, 0xce, 0xe9, 0x8e, 0x9b, 0x12, 0xe9, 0x19, 0x7d,\n          0x50, 0x86, 0xcb, 0x9b, 0x50, 0x72, 0x19, 0xee, 0x95, 0xdb, 0x11, 0x3a, 0x91, 0x76, 0x78, 0xb2,\n          0x73, 0xbe, 0xd6, 0xb8, 0xe3, 0xc1, 0x74, 0x3b, 0x71, 0x16, 0xe6, 0x9e, 0x22, 0x22, 0x95, 0x16,\n          0x3f, 0xf1, 0xca, 0xa1, 0x68, 0x1f, 0xac, 0x09, 0x12, 0x0e, 0xca, 0x30, 0x75, 0x86, 0xe1, 0xa7]\n      ],\n      [   // key\n        [0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,\n          0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4],\n        // iv\n        [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],\n        // clear text\n        [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,\n          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,\n          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,\n          0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10],\n        // cipher text\n        [0xf5, 0x8c, 0x4c, 0x04, 0xd6, 0xe5, 0xf1, 0xba, 0x77, 0x9e, 0xab, 0xfb, 0x5f, 0x7b, 0xfb, 0xd6,\n          0x9c, 0xfc, 0x4e, 0x96, 0x7e, 0xdb, 0x80, 0x8d, 0x67, 0x9f, 0x77, 0x7b, 0xc6, 0x70, 0x2c, 0x7d,\n          0x39, 0xf2, 0x33, 0x69, 0xa9, 0xd9, 0xba, 0xcf, 0xa5, 0x30, 0xe2, 0x63, 0x04, 0x23, 0x14, 0x61,\n          0xb2, 0xeb, 0x05, 0xe2, 0xc3, 0x9b, 0xe9, 0xfc, 0xda, 0x6c, 0x19, 0x07, 0x8c, 0x6a, 0x9d, 0x1b]\n      ]\n    ];\n\n    it('asmCrypto.AES_CBC.encrypt / asmCrypto.AES_CBC.decrypt', function () {\n      for (let i = 0; i < cbc_aes_vectors.length; ++i) {\n        const key = new Uint8Array(cbc_aes_vectors[i][0]);\n        const iv = new Uint8Array(cbc_aes_vectors[i][1]);\n        const clear = new Uint8Array(cbc_aes_vectors[i][2]);\n        const cipher = new Uint8Array(cbc_aes_vectors[i][3]);\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CBC.encrypt(clear, key, false, iv)), `encrypt vector ${i}`).to.be.equal(asmCrypto.bytes_to_hex(cipher));\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CBC.decrypt(cipher, key, false, iv)), `decrypt vector ${i}`).to.be.equal(asmCrypto.bytes_to_hex(clear));\n      }\n    });\n  });\n\n  describe('CTR', () => {\n    const ctr_aes_vectors = [\n      [\n        // key\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        // nonce\n        asmCrypto.hex_to_bytes('f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'),\n        // input message\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f3009cee')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        // nonce\n        asmCrypto.hex_to_bytes('f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'),\n        // input message\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('874d6191b620e3261bef6864990db6ce9806f66b7970fdff8617187bb9fffdff5ae4df3edbd5d35e5b4f09020db03eab1e031dda2fbe03d1792170a0f300')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        // nonce\n        asmCrypto.hex_to_bytes('f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'),\n        // input message\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e11739317'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('874d6191b620e3261bef6864990db6')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4'),\n        // nonce\n        asmCrypto.hex_to_bytes('f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff'),\n        // input message\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('601ec313775789a5b7a7f504bbf3d228f443e3ca4d62b59aca84e990cacaf5c52b0930daa23de94ce87017ba2d84988ddfc9c58db67aada613c2dd08457941a6')\n      ]\n    ];\n\n    it('asmCrypto.AES_CTR.encrypt / asmCrypto.AES_CTR.decrypt', function () {\n      for (let i = 0; i < ctr_aes_vectors.length; ++i) {\n        const key = new Uint8Array(ctr_aes_vectors[i][0]);\n        const nonce = new Uint8Array(ctr_aes_vectors[i][1]);\n        const clear = new Uint8Array(ctr_aes_vectors[i][2]);\n        const cipher = new Uint8Array(ctr_aes_vectors[i][3]);\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CTR.encrypt(clear, key, nonce)), `encrypt vector ${i}`).to.be.equal(asmCrypto.bytes_to_hex(cipher));\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CTR.decrypt(cipher, key, nonce)), `decrypt vector ${i}`).to.be.equal(asmCrypto.bytes_to_hex(clear));\n      }\n    });\n  });\n  describe('GCM', () => {\n    const gcm_aes_vectors = [\n      [\n        // key\n        asmCrypto.hex_to_bytes('00000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('000000000000000000000000'),\n        // adata\n        undefined,\n        // tagSize\n        16,\n        // input message\n        asmCrypto.string_to_bytes(''),\n        // encrypted message\n        asmCrypto.hex_to_bytes('58e2fccefa7e3061367f1d57a4e7455a')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('00000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('000000000000000000000000'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('00000000000000000000000000000000'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('0388dace60b6a392f328c2b971b2fe78ab6e47d42cec13bdf53a67b21257bddf')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('feffe9928665731c6d6a8f9467308308'),\n        // nonce\n        asmCrypto.hex_to_bytes('cafebabefacedbaddecaf888'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b391aafd255'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e091473f59854d5c2af327cd64a62cf35abd2ba6fab4')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('feffe9928665731c6d6a8f9467308308'),\n        // nonce\n        asmCrypto.hex_to_bytes('cafebabefacedbaddecaf888'),\n        // adata\n        asmCrypto.hex_to_bytes('feedfacedeadbeeffeedfacedeadbeefabaddad2'),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('42831ec2217774244b7221b784d0d49ce3aa212f2c02a4e035c17e2329aca12e21d514b25466931c7d8f6a5aac84aa051ba30b396a0aac973d58e0915bc94fbc3221a5db94fae95ae7121a47')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('feffe9928665731c6d6a8f9467308308'),\n        // nonce\n        asmCrypto.hex_to_bytes('cafebabefacedbad'),\n        // adata\n        asmCrypto.hex_to_bytes('feedfacedeadbeeffeedfacedeadbeefabaddad2'),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('61353b4c2806934a777ff51fa22a4755699b2a714fcdc6f83766e5f97b6c742373806900e49f24b22b097544d4896b424989b5e1ebac0f07c23f45983612d2e79e3b0785561be14aaca2fccb')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('feffe9928665731c6d6a8f9467308308'),\n        // nonce\n        asmCrypto.hex_to_bytes('9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b'),\n        // adata\n        asmCrypto.hex_to_bytes('feedfacedeadbeeffeedfacedeadbeefabaddad2'),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('8ce24998625615b603a033aca13fb894be9112a5c3a211a8ba262a3cca7e2ca701e4a9a4fba43c90ccdcb281d48c7c6fd62875d2aca417034c34aee5619cc5aefffe0bfa462af43c1699d050')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('0000000000000000000000000000000000000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('000000000000000000000000'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('00000000000000000000000000000000'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('cea7403d4d606b6e074ec5d3baf39d18d0d1c8a799996bf0265b98b5d48ab919')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('0000000000000000000000000000000000000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('000000000000000000000000'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes(''),\n        // encrypted message\n        asmCrypto.hex_to_bytes('530f8afbc74536b9a963b4f1c4cb738b')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('0000000000000000000000000000000000000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('000000000000000000000000'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.string_to_bytes(''),\n        // encrypted message\n        asmCrypto.hex_to_bytes('530f8afbc74536b9a963b4f1c4cb738b')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('0000000000000000000000000000000000000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('000000000000000000000000'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('00000000000000000000000000000000'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('cea7403d4d606b6e074ec5d3baf39d18d0d1c8a799996bf0265b98b5d48ab919')\n      ],\n      [\n        // key\n        asmCrypto.hex_to_bytes('feffe9928665731c6d6a8f9467308308feffe9928665731c6d6a8f9467308308'),\n        // nonce\n        asmCrypto.hex_to_bytes('9313225df88406e555909c5aff5269aa6a7a9538534f7da1e4c303d2a318a728c3c0c95156809539fcf0e2429a6b525416aedbf5a0de6a57a637b39b'),\n        // adata\n        asmCrypto.hex_to_bytes('feedfacedeadbeeffeedfacedeadbeefabaddad2'),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('d9313225f88406e5a55909c5aff5269a86a7a9531534f7da2e4c303d8a318a721c3c0c95956809532fcf0e2449a6b525b16aedf5aa0de657ba637b39'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('5a8def2f0c9e53f1f75d7853659e2a20eeb2b22aafde6419a058ab4f6f746bf40fc0c3b780f244452da3ebf1c5d82cdea2418997200ef82e44ae7e3fa44a8266ee1c8eb0c8b5d4cf5ae9f19a')\n      ],\n      [ // Test case for issue #70 (https://github.com/vibornoff/asmcrypto.js/issues/70)\n        // key\n        asmCrypto.hex_to_bytes('00000000000000000000000000000000'),\n        // nonce\n        asmCrypto.hex_to_bytes('00'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('00'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('e9d60634580263ebab909efa6623dafc61')\n      ],\n      [ // Test case for issue #70 (https://github.com/vibornoff/asmcrypto.js/issues/92)\n        // key\n        asmCrypto.base64_to_bytes('dGQhii+B7+eLLHRiOA690w=='),\n        // nonce\n        asmCrypto.base64_to_bytes('R8q1njARXS7urWv3'),\n        // adata\n        undefined,\n        // tagSize\n        16,\n        // input message\n        asmCrypto.base64_to_bytes('dGQhwoovwoHDr8OnwossdGI4DsK9w5M='),\n        // encrypted message\n        asmCrypto.base64_to_bytes('L3zqVYAOsRk7zMg2KsNTVShcad8TjIQ7umfsvia21QO0XTj8vaeR')\n      ],\n    ];\n\n    it(\"asmCrypto.AES_GCM.encrypt\", function () {\n      for (let i = 0; i < gcm_aes_vectors.length; ++i) {\n        const key = gcm_aes_vectors[i][0];\n        const nonce = gcm_aes_vectors[i][1];\n        const adata = gcm_aes_vectors[i][2];\n        const tagsize = gcm_aes_vectors[i][3];\n        const cleartext = gcm_aes_vectors[i][4];\n        const ciphertext = gcm_aes_vectors[i][5];\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_GCM.encrypt(cleartext, key, nonce, adata, tagsize)), 'encrypt vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(ciphertext));\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_GCM.decrypt(ciphertext, key, nonce, adata, tagsize)), 'decrypt vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(cleartext));\n      }\n    });\n  });\n\n  describe('CFB', () => {\n    const cfb_aes_vectors = [\n      [   // key\n        [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c],\n        // iv\n        [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],\n        // clear text\n        [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,\n          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,\n          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,\n          0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10],\n        // cipher text\n        [0x3b, 0x3f, 0xd9, 0x2e, 0xb7, 0x2d, 0xad, 0x20, 0x33, 0x34, 0x49, 0xf8, 0xe8, 0x3c, 0xfb, 0x4a,\n          0xc8, 0xa6, 0x45, 0x37, 0xa0, 0xb3, 0xa9, 0x3f, 0xcd, 0xe3, 0xcd, 0xad, 0x9f, 0x1c, 0xe5, 0x8b,\n          0x26, 0x75, 0x1f, 0x67, 0xa3, 0xcb, 0xb1, 0x40, 0xb1, 0x80, 0x8c, 0xf1, 0x87, 0xa4, 0xf4, 0xdf,\n          0xc0, 0x4b, 0x05, 0x35, 0x7c, 0x5d, 0x1c, 0x0e, 0xea, 0xc4, 0xc6, 0x6f, 0x9f, 0xf7, 0xf2, 0xe6]\n      ],\n      [   // key\n        [0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c],\n        // iv\n        [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],\n        // clear text\n        [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,\n          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,\n          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,\n          0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41],\n        // cipher text\n        [0x3b, 0x3f, 0xd9, 0x2e, 0xb7, 0x2d, 0xad, 0x20, 0x33, 0x34, 0x49, 0xf8, 0xe8, 0x3c, 0xfb, 0x4a,\n          0xc8, 0xa6, 0x45, 0x37, 0xa0, 0xb3, 0xa9, 0x3f, 0xcd, 0xe3, 0xcd, 0xad, 0x9f, 0x1c, 0xe5, 0x8b,\n          0x26, 0x75, 0x1f, 0x67, 0xa3, 0xcb, 0xb1, 0x40, 0xb1, 0x80, 0x8c, 0xf1, 0x87, 0xa4, 0xf4, 0xdf,\n          0xc0, 0x4b, 0x05, 0x35, 0x7c, 0x5d, 0x1c, 0x0e, 0xea, 0xc4, 0xc6]\n      ],\n      [   // key\n        [0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,\n          0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4],\n        // iv\n        [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],\n        // clear text\n        [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,\n          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,\n          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,\n          0xf6, 0x9f, 0x24, 0x45, 0xdf, 0x4f, 0x9b, 0x17, 0xad, 0x2b, 0x41, 0x7b, 0xe6, 0x6c, 0x37, 0x10],\n        // cipher text\n        [0xdc, 0x7e, 0x84, 0xbf, 0xda, 0x79, 0x16, 0x4b, 0x7e, 0xcd, 0x84, 0x86, 0x98, 0x5d, 0x38, 0x60,\n          0x39, 0xff, 0xed, 0x14, 0x3b, 0x28, 0xb1, 0xc8, 0x32, 0x11, 0x3c, 0x63, 0x31, 0xe5, 0x40, 0x7b,\n          0xdf, 0x10, 0x13, 0x24, 0x15, 0xe5, 0x4b, 0x92, 0xa1, 0x3e, 0xd0, 0xa8, 0x26, 0x7a, 0xe2, 0xf9,\n          0x75, 0xa3, 0x85, 0x74, 0x1a, 0xb9, 0xce, 0xf8, 0x20, 0x31, 0x62, 0x3d, 0x55, 0xb1, 0xe4, 0x71]\n      ],\n      [   // key\n        [0x60, 0x3d, 0xeb, 0x10, 0x15, 0xca, 0x71, 0xbe, 0x2b, 0x73, 0xae, 0xf0, 0x85, 0x7d, 0x77, 0x81,\n          0x1f, 0x35, 0x2c, 0x07, 0x3b, 0x61, 0x08, 0xd7, 0x2d, 0x98, 0x10, 0xa3, 0x09, 0x14, 0xdf, 0xf4],\n        // iv\n        [0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f],\n        // clear text\n        [0x6b, 0xc1, 0xbe, 0xe2, 0x2e, 0x40, 0x9f, 0x96, 0xe9, 0x3d, 0x7e, 0x11, 0x73, 0x93, 0x17, 0x2a,\n          0xae, 0x2d, 0x8a, 0x57, 0x1e, 0x03, 0xac, 0x9c, 0x9e, 0xb7, 0x6f, 0xac, 0x45, 0xaf, 0x8e, 0x51,\n          0x30, 0xc8, 0x1c, 0x46, 0xa3, 0x5c, 0xe4, 0x11, 0xe5, 0xfb, 0xc1, 0x19, 0x1a, 0x0a, 0x52, 0xef,\n          0xf6, 0x9f, 0x24],\n        // cipher text\n        [0xdc, 0x7e, 0x84, 0xbf, 0xda, 0x79, 0x16, 0x4b, 0x7e, 0xcd, 0x84, 0x86, 0x98, 0x5d, 0x38, 0x60,\n          0x39, 0xff, 0xed, 0x14, 0x3b, 0x28, 0xb1, 0xc8, 0x32, 0x11, 0x3c, 0x63, 0x31, 0xe5, 0x40, 0x7b,\n          0xdf, 0x10, 0x13, 0x24, 0x15, 0xe5, 0x4b, 0x92, 0xa1, 0x3e, 0xd0, 0xa8, 0x26, 0x7a, 0xe2, 0xf9,\n          0x75, 0xa3, 0x85]\n      ]\n    ];\n\n    it('asmCrypto.AES_CFB.encrypt / asmCrypto.AES_CFB.decrypt', function () {\n      for (let i = 0; i < cfb_aes_vectors.length; ++i) {\n        const key = new Uint8Array(cfb_aes_vectors[i][0]);\n        const iv = new Uint8Array(cfb_aes_vectors[i][1]);\n        const clear = new Uint8Array(cfb_aes_vectors[i][2]);\n        const cipher = new Uint8Array(cfb_aes_vectors[i][3]);\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CFB.encrypt(clear, key, iv)), `encrypt vector ${i}`).to.be.equal(asmCrypto.bytes_to_hex(cipher));\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CFB.decrypt(cipher, key, iv)), `decrypt vector ${i}`).to.be.equal(asmCrypto.bytes_to_hex(clear));\n      }\n    });\n  });\n  describe('OFB', () => {\n    // key, iv, cleartext, ciphertext\n    const ofb_vectors = [\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('000102030405060708090A0B0C0D0E0F'),\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172a'),\n        asmCrypto.hex_to_bytes('3b3fd92eb72dad20333449f8e83cfb4a'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('50FE67CC996D32B6DA0937E99BAFEC60'),\n        asmCrypto.hex_to_bytes('ae2d8a571e03ac9c9eb76fac45af8e51'),\n        asmCrypto.hex_to_bytes('7789508d16918f03f53c52dac54ed825'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('D9A4DADA0892239F6B8B3D7680E15674'),\n        asmCrypto.hex_to_bytes('30c81c46a35ce411e5fbc1191a0a52ef'),\n        asmCrypto.hex_to_bytes('9740051e9c5fecf64344f7a82260edcc'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('A78819583F0308E7A6BF36B1386ABF23'),\n        asmCrypto.hex_to_bytes('f69f2445df4f9b17ad2b417be66c3710'),\n        asmCrypto.hex_to_bytes('304c6528f659c77866a510d9c1d6ae5e'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'),\n        asmCrypto.hex_to_bytes('000102030405060708090A0B0C0D0E0F'),\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172a'),\n        asmCrypto.hex_to_bytes('cdc80d6fddf18cab34c25909c99a4174'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'),\n        asmCrypto.hex_to_bytes('A609B38DF3B1133DDDFF2718BA09565E'),\n        asmCrypto.hex_to_bytes('ae2d8a571e03ac9c9eb76fac45af8e51'),\n        asmCrypto.hex_to_bytes('fcc28b8d4c63837c09e81700c1100401'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'),\n        asmCrypto.hex_to_bytes('52EF01DA52602FE0975F78AC84BF8A50'),\n        asmCrypto.hex_to_bytes('30c81c46a35ce411e5fbc1191a0a52ef'),\n        asmCrypto.hex_to_bytes('8d9a9aeac0f6596f559c6d4daf59a5f2'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('8e73b0f7da0e6452c810f32b809079e562f8ead2522c6b7b'),\n        asmCrypto.hex_to_bytes('BD5286AC63AABD7EB067AC54B553F71D'),\n        asmCrypto.hex_to_bytes('f69f2445df4f9b17ad2b417be66c3710'),\n        asmCrypto.hex_to_bytes('6d9f200857ca6c3e9cac524bd9acc92a'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4'),\n        asmCrypto.hex_to_bytes('000102030405060708090A0B0C0D0E0F'),\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172a'),\n        asmCrypto.hex_to_bytes('dc7e84bfda79164b7ecd8486985d3860'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4'),\n        asmCrypto.hex_to_bytes('B7BF3A5DF43989DD97F0FA97EBCE2F4A'),\n        asmCrypto.hex_to_bytes('ae2d8a571e03ac9c9eb76fac45af8e51'),\n        asmCrypto.hex_to_bytes('4febdc6740d20b3ac88f6ad82a4fb08d'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4'),\n        asmCrypto.hex_to_bytes('E1C656305ED1A7A6563805746FE03EDC'),\n        asmCrypto.hex_to_bytes('30c81c46a35ce411e5fbc1191a0a52ef'),\n        asmCrypto.hex_to_bytes('71ab47a086e86eedf39d1c5bba97c408'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4'),\n        asmCrypto.hex_to_bytes('41635BE625B48AFC1666DD42A09D96E7'),\n        asmCrypto.hex_to_bytes('f69f2445df4f9b17ad2b417be66c3710'),\n        asmCrypto.hex_to_bytes('0126141d67f37be8538f5a8be740e484'),\n      ],\n    ];\n    \n    it('asmCrypto.AES_OFB.encrypt / asmCrypto.AES_OFB.decrypt', () => {\n      for (let i = 0; i < ofb_vectors.length; ++i) {\n        const key = new Uint8Array(ofb_vectors[i][0]);\n        const iv = new Uint8Array(ofb_vectors[i][1]);\n        const clear = new Uint8Array(ofb_vectors[i][2]);\n        const cipher = new Uint8Array(ofb_vectors[i][3]);\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_OFB.encrypt(clear, key, iv)), 'encrypt vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(cipher));\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_OFB.decrypt(cipher, key, iv)), 'decrypt vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(clear));\n      }\n    });\n  });\n  describe('CMAC', () => {\n    // key, data, result\n    const cmac_vectors = [\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes(''),\n        asmCrypto.hex_to_bytes('bb1d6929e95937287fa37d129b756746'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172a'),\n        asmCrypto.hex_to_bytes('070a16b46b4d4144f79bdd9dd04a287c'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411'),\n        asmCrypto.hex_to_bytes('dfa66747de9ae63030ca32611497c827'),\n      ],\n      [\n        asmCrypto.hex_to_bytes('2b7e151628aed2a6abf7158809cf4f3c'),\n        asmCrypto.hex_to_bytes('6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710'),\n        asmCrypto.hex_to_bytes('51f0bebf7e3b9d92fc49741779363cfe'),\n      ],\n    ];\n    \n    it('asmCrypto.AES_CMAC', function() {\n      for (let i = 0; i < cmac_vectors.length; ++i) {\n        const key = new Uint8Array(cmac_vectors[i][0]);\n        const data = new Uint8Array(cmac_vectors[i][1]);\n        const result = new Uint8Array(cmac_vectors[i][2]);\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CMAC.bytes(data, key)), 'cmac vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(result));\n      }\n    });\n  });\n  describe('CCM', () => {\n    const ccm_aes_vectors = [\n      [\n        // key\n        new Uint8Array([ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf ]),\n        // nonce\n        new Uint8Array([ 0x00, 0x00, 0x00, 0x03, 0x02, 0x01, 0x00, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5 ]),\n        // adata\n        new Uint8Array([ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07 ]),\n        // tagSize\n        8,\n        // input message\n        new Uint8Array([ 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,\n          0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e ]),\n        // encrypted message\n        new Uint8Array([ 0x58, 0x8c, 0x97, 0x9a, 0x61, 0xc6, 0x63, 0xd2, 0xf0, 0x66, 0xd0, 0xc2, 0xc0, 0xf9, 0x89, 0x80,\n          0x6d, 0x5f, 0x6b, 0x61, 0xda, 0xc3, 0x84, 0x17, 0xe8, 0xd1, 0x2c, 0xfd, 0xf9, 0x26, 0xe0 ]),\n      ],\n      [\n        // key\n        new Uint8Array([ 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf ]),\n        // nonce\n        new Uint8Array([ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 ]),\n        // adata\n        new Uint8Array([ 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x61, 0x75, 0x74, 0x68, 0x69, 0x6e, 0x66, 0x6f, 0x6f ]),\n        // tagSize\n        16,\n        // input message\n        asmCrypto.hex_to_bytes('44696420796f75206b6e6f772e2e2e0d0a46726f6d2057696b6970656469612773206e657720616e6420726563656e746c7920696d70726f76656420636f6e74656e743a0d0a5361696e74204c656f6e61726420436174686f6c69632043687572636820284d616469736f6e2c204e65627261736b61290d0a2e2e2e207468617420746865204a61636f62204d2e204e616368746967616c6c2d64657369676e65642053742e204c656f6e61726420436174686f6c696320436875726368202870696374757265642920696e204d616469736f6e2c204e65627261736b612c20636f6e7461696e73206120626f6e652072656c6963206f6620697473206e616d6573616b653f0d0a2e2e2e2074686174207468652043616e61646196536f757468204b6f72656120467265652054726164652041677265656d656e742077696c6c20656c696d696e61746520393825206f6620616c6c20696d706f72742074617269666673206265747765656e207468652074776f20636f756e74726965733f0d0a2e2e2e207468617420526f7373204d634577616e2c2043454f206f66205242532047726f75702c206f6e63652074686520776f726c642773206c6172676573742062616e6b2c207477696365206661696c656420616e206163636f756e74616e6379206578616d3f0d0a2e2e2e2074686174205475726b69736820776f6d656e2773206e6174696f6e616c2069636520686f636b657920706c617965722047697a656d20d67a74617364656c656e2069732061206d656d626572206f662068657220666174686572277320636c7562204d696c656e79756d20506174656e20534b3f0d0a2e2e2e207468617420566572697a6f6e20762e204643432028323031342920776173207265706f7274656420746f20626520746865206465617468206f66206e6574776f726b206e65757472616c6974792c20686176696e6720766163617465642074776f206f662074686520464343204f70656e20496e7465726e6574204f726465722032303130277320746872656520726567756c6174696f6e733f0d0a2e2e2e207468617420746865206d6f737320737065636965732043686f7269736f646f6e7469756d206163697068796c6c756d2063616e207375727669766520666f72206d6f7265207468616e20312c3530302079656172732066726f7a656e3f'),\n        // encrypted message\n        asmCrypto.hex_to_bytes('09e3c1f3ba2f40eeca4dd7c27453085c71727d4b452a388dbdafc48a7f1406184b5516ea59d9ece55f347237b440792a4e71d26ee6df2dfcd39aea379080082a67be4d7c1af810181379d3f3a444512468e43494a41e9f968c6fe13f45027a297cc24ba3113a5e1b575fa3e1246004d75264e0960052d4e14b4e1a46b24f644428ef4ad4c50455e7029fa53b4eadbe5934c234043f23296b1c235bc8ffadd28deea7415b4bfd996071179cb361822894ab54078b5ad139a7dea6889a36d1417cbbbb1eb9afa0de88d736bf81e5140df06988f2901c275f63fed880fb6a00e7ebd0d5394360ca67b0680d64cc4ba5f7c69298a265916dc4ef03bb54b5e59c0cc48f83b20cf6ec1180b2423966e78ffd94ad1b74dc6b314802ddea17036d507f44c289effd820cb43d0daac09d3ee20ee41cff1e3f2858dc2643e13fcc481d4b1d36ada547e05f789f0d1067c73949c522fd54dc0240c942cc250af3304173dcbab38f1c8292ce0036c8f0c20ceb3d5cc70cc02e5b07329640dc971a410959e89e24edf15d96a6d2cf81abcb994355051371983533f788c9bd01a8e640b1b733c2b34b7ddf7229cf81d3664d85e0cf14dcfb73f0701939f6929e725de6ea590dc0a4caf5fa6fdacc96590e43b94c6f221a703c1c5073509e6b0700eeafde7ee99e149bdbf34a5acd948a513401ba78c4db7128e1f0aac26767f8a4754ae06a41287a12a7f3059c7a405aceb105b3748264c081240c3aa3f298a0ef5f2ea93151a25a3f746082d352eb3a52fb6f860cdf0f4d2186af5e4aa744893e8a59037daa6c23d8d31d2666c528a4ce4e249a27f7aab2bf14eeb7bf8c617380a34db5b7fade8eca02f1f030a62a2ffc7f2d2b14ec366b2a4269be4c763276195ce4c95b4c77c2cc001aac54dd6496099d7ecfe1f1e316d846ab41c4ef461ae0687588ea45532fe8bf9c91cf0840200a232adaa0b8036eaf3f29e4b2d898e8fb2315c22f4915b5746c7920a0bbc98548076e8f68a2fbf3b84df590d0a3154a66d17a80a115027c066f4d5f6c69769e52268f3cea1ee86150144bc05ba63d526e611a1ef723b0b573b37eb5949dd27875208219a77d5a8f170fcecf452ea1b4c78bc135a6345c853a2621154a664806d9fbb88a61ec7935c3511aa3ede4736ee37027e5f2ef2079447886ed5a30839eee442ff8feb17acfa832a8dedb28cbb52b07a950c5dcb853a32ed2f8c0ff83adea7b060aaf2466d148ad43d8e657')\n      ],\n      [ // Test case for issue #92 (https://github.com/vibornoff/asmcrypto.js/issues/92#issuecomment-158269407)\n        // key\n        asmCrypto.base64_to_bytes('dGQhii+B7+eLLHRiOA690w=='),\n        // nonce\n        asmCrypto.base64_to_bytes('R8q1njARXS7urWv3'),\n        // adata\n        undefined,\n        // tagSize\n        16,\n        // plaintext\n        asmCrypto.base64_to_bytes('dGQhwoovwoHDr8OnwossdGI4DsK9w5M='),\n        // ciphertext\n        asmCrypto.base64_to_bytes('kMrwkAdqy9VuEdkUA75K2hxjjy4kyRfDXMGzg+l4CoHga1/Rh49R'),\n      ],\n      [ // Test case for issue #92 (https://github.com/vibornoff/asmcrypto.js/issues/92#issuecomment-158269407)\n        // key\n        asmCrypto.base64_to_bytes('dGQhii+B7+eLLHRiOA690w=='),\n        // nonce\n        asmCrypto.base64_to_bytes('R8q1njARXS7urWv3'),\n        // adata\n        undefined,\n        // tagSize\n        16,\n        // plaintext\n        asmCrypto.base64_to_bytes('dGQhwoovwoHDr8OnwossdGI4DsK9w5M='),\n        // ciphertext\n        asmCrypto.base64_to_bytes('kMrwkAdqy9VuEdkUA75K2hxjjy4kyRfDXMGzg+l4CoHga1/Rh49R'),\n      ],\n      [ // Test case for issue #92 (https://github.com/vibornoff/asmcrypto.js/issues/92#issuecomment-158269407)\n        // key\n        asmCrypto.base64_to_bytes('dGQhii+B7+eLLHRiOA690w=='),\n        // nonce\n        asmCrypto.base64_to_bytes('R8q1njARXS7urWv3'),\n        // adata\n        asmCrypto.string_to_bytes(''),\n        // tagSize\n        16,\n        // plaintext\n        asmCrypto.base64_to_bytes('dGQhwoovwoHDr8OnwossdGI4DsK9w5M='),\n        // ciphertext\n        asmCrypto.base64_to_bytes('kMrwkAdqy9VuEdkUA75K2hxjjy4kyRfDXMGzg+l4CoHga1/Rh49R'),\n      ],\n      [ // Test case for issue #92 (https://github.com/vibornoff/asmcrypto.js/issues/92#issuecomment-158269407)\n        // key\n        asmCrypto.base64_to_bytes('dGQhii+B7+eLLHRiOA690w=='),\n        // nonce\n        asmCrypto.base64_to_bytes('R8q1njARXS7urWv3'),\n        // adata\n        new Uint8Array(0),\n        // tagSize\n        16,\n        // plaintext\n        asmCrypto.base64_to_bytes('dGQhwoovwoHDr8OnwossdGI4DsK9w5M='),\n        // ciphertext\n        asmCrypto.base64_to_bytes('kMrwkAdqy9VuEdkUA75K2hxjjy4kyRfDXMGzg+l4CoHga1/Rh49R'),\n      ],\n      [ // Test case for issue #92 (https://github.com/vibornoff/asmcrypto.js/issues/92#issuecomment-158797782)\n        // key\n        asmCrypto.hex_to_bytes('0f0e0d0c0b0a09080706050403020100'),\n        // nonce\n        asmCrypto.hex_to_bytes('000102030405060708090a0b'),\n        // adata\n        undefined,\n        // tagSize\n        16,\n        // plaintext\n        asmCrypto.string_to_bytes('42'),\n        // ciphertext\n        asmCrypto.hex_to_bytes('28be1ac7b43d8868869b9a45d3de436cd0cc'),\n      ],\n    ];\n\n    it('asmCrypto.AES_CCM.encrypt / asmCrypto.AES_CCM.decrypt', function() {\n      for (let i = 0; i < ccm_aes_vectors.length; ++i) {\n        const key = ccm_aes_vectors[i][0];\n        const nonce = ccm_aes_vectors[i][1];\n        const adata = ccm_aes_vectors[i][2];\n        const tagsize = ccm_aes_vectors[i][3];\n        const clear = ccm_aes_vectors[i][4];\n        const cipher = ccm_aes_vectors[i][5];\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CCM.encrypt(clear, key, nonce, adata, tagsize)), 'encrypt vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(cipher));\n\n        expect(asmCrypto.bytes_to_hex(asmCrypto.AES_CCM.decrypt(cipher, key, nonce, adata, tagsize)), 'decrypt vector ' + i).to.be.equal(asmCrypto.bytes_to_hex(clear));\n      }\n    });\n  });\n});\n"
  },
  {
    "path": "test/bignum.js",
    "content": "import * as asmCrypto from '../asmcrypto.all.es8';\nimport chai from 'chai';\nconst expect = chai.expect;\n\ndescribe('Bignum', () => {\n  it('new asmCrypto.BigNumber()', function() {\n    const zero = new asmCrypto.BigNumber();\n    expect(zero.limbs.length, 'zero.limbs.length').to.equal(0);\n    expect(zero.bitLength, 'zero.bitLength').to.equal(0);\n    expect(zero.valueOf(), 'zero.valueOf()').to.equal(0);\n    expect(zero.toString(16), 'zero.toString(16)').to.equal('0');\n\n    const one = asmCrypto.BigNumber.fromNumber(1);\n    expect(one.limbs.length, 'one.limbs.length').to.equal(1);\n    expect(one.limbs[0], 'one.limbs[0]').to.equal(1);\n    expect(one.bitLength, 'one.bitLength').to.equal(32);\n    expect(one.valueOf(), 'one.valueOf()').to.equal(1);\n    expect(one.toString(16), 'one.toString(16)').to.equal('1');\n\n    const ten = asmCrypto.BigNumber.fromNumber(10);\n    expect(ten.limbs.length, 'ten.limbs.length').to.equal(1);\n    expect(ten.limbs[0], 'ten.limbs[0]').to.equal(10);\n    expect(ten.bitLength, 'ten.bitLength').to.equal(32);\n    expect(ten.valueOf(), 'ten.valueOf()').to.equal(10);\n    expect(ten.toString(16), 'ten.toString(16)').to.equal('a');\n\n    const mten = asmCrypto.BigNumber.fromNumber(-10);\n    expect(mten.limbs.length, 'mten.limbs.length').to.equal(1);\n    expect(mten.limbs[0], 'mten.limbs[0]').to.equal(10);\n    expect(mten.bitLength, 'mten.bitLength').to.equal(32);\n    expect(mten.valueOf(), 'mten.valueOf()').to.equal(-10);\n    expect(mten.toString(16), 'mten.toString(16)').to.equal('-a');\n\n    const ffffffff = asmCrypto.BigNumber.fromNumber(0xffffffff);\n    expect(ffffffff.limbs.length, 'ffffffff.limbs.length').to.equal(1);\n    expect(ffffffff.limbs[0], 'ffffffff.limbs[0]').to.equal(0xffffffff);\n    expect(ffffffff.bitLength, 'ffffffff.bitLength').to.equal(32);\n    expect(ffffffff.valueOf(), 'ffffffff.valueOf()').to.equal(0xffffffff);\n    expect(ffffffff.toString(16), 'ffffffff.toString(16)').to.equal('ffffffff');\n\n    const deadbeefcafe = asmCrypto.BigNumber.fromNumber(0xdeadbeefcafe);\n    expect(deadbeefcafe.limbs.length, 'deadbeefcafe.limbs.length').to.equal(2);\n    expect(deadbeefcafe.limbs[0], 'deadbeefcafe.limbs[0]').to.equal(0xbeefcafe);\n    expect(deadbeefcafe.limbs[1], 'deadbeefcafe.limbs[1]').to.equal(0xdead);\n    expect(deadbeefcafe.bitLength, 'deadbeefcafe.bitLength').to.equal(52);\n    expect(deadbeefcafe.valueOf(), 'deadbeefcafe.valueOf()').to.equal(0xdeadbeefcafe);\n    expect(deadbeefcafe.toString(16), 'deadbeefcafe.toString(16)').to.equal('deadbeefcafe');\n\n    const verylarge = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc',\n      ),\n    );\n    expect(verylarge.limbs.length, 'verylarge.limbs.length').to.equal(64);\n    expect(verylarge.limbs[0], 'verylarge.limbs[0]').to.equal(0xf967b6cc);\n    expect(verylarge.limbs[63], 'verylarge.limbs[63]').to.equal(0x3f70f29d);\n    expect(verylarge.bitLength, 'verylarge.bitLength').to.equal(2048);\n    expect(verylarge.valueOf(), 'verylarge.valueOf()').to.equal(Infinity);\n    expect(verylarge.toString(16), 'verylarge.toString()').to.equal(\n      '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc',\n    );\n  });\n\n  it('asmCrypto.BigNumber.slice', function() {\n    const deadbeefcafe = asmCrypto.BigNumber.fromNumber(0xdeadbeefcafe);\n    expect(deadbeefcafe.slice(0).valueOf(), 'slice(0)').to.equal(0xdeadbeefcafe);\n    expect(deadbeefcafe.slice(52).valueOf(), 'slice(bitLength)').to.equal(0);\n    expect(deadbeefcafe.slice(24, 16).valueOf(), 'slice(middle)').to.equal(0xadbe);\n  });\n\n  it('asmCrypto.BigNumber.compare', function() {\n    const deadbeefcafe = asmCrypto.BigNumber.fromNumber(0xdeadbeefcafe);\n    const ffffffff = asmCrypto.BigNumber.fromNumber(0xffffffff);\n    let result = null;\n\n    result = ffffffff.compare(asmCrypto.BigNumber.fromNumber(0xffffffff));\n    expect(result, 'ffffffff == 0xffffffff').to.equal(0);\n\n    result = deadbeefcafe.compare(ffffffff);\n    expect(result, 'deadbeefcafe > ffffffff').to.equal(1);\n\n    result = ffffffff.compare(deadbeefcafe);\n    expect(result, 'ffffffff > deadbeefcafe').to.equal(-1);\n\n    result = ffffffff.compare(asmCrypto.BigNumber.fromNumber(-10));\n    expect(result, 'ffffffff > -10').to.equal(1);\n  });\n\n  it('asmCrypto.BigNumber.add', function() {\n    const deadbeefcafe = asmCrypto.BigNumber.fromNumber(0xdeadbeefcafe);\n    const ffffffff = asmCrypto.BigNumber.fromNumber(0xffffffff);\n    let result = null;\n\n    result = deadbeefcafe.add(ffffffff);\n    expect(result.toString(16), 'deadbeefcafe + ffffffff').to.equal('deaebeefcafd');\n\n    result = ffffffff.add(deadbeefcafe);\n    expect(result.toString(16), 'ffffffff + deadbeefcafe').to.equal('deaebeefcafd');\n\n    result = ffffffff.add(asmCrypto.BigNumber.fromNumber(-4294967295));\n    expect(result.valueOf(), 'ffffffff + (-ffffffff)').to.equal(0);\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'),\n    ).add(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',\n        ),\n      ),\n    );\n    expect(result.toString(16), 'large fff…fff').to.equal(\n      '10000000000000000000000000000000000000000000000000000000000000000fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe',\n    );\n  });\n\n  it('asmCrypto.BigNumber.subtract', function() {\n    const deadbeefcafe = asmCrypto.BigNumber.fromNumber(0xdeadbeefcafe);\n    const ffffffff = asmCrypto.BigNumber.fromNumber(0xffffffff);\n    let result = null;\n\n    result = deadbeefcafe.subtract(ffffffff);\n    expect(result.toString(16), 'deadbeefcafe - ffffffff').to.equal('deacbeefcaff');\n\n    result = ffffffff.subtract(deadbeefcafe);\n    expect(result.toString(16), 'ffffffff - deadbeefcafe').to.equal('-deacbeefcaff');\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff',\n      ),\n    ).subtract(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'),\n      ),\n    );\n    expect(result.toString(16), 'large fff…fff').to.equal(\n      'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000000000000000000000000000000000000000000000000000000000000000',\n    );\n  });\n\n  it('asmCrypto.BigNumber.multiply', function() {\n    const small = asmCrypto.BigNumber.fromNumber(0xabcdabcd);\n    const large = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes('322e393f76a1c22b147e7d193c00c023afb7c1500b006ff1bc1cc8d391fc38bd'),\n    );\n    const verylarge = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc',\n      ),\n    );\n    let result = null;\n\n    result = small.multiply(asmCrypto.BigNumber.fromNumber(0x1000));\n    expect(result.toString(16), 'small product is ok').to.equal('abcdabcd000');\n\n    result = large.multiply(large);\n    expect(result.toString(16), 'large product is ok').to.equal(\n      '9d616b569f3248a3e8b0bdcbed25f33122fd4e63f46cdacf664809417b3af1210cfd498deef48381295f067280f14d9ec85fe251e545f5013048853daab3b89',\n    );\n\n    result = verylarge.multiply(verylarge);\n    expect(result.toString(16), 'verylarge product is ok').to.equal(\n      'fb8c93e94a3fb8c87d267c2550011118c118f0a8ed6b1f2a611a13d05c363e90514fd4e4b4f8485b9113846168ba5cca86bfb8faadd25a5b978da0e95432a4203ca0c58ad4c34a81acb7065dc182a58e5bbca29b1ab195209a48dd6429aaa29ea2109ba8ea28302108b7b1812dcbbf4221e72e7d1283264bf0a2e2cb180e8687892ba428b88b92bcfdc228b733a02dceec5e0ee501b81b4ee68d66e320e3aae26f63cbd2db9f01e43844b1c40c68dfd2f329925cd1334a5af0f33f8ea509c1bb9c810bed4a4e5d0b91504cf56178027af972130bc3eaaac52868b3b0c554204d55470e05ff5dd70d8b70b8c385277329d0d4d0a5aa7a1c555750eaee4f1e1581ab56e3b1210e14d46393539ccb793e3a6a6f15bcf61b1e8a9acdf36db03457a37a1ae522c0129c18d08345ccc2f44352ed159db24272d4ac2de9e5f6c361477826b9d62be54468a9c9949ba0c772548dd28eabb4e195bb87a01244c3d44462aaa0ab3f22b48693650da8a1ffddde979533709f4dfb2b1a7c6fa98646deeb4b97f29d8c79f74f3f537845b99f8564ff046d35fbe108e13cf17c3f1b9390512fc57cd2f66d6ff94a455ba646a3ebc7464376b63126c869e2b722510243ee579882540e3d02e796c997fe1d43e2364314ba3190bc8ff0ba09855df3ef9cd3277b4f4ffeba6aeafc9513d89c012507cc8a471ea2ab91b24898afd6575e572aeb290',\n    );\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc',\n      ),\n    ).multiply(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          '100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n        ),\n      ),\n    );\n    expect(result.toString(16), 'verylarge2 product is ok').to.equal(\n      '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n    );\n  });\n\n  it('asmCrypto.BigNumber.square', function() {\n    const small = new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('ffffffff'));\n    const medium = new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('ffffffffffffffff'));\n    const medium2 = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'),\n    );\n    const large = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes('322e393f76a1c22b147e7d193c00c023afb7c1500b006ff1bc1cc8d391fc38bd'),\n    );\n    const verylarge = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc',\n      ),\n    );\n    let result;\n\n    result = small.square();\n    expect(result.toString(16), 'small square is ok').to.equal('fffffffe00000001');\n\n    result = medium.square();\n    expect(result.toString(16), 'medium square is ok').to.equal('fffffffffffffffe0000000000000001');\n\n    result = medium2.square();\n    expect(result.toString(16), 'medium2 square is ok').to.equal(\n      'fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0000000000000000000000000000000000000000000000000000000000000001',\n    );\n\n    result = large.square();\n    expect(result.toString(16), 'large square is ok').to.equal(\n      '9d616b569f3248a3e8b0bdcbed25f33122fd4e63f46cdacf664809417b3af1210cfd498deef48381295f067280f14d9ec85fe251e545f5013048853daab3b89',\n    );\n\n    result = verylarge.square();\n    expect(result.toString(16), 'verylarge square is ok').to.equal(\n      'fb8c93e94a3fb8c87d267c2550011118c118f0a8ed6b1f2a611a13d05c363e90514fd4e4b4f8485b9113846168ba5cca86bfb8faadd25a5b978da0e95432a4203ca0c58ad4c34a81acb7065dc182a58e5bbca29b1ab195209a48dd6429aaa29ea2109ba8ea28302108b7b1812dcbbf4221e72e7d1283264bf0a2e2cb180e8687892ba428b88b92bcfdc228b733a02dceec5e0ee501b81b4ee68d66e320e3aae26f63cbd2db9f01e43844b1c40c68dfd2f329925cd1334a5af0f33f8ea509c1bb9c810bed4a4e5d0b91504cf56178027af972130bc3eaaac52868b3b0c554204d55470e05ff5dd70d8b70b8c385277329d0d4d0a5aa7a1c555750eaee4f1e1581ab56e3b1210e14d46393539ccb793e3a6a6f15bcf61b1e8a9acdf36db03457a37a1ae522c0129c18d08345ccc2f44352ed159db24272d4ac2de9e5f6c361477826b9d62be54468a9c9949ba0c772548dd28eabb4e195bb87a01244c3d44462aaa0ab3f22b48693650da8a1ffddde979533709f4dfb2b1a7c6fa98646deeb4b97f29d8c79f74f3f537845b99f8564ff046d35fbe108e13cf17c3f1b9390512fc57cd2f66d6ff94a455ba646a3ebc7464376b63126c869e2b722510243ee579882540e3d02e796c997fe1d43e2364314ba3190bc8ff0ba09855df3ef9cd3277b4f4ffeba6aeafc9513d89c012507cc8a471ea2ab91b24898afd6575e572aeb290',\n    );\n  });\n\n  it('asmCrypto.BigNumber.divide', function() {\n    const small = new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('95705fac129de210'));\n    const small2 = new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('fffffffe00000002'));\n    const small3 = new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('ffffffff'));\n    const large = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '9d616b569f3248a3e8b0bdcbed25f33122fd4e63f46cdacf664809417b3af1210cfd498deef48381295f067280f14d9ec85fe251e545f5013048853daab3b89',\n      ),\n    );\n    const large2 = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes('322e393f76a1c22b147e7d193c00c023afb7c1500b006ff1bc1cc8d391fc38bd'),\n    );\n    let result = null;\n\n    result = small.divide(asmCrypto.BigNumber.fromNumber(0xabcd));\n    expect(result.remainder.toString(16), 'small % 0xabcd').to.equal('aaaa');\n    expect(result.quotient.toString(16), 'floor( small / 0xabcd )').to.equal('deadbeefcafe');\n\n    result = small2.divide(small3);\n    expect(result.remainder.toString(16), 'small2 % small3').to.equal('1');\n    expect(result.quotient.toString(16), 'floor( small2 / small3 )').to.equal('ffffffff');\n\n    result = large.divide(large2);\n    expect(result.remainder, 'large % large2').to.deep.equal(asmCrypto.BigNumber.ZERO);\n    expect(result.quotient.toString(16), 'floor( large / large2 )').to.equal(\n      '322e393f76a1c22b147e7d193c00c023afb7c1500b006ff1bc1cc8d391fc38bd',\n    );\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n      ),\n    ).divide(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          'c7f1bc1dfb1be82d244aef01228c1409c198894eca9e21430f1669b4aa3864c9f37f3d51b2b4ba1ab9e80f59d267fda1521e88b05117993175e004543c6e3611242f24432ce8efa3b81f0ff660b4f91c5d52f2511a6f38181a7bf9abeef72db056508bbb4eeb5f65f161dd2d5b439655d2ae7081fcc62fdcb281520911d96700c85cdaf12e7d1f15b55ade867240722425198d4ce39019550c4c8a921fc231d3e94297688c2d77cd68ee8fdeda38b7f9a274701fef23b4eaa6c1a9c15b2d77f37634930386fc20ec291be95aed9956801e1c76601b09c413ad915ff03bfdc0b6b233686ae59e8caf11750b509ab4e57ee09202239baee3d6e392d1640185e1cd',\n        ),\n      ),\n    );\n    expect(result.quotient.toString(16), 'q is ok').to.equal('1');\n    expect(result.remainder.toString(16), 'r is ok').to.equal(\n      '380e43e204e417d2dbb510fedd73ebf63e6776b13561debcf0e9964b55c79b360c80c2ae4d4b45e54617f0a62d98025eade1774faee866ce8a1ffbabc391c9eedbd0dbbcd317105c47e0f0099f4b06e3a2ad0daee590c7e7e58406541108d24fa9af7444b114a09a0e9e22d2a4bc69aa2d518f7e0339d0234d7eadf6ee2698ff37a3250ed182e0ea4aa521798dbf8ddbdae672b31c6fe6aaf3b3756de03dce2c16bd689773d288329711702125c748065d8b8fe010dc4b15593e563ea4d2880c89cb6cfc7903df13d6e416a51266a97fe1e3899fe4f63bec526ea00fc4023f494dcc97951a617350ee8af4af654b1a811f6dfddc64511c291c6d2e9bfe7a1e33',\n    );\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        'ad399e5f74531e554ab7e7130b8ae864c7ea09621f5fff87e07160b080e89cca0bb74448c9e792b53806bce62a0cedfed2184ea47014988c92fdbafe60771d02d5b5dcf7d4f5ac1dc0a1dd010d7ae5672efdb92b38f56b78ac54797d18a6dd363fdac5e58b68321305983c81cf4d627ed2a59c150458999e23d1d2569beb083c67fab925ae495a97acb4465aa6960d1df08a73d3f5362a53c3db3813f006d7bb7a29028d0547e918f2bb407acf60f6391b7862a1db39f26727771c61747a7766619a42864faa21d8d23317e12abbb13e0ba2ad6f7f0e3d08',\n      ),\n    ).divide(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          'a736146b621310f6cd645cb2fefeda223aa7ae33a53ac22e019b6ffb7167d9b29be1aebb3e1a7129ee3a5b4fb1a11660932b9be2b36a6dd3226451d7c4dd79619bdb9aa5596cef4e7b6d91f0e227bba2547b004ded1ed0e06182141dc55e183374fe1d93e23c38fcc81cd8eae82647528dde963cf1ef86f470e69436a2ac0d7fa7161d6fbfd32141217df992002320cb575e8de44c446d73bdf116719d61451c474701e153a01771cb8f070f8241d465d3d0124aed70ec459669bfc4927f941ddac97f4772f8d4d55165d1d06eec147749d0b9fee868ddf3',\n        ),\n      ),\n    );\n    expect(result.quotient.toString(16), 'q is ok').to.equal('1');\n    expect(result.remainder.toString(16), 'r is ok').to.equal(\n      '60389f412400d5e7d538a600c8c0e428d425b2e7a253d59ded5f0b50f80c3176fd5958d8bcd218b49cc6196786bd79e3eecb2c1bcaa2ab9709969269b99a3a139da42527b88bccf45344b102b5329c4da82b8dd4bd69a984ad2655f5348c502cadca851a92bf9163d7b6396e7271b2c44c705d8126912a9b2eb3e1ff93efabcc0e49bb5ee7639568b364cc8a672ec52992be5efa8f1bce005ea21a252a5929f32e200abb1a7d1a7272c396b4d1f21d347a85056edc90621910d5c9ce1fae34886d0c33edcb14d0380cd4610bbcf9cc6c1d1f37096a55f15',\n    );\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        'ad399e5f74531e554ab7e7130b8ae864c7ea09621f5fff87e07160b080e89cca0bb74448c9e792b53806bce62a0cedfed2184ea47014988c92fdbafe60771d02d5b5dcf7d4f5ac1dc0a1dd010d7ae5672efdb92b38f56b78ac54797d18a6dd363fdac5e58b68321305983c81cf4d627ed2a59c150458999e23d1d2569beb083c67fab925ae495a97acb4465aa6960d1df08a73d3f5362a53c3db3813f006d7bb7a29028d0547e918f2bb407acf60f6391b7862a1db39f26727771c61747a7766619a42864faa21d8d23317e12abbb13e0ba2ad6f7f0e3d08',\n      ),\n    ).divide(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          'a736146b621310f6cd645cb2fefeda223aa7ae33a53ac22e019b6ffb7167d9b29be1aebb3e1a7129ee3a5b4fb1a11660932b9be2b36a6dd3226451d7c4dd79619bdb9aa5596cef4e7b6d91f0e227bba2547b004ded1ed0e06182141dc55e183374fe1d93e23c38fcc81cd8eae82647528dde963cf1ef86f470e69436a2ac0d7fa7161d6fbfd32141217df992002320cb575e8de44c446d73bdf116719d61451c474701e153a01771cb8f070f8241d465d3d0124aed70ec459669bfc4927f941ddac97f4772f8d4d55165d1d06eec147749d0b9fee868ddf3',\n        ),\n      ),\n    );\n    expect(result.quotient.toString(16), 'q is ok').to.equal('1');\n    expect(result.remainder.toString(16), 'r is ok').to.equal(\n      '60389f412400d5e7d538a600c8c0e428d425b2e7a253d59ded5f0b50f80c3176fd5958d8bcd218b49cc6196786bd79e3eecb2c1bcaa2ab9709969269b99a3a139da42527b88bccf45344b102b5329c4da82b8dd4bd69a984ad2655f5348c502cadca851a92bf9163d7b6396e7271b2c44c705d8126912a9b2eb3e1ff93efabcc0e49bb5ee7639568b364cc8a672ec52992be5efa8f1bce005ea21a252a5929f32e200abb1a7d1a7272c396b4d1f21d347a85056edc90621910d5c9ce1fae34886d0c33edcb14d0380cd4610bbcf9cc6c1d1f37096a55f15',\n    );\n\n    result = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '8251a22c009e3e37af0a516bbd73662a462531e4886005cec939265e99f177d7812fd7d5df184c5ea8ced1cace7e6724a4c31b1dbdedcd9636acff51936801df9bdf255850896b4da0aebfbc8944da8385a58f47e335ce94fd53ab1b299335c9e242fd89fc87126c11df2e65efa31fc37ce90e454b72afff5db16c271d476054022227c76c039c30feba1a1bd8d62c11b5c8a9e666b7726c4306c1e84f51c6fbe4485a2826cfacaea58d4a522a48a0164aa45df489944822953f860084d34b3ac537e27af0ed95613ffcb7f775832bf3acc7beff1469ed7a28abbff4dbf08859cafc8b8a7b3a2dc02cdff66095f53897ae74d2ce47e5644ea7ac59398a99b55',\n      ),\n    ).divide(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          '4128d116004f1f1bd78528b5deb9b315231298f2443002e7649c932f4cf8bbebc097ebeaef8c262f546768e5673f339252618d8edef6e6cb1b567fa8c9b400efcdef92ac2844b5a6d0575fde44a26d41c2d2c7a3f19ae74a7ea9d58d94c99ae4f1217ec4fe43893608ef9732f7d18fe1be748722a5b957ffaed8b6138ea3b02a011113e3b601ce187f5d0d0dec6b1608dae454f3335bb936218360f427a8e37df2242d141367d65752c6a5291524500b25522efa44ca24114a9fc3004269a59d629bf13d7876cab09ffe5bfbbac195f9d663df7f8a34f6bd1455dffa6df8442ce57e45c53d9d16e0166ffb304afa9c4bd73a696723f2b22753d62c9cc54cdab',\n        ),\n      ),\n    );\n    expect(result.quotient.toString(16), 'q is ok').to.equal('1');\n    expect(result.remainder.toString(16), 'r is ok').to.equal(\n      '4128d116004f1f1bd78528b5deb9b315231298f2443002e7649c932f4cf8bbebc097ebeaef8c262f546768e5673f339252618d8edef6e6cb1b567fa8c9b400efcdef92ac2844b5a6d0575fde44a26d41c2d2c7a3f19ae74a7ea9d58d94c99ae4f1217ec4fe43893608ef9732f7d18fe1be748722a5b957ffaed8b6138ea3b02a011113e3b601ce187f5d0d0dec6b1608dae454f3335bb936218360f427a8e37df2242d141367d65752c6a5291524500b25522efa44ca24114a9fc3004269a59d629bf13d7876cab09ffe5bfbbac195f9d663df7f8a34f6bd1455dffa6df8442ce57e45c53d9d16e0166ffb304afa9c4bd73a696723f2b22753d62c9cc54cdaa',\n    );\n\n    result = new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('8000000000000000')).divide(\n      new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('80000000ffff')),\n    );\n    expect(result.quotient.toString(16), 'q is ok').to.equal('ffff');\n    expect(result.remainder.toString(16), 'r is ok').to.equal('7fff0001ffff');\n  });\n\n  it('asmCrypto.BigNumber.extGCD', function() {\n    let z;\n\n    z = asmCrypto.BigNumber.extGCD(asmCrypto.BigNumber.fromNumber(3), asmCrypto.BigNumber.fromNumber(2));\n    expect(z.gcd.valueOf(), 'gcd ok').to.equal(1);\n    expect(z.x.valueOf(), 'x ok').to.equal(1);\n    expect(z.y.valueOf(), 'y ok').to.equal(-1);\n\n    z = asmCrypto.BigNumber.extGCD(asmCrypto.BigNumber.fromNumber(240), asmCrypto.BigNumber.fromNumber(46));\n    expect(z.gcd.valueOf(), 'gcd ok').to.equal(2);\n    expect(z.x.valueOf(), 'x ok').to.equal(-9);\n    expect(z.y.valueOf(), 'y ok').to.equal(47);\n\n    z = asmCrypto.BigNumber.extGCD(\n      new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('abcdabcdabcd')),\n      new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('20000000000000')),\n    );\n    expect(z.gcd.valueOf(), 'gcd ok').to.equal(1);\n    expect(z.x.toString(16), 'x ok').to.equal('9b51de3a73905');\n    expect(z.y.toString(16), 'y ok').to.equal('-341e3c1e3c1e');\n\n    z = asmCrypto.BigNumber.extGCD(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          '00fcbd95956bea867fe1250b179fb2d4e0c59c4a2fe469a01cd90509d7d7c25cdf84f77eea1fbe509269819a828959b39b8f54a38a6f0290e48c0f3c9c45b78123',\n        ),\n      ),\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          '00d5176443bebb2a31a44df711ff7c982395c5477365f3618398fd7d37fad4d2394f9458c39dec561dab0bc6c7ced1c76b29cfd2e14ec793d5d300c70d49ada9f1',\n        ),\n      ),\n    );\n    expect(z.gcd.valueOf(), 'gcd ok').to.equal(1);\n\n    z = asmCrypto.BigNumber.extGCD(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          '100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n        ),\n      ),\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          'c7f1bc1dfb1be82d244aef01228c1409c198894eca9e21430f1669b4aa3864c9f37f3d51b2b4ba1ab9e80f59d267fda1521e88b05117993175e004543c6e3611242f24432ce8efa3b81f0ff660b4f91c5d52f2511a6f38181a7bf9abeef72db056508bbb4eeb5f65f161dd2d5b439655d2ae7081fcc62fdcb281520911d96700c85cdaf12e7d1f15b55ade867240722425198d4ce39019550c4c8a921fc231d3e94297688c2d77cd68ee8fdeda38b7f9a274701fef23b4eaa6c1a9c15b2d77f37634930386fc20ec291be95aed9956801e1c76601b09c413ad915ff03bfdc0b6b233686ae59e8caf11750b509ab4e57ee09202239baee3d6e392d1640185e1cd',\n        ),\n      ),\n    );\n    expect(z.gcd.valueOf(), 'gcd ok').to.equal(1);\n    expect(z.x.toString(16), 'x ok').to.equal(\n      '-210fc146c2f2919c3e9a4372a7221069fa359d7feba4ecaf765c47f29819a82ebb92c5944f921e090c8f0eee5218d243b35eb488fdef6a2f9712ba887625af9599b2a547595528054f079124831d94872243009cec4e3154199893d700c2a64c3fae1e259bd37b4f88e34a6ff0fcb7c221a9b222df4a74f4d381259c641cef4d05bbbc737ac29f06e050139aa823d00c2af2b484720a58eadc39ea10d53c8664289e5495fcb188abecb167c8b81a267a24fa304b447d484c37af38525f5c1c3c7bc9e614b779e21d582c0222fa8bc13bc37673cefbb60a84a70423dcec8850d6c3c80c244e09cee87e7f6dadaf24a2b9410bc31e1afc588f9d20d769a5c3df71',\n    );\n    expect(z.y.toString(16), 'y ok').to.equal(\n      '2a54a02a4b2182e2ea06578065a9608f53c45bd34ab2d3c47c18bca20e2bf9d93f6ac1aecc7a4bf18cfbc073db8cd0829b656bcb1f7a52b10bdc463ac246f11a30c0cc4ea00f093fcb0b4809a2b83bfb627789c6daac33d467a2b7bcda403018b344ca065fecccd2922afd53268ea599b17b96f29fe9fa4487cd0df93db31f3197a1973fafdd5f37a9f80f2554947ed63ffa4f12f0c5eefec24e9192ddcbc19ad179f76d95e361250300f18de3f7c9a067b84ccba3b31e1d1cf4379a492aa916882e09fa6836e3524b9bf750cf8f8dddbb48dd2ac0a9cfdfe6409330c0d62f08d13ec220436482bb39db9b1c595c5e0e0b743344620ac8eb0e18b0d3c641f305',\n    );\n  });\n\n  it('asmCrypto.Modulus', function() {\n    const M = new asmCrypto.Modulus(asmCrypto.BigNumber.fromNumber(123456789));\n\n    expect(M.reduce(asmCrypto.BigNumber.fromNumber(987654321)).valueOf(), 'Modulus.reduce(small)').to.equal(9);\n\n    const M2 = new asmCrypto.Modulus(asmCrypto.BigNumber.fromNumber(0xabcdabcdabcd));\n    expect(M2.comodulus.toString(16), 'M2 comodulus ok').to.equal('10000000000000000');\n    expect(M2.comodulusRemainder.toString(16), 'M2 comodulus remainder ok').to.equal('624f6250624f');\n    expect(M2.comodulusRemainderSquare.toString(16), 'M2 comodulus remainder square ok').to.equal('399f399e399e');\n    expect(M2.coefficient.toString(16), 'M2 coefficent ok').to.equal('1c58c6fb');\n\n    const M3 = new asmCrypto.Modulus(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          'c7f1bc1dfb1be82d244aef01228c1409c198894eca9e21430f1669b4aa3864c9f37f3d51b2b4ba1ab9e80f59d267fda1521e88b05117993175e004543c6e3611242f24432ce8efa3b81f0ff660b4f91c5d52f2511a6f38181a7bf9abeef72db056508bbb4eeb5f65f161dd2d5b439655d2ae7081fcc62fdcb281520911d96700c85cdaf12e7d1f15b55ade867240722425198d4ce39019550c4c8a921fc231d3e94297688c2d77cd68ee8fdeda38b7f9a274701fef23b4eaa6c1a9c15b2d77f37634930386fc20ec291be95aed9956801e1c76601b09c413ad915ff03bfdc0b6b233686ae59e8caf11750b509ab4e57ee09202239baee3d6e392d1640185e1cd',\n        ),\n      ),\n    );\n    expect(M3.comodulus.toString(16), 'M3 comodulus ok').to.be.equal(\n      '100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',\n    );\n    expect(M3.comodulusRemainder.toString(16), 'M3 comodulus remainder ok').to.equal(\n      '380e43e204e417d2dbb510fedd73ebf63e6776b13561debcf0e9964b55c79b360c80c2ae4d4b45e54617f0a62d98025eade1774faee866ce8a1ffbabc391c9eedbd0dbbcd317105c47e0f0099f4b06e3a2ad0daee590c7e7e58406541108d24fa9af7444b114a09a0e9e22d2a4bc69aa2d518f7e0339d0234d7eadf6ee2698ff37a3250ed182e0ea4aa521798dbf8ddbdae672b31c6fe6aaf3b3756de03dce2c16bd689773d288329711702125c748065d8b8fe010dc4b15593e563ea4d2880c89cb6cfc7903df13d6e416a51266a97fe1e3899fe4f63bec526ea00fc4023f494dcc97951a617350ee8af4af654b1a811f6dfddc64511c291c6d2e9bfe7a1e33',\n    );\n    expect(M3.comodulusRemainderSquare.toString(16), 'M3 comodulus remainder square ok').to.equal(\n      'a8d0cc3c0069b1fe694294247f367071deb9b3fdc80824536f04fae0c3df7fccc9f856aeee2033803b371a3c455522fb288c60f326db2fdcaf7452b48b0f0a29cce2dabe844a63f8077be24d2a0db5051e8a1481c16f0b880819cf8d193adaa79c92f11f1e4a2e89f24bc0ef0e2285ff218a5c058908f6feef024b0c8bfe11d37cba38103339f19ba7466f3070588152f1a008dc454cebcc4f70879e94ac1eb26179833049da7b450fbe93d7d802edc5900b3a973d05ff76c6bbb7914c59b27265222501b14497fe0ef99b7fa67777bf9ab89a8b346aacb6dbf606e68da0ba2a5c4ce3b0f85225292cd1acafebae5f553c03e9c3857730c715017550e4e77a53',\n    );\n    expect(M3.coefficient.toString(16), 'M3 coefficent ok').to.equal('39be0cfb');\n\n    const M4 = new asmCrypto.Modulus(\n      new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes(\n          '453b5e276054110d94fd7b413ca54e467543c28168730315dae65c6241c847aa7ca16aa99e84e89249addf73bdb326cb7787a667cce65537cd0be7a3564f40fecace8bd6eac901013d5cd5dc28ec9415defff41e30b495bf269472e66e163493403396b14e27c1c9697e90a6274ea8dfda5bcf94d014ed7fa9c64174c78deb2ca1222521f161eafa0752dddecb31c76968929a42669174c9839b97036a2371b5d1466fe5549e53bcc7f30f7ba676950bd7a751e9e916c6525f49bf3046903ff738c5b0514ffe375ba9fe41bb766daf5973ca1d7782d84628e59b3dfa14d7c86fb3d62a219176e84e17d6fae34faa461094ae0ffd9631dd49c9138f6691a1a854',\n        ),\n      ),\n    );\n    expect(\n      M4.inverse(\n        new asmCrypto.BigNumber(\n          asmCrypto.hex_to_bytes(\n            '145cc156e018b9b8b3599cb8d59a07f69af5cfcbb54f00e84f70edfec80dbab9ac2f79b96adbcbeeca6050c7b043c01db9be7c3ca5ad281f788b07e4bf08404af05addd5cc9578c4211b4df57572c2248ce1de633b806847479512bc3e7f00678b5a779d8f751ae0e2cadf3fed717cf68b846a3ad3c9eb7fe6a3b8e61c93270d2055563728e09067a7cd141459e176e2c4675a8c000ca9e0ea790e4c4c64c7175bab4e16461072fb49de139cd69b59037ba9aeae357f2b456751ecf014c103c12ed0bb6335a51f5731ff7cbeaa5c7ede12ff35d7db308d1b165ad5fe425d954e07b775cda34117260702fe7f176e50d7b34240f03b3bd7ac4a32edf0fda80455',\n          ),\n        ),\n      ).toString(16),\n      'M4 inverse OK',\n    ).to.equal('11');\n\n    const M5 = new asmCrypto.Modulus(new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('0aabbccddaabbccdd')));\n    expect(\n      M5.reduce(new asmCrypto.BigNumber(asmCrypto.hex_to_bytes('1aabbccddaabbccdd'))).toString(16),\n      'M5 reduce ok',\n    ).to.equal('5544332255443323');\n  });\n\n  it('asmCrypto.Modulus.power', function() {\n    const base = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '3f70f29d3f3ae354a6d2536ceafba83cfc787cd91e7acd2b6bde05e62beb8295ae18e3f786726f8d034bbc15bf8331df959f59d431736d5f306aaba63dacec279484e39d76db9b527738072af15730e8b9956a64e8e4dbe868f77d1414a8a8b8bf65380a1f008d39c5fabe1a9f8343929342ab7b4f635bdc52532d764701ff3d8072c475c012ff0c59373e8bc423928d99f58c3a6d9f6ab21ee20bc8e8818fc147db09f60c81906f2c6f73dc69725f075853a89f0cd02a30a8dd86b660ccdeffc292f398efb54088c822774445a6afde471f7dd327ef9996296898a5747726ccaeeceeb2e459df98b4128cb5ab8c7cd20c563f960a1aa770f3c81f13f967b6cc',\n      ),\n    );\n    const modulus = new asmCrypto.Modulus(\n        new asmCrypto.BigNumber(\n          asmCrypto.hex_to_bytes(\n            'c7f1bc1dfb1be82d244aef01228c1409c198894eca9e21430f1669b4aa3864c9f37f3d51b2b4ba1ab9e80f59d267fda1521e88b05117993175e004543c6e3611242f24432ce8efa3b81f0ff660b4f91c5d52f2511a6f38181a7bf9abeef72db056508bbb4eeb5f65f161dd2d5b439655d2ae7081fcc62fdcb281520911d96700c85cdaf12e7d1f15b55ade867240722425198d4ce39019550c4c8a921fc231d3e94297688c2d77cd68ee8fdeda38b7f9a274701fef23b4eaa6c1a9c15b2d77f37634930386fc20ec291be95aed9956801e1c76601b09c413ad915ff03bfdc0b6b233686ae59e8caf11750b509ab4e57ee09202239baee3d6e392d1640185e1cd',\n          ),\n        ),\n      ),\n      exponent = new asmCrypto.BigNumber(\n        asmCrypto.hex_to_bytes('322e393f76a1c22b147e7d193c00c023afb7c1500b006ff1bc1cc8d391fc38bd'),\n      );\n\n    expect(modulus.power(base, exponent).toString(16), 'Modulus.power ok').to.equal(\n      '5b3823974b3eda87286d3f38499de290bd575d8b02f06720acacf3d50950f9ca0ff6b749f3be03913ddca0b291e0b263bdab6c9cb97e4ab47ee9c235ff20931a8ca358726fab93614e2c549594f5c50b1c979b34f840b6d4fc51d6feb2dd072995421d17862cb405e040fc1ed662a3245a1f97bbafa6d1f7f76c7db6a802e3037acdf01ab5053f5da518d6753477193b9c25e1720519dcb9e2f6e70d5786656d356151845a49861dfc40187eff0e85cd18b1f3f3b97c476472edfa090b868b2388edfffecc521c20df8cebb8aacfb3669b020330dd6ea64b2a3067a972b8f249bccc19347eff43893e916f0949bd5789a5cce0f8b7cd87cece909d679345c0d4',\n    );\n  });\n\n  it('asmCrypto.isProbablePrime', function() {\n    const p = new asmCrypto.BigNumber(\n      asmCrypto.hex_to_bytes(\n        '8844ae66464b4b7db53644be87617124f314a1d8243d347867c8cfd6afb595bdb88ce63538fbd6c3f8461133d77ed4f5ef403f48c65b7340c683839c00bc7874bff3e9ffe7916a3ca085c7096f31871f2d628198f9c1deaeaefa581ebaef834a89afdf663b9570287a257bd6e4f507cede3b31eda6bd7fd4f8ae3c5b8791d89f',\n      ),\n    );\n    expect(p.isProbablePrime(), 'p is probable prime').to.be.true;\n  });\n});\n"
  },
  {
    "path": "test/rsa.js",
    "content": "import * as asmCrypto from '../asmcrypto.all.es8';\nimport chai from 'chai';\nconst expect = chai.expect;\n\nconst pubKey = [\n  asmCrypto.hex_to_bytes(\n    'c13f894819c136381a94c193e619851ddfcde5eca770003ec354f3142e0f61f0676d7d4215cc7a13b06e0744aa8316c9c3766cbefa30b2346fba8f1236d7e6548cf87d9578e6904fc4291e096a2737fcd96624f72e762793505f9dfc5fa17b44611add54f5c00bf54373d720cb6f4e5cabae36c4442b39dbf49158414547f453',\n  ),\n  asmCrypto.hex_to_bytes('10001'),\n];\n\nconst privkey = [\n  asmCrypto.hex_to_bytes(\n    'c13f894819c136381a94c193e619851ddfcde5eca770003ec354f3142e0f61f0676d7d4215cc7a13b06e0744aa8316c9c3766cbefa30b2346fba8f1236d7e6548cf87d9578e6904fc4291e096a2737fcd96624f72e762793505f9dfc5fa17b44611add54f5c00bf54373d720cb6f4e5cabae36c4442b39dbf49158414547f453',\n  ),\n  asmCrypto.hex_to_bytes('10001'),\n  asmCrypto.hex_to_bytes(\n    '75497aa8a7f8fc4f50d2b82a6b9d518db027e7449adaff4b18829685c8eecd227ba3984263b896df1c55ab53a1a9ae4b06b6f9896f8fde98b4b725de882ac13fc11b614cb2cc81bcc69b9ad167dda093c5c6637754acd0ec9e9845b1b2244d597c9f63d7ea076bda19feadcdb3bd1ba9018915fec981657fb7a4301cb87a3e1',\n  ),\n  asmCrypto.hex_to_bytes(\n    'ef2f8d91d7cd96710d6b3b5ea1b6762b4214efe329e7d0609ab8419744ef8620391e423d5890c864aebb36c0daf5035d27f3427e6a84fde36466a14b56ad1cfb',\n  ),\n  asmCrypto.hex_to_bytes(\n    'ced5477e0acb9c836c3c54e33268e064ce8cdfd40452c8b87ab838b36b498ae22fdbdb331f59f61dd3ca1512143e77a68f8f2400dbe9e576a000084e6fcbb689',\n  ),\n  asmCrypto.hex_to_bytes(\n    '227882f9a2d5513a27c9ed7b7ce8d3ecf61018666fb2a5f85633f9d7f82a60f521e6377ba9d8ebd87eca2260f6ed5ab7c13b30b91156eb542b331349cd4b13a3',\n  ),\n  asmCrypto.hex_to_bytes(\n    '4dea2a3460fcb2c90f4ceaed6b5ff6a802e72eaa3fb6afc64ef476e79fd2e46eb078b1ea60351371c906a7495836effbdeb89d67757076f068f59a2b7211db81',\n  ),\n  asmCrypto.hex_to_bytes(\n    '261a93613a93e438fa62858758d1db3b3db8366319517c039acfcc0ce04cd0d7349d7e8d8cb0e8a05ac966d04c18c81c49025de2b50bb87f78facccd19cd8602',\n  ),\n];\n\ndescribe('RSA', () => {\n  it('asmCrypto.RSA.privateKey', function() {\n    const m = new asmCrypto.Modulus(new asmCrypto.BigNumber(privkey[0]));\n    const e = new asmCrypto.BigNumber(privkey[1]);\n    const d = new asmCrypto.BigNumber(privkey[2]);\n    const p = new asmCrypto.BigNumber(privkey[3]);\n    const q = new asmCrypto.BigNumber(privkey[4]);\n    const dp = new asmCrypto.BigNumber(privkey[5]);\n    const dq = new asmCrypto.BigNumber(privkey[6]);\n    const qi = new asmCrypto.BigNumber(privkey[7]);\n\n    expect(p.multiply(q).toString(16), 'm == p*q').to.equal(m.toString(16));\n    expect(\n      e\n        .multiply(d)\n        .divide(p.subtract(asmCrypto.BigNumber.fromNumber(1)).multiply(q.subtract(asmCrypto.BigNumber.fromNumber(1))))\n        .remainder.toString(16),\n      'e*d == 1 mod (p-1)(q-1)',\n    ).to.equal('1');\n    expect(\n      d.divide(p.subtract(asmCrypto.BigNumber.fromNumber(1))).remainder.toString(16),\n      'dp == d mod (p-1)',\n    ).to.equal(dp.toString(16));\n    expect(\n      d.divide(q.subtract(asmCrypto.BigNumber.fromNumber(1))).remainder.toString(16),\n      'dq == d mod (q-1)',\n    ).to.equal(dq.toString(16));\n    expect(\n      qi\n        .multiply(q)\n        .divide(p)\n        .remainder.toString(16),\n      'qi*q == 1 mod p',\n    ).to.equal('1');\n    expect(m.slice(m.bitLength - 1).valueOf(), 'm highest bit is 1').to.equal(1);\n  });\n});\n\ndescribe('RSA-OAEP', () => {\n  it('asmCrypto.RSA_OAEP_SHA256 encrypt/decrypt', function() {\n    const cleartext = asmCrypto.string_to_bytes('HelloWorld!');\n    const rsaOaepEnc = new asmCrypto.RSA_OAEP(pubKey, new asmCrypto.Sha256(), asmCrypto.string_to_bytes('test'));\n    const rsaOaepDec = new asmCrypto.RSA_OAEP(privkey, new asmCrypto.Sha256(), asmCrypto.string_to_bytes('test'));\n\n    const ciphertext = rsaOaepEnc.encrypt(cleartext);\n\n    const result = rsaOaepDec.decrypt(ciphertext);\n    expect(asmCrypto.bytes_to_string(result), 'decrypt').to.equal('HelloWorld!');\n  });\n});\n\ndescribe('RSA-PSS-SHA256', () => {\n  it('asmCrypto.RSA_PSS_SHA256 sign/verify', function() {\n    const text = 'HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!';\n    const rsaPssSign = new asmCrypto.RSA_PSS(privkey, new asmCrypto.Sha256());\n    const rsaPssVerify = new asmCrypto.RSA_PSS(pubKey, new asmCrypto.Sha256());\n\n    const signature = rsaPssSign.sign(asmCrypto.string_to_bytes(text));\n    rsaPssVerify.verify(signature, asmCrypto.string_to_bytes(text));\n  });\n\n  it('asmCrypto.RSA_PSS_SHA256 sign/verify with non-default salt length', function() {\n    const text = 'HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!';\n    const rsaPssSign = new asmCrypto.RSA_PSS(privkey, new asmCrypto.Sha256(), 32);\n    const rsaPssVerify = new asmCrypto.RSA_PSS(pubKey, new asmCrypto.Sha256(), 32);\n\n    const signature = rsaPssSign.sign(asmCrypto.string_to_bytes(text));\n    rsaPssVerify.verify(signature, asmCrypto.string_to_bytes(text));\n  });\n\n  it('asmCrypto.RSA_PSS_SHA256 sign/verify with salt length mismatch', function() {\n    const text = 'HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!';\n    const rsaPssSign = new asmCrypto.RSA_PSS(privkey, new asmCrypto.Sha256(), 4);\n    const rsaPssVerify = new asmCrypto.RSA_PSS(pubKey, new asmCrypto.Sha256(), 32);\n\n    const signature = rsaPssSign.sign(asmCrypto.string_to_bytes(text));\n    expect(() => rsaPssVerify.verify(signature, asmCrypto.string_to_bytes(text))).to.throw;\n  });\n\n  it('asmCrypto.RSA_PSS_SHA256 sign/verify with default salt length mismatch', function() {\n    const text = 'HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!';\n    const rsaPssSign = new asmCrypto.RSA_PSS(privkey, new asmCrypto.Sha256(), 32);\n    const rsaPssVerify = new asmCrypto.RSA_PSS(pubKey, new asmCrypto.Sha256());\n\n    const signature = rsaPssSign.sign(asmCrypto.string_to_bytes(text));\n    expect(() => rsaPssVerify.verify(signature, asmCrypto.string_to_bytes(text))).to.throw;\n  });\n\n  it('asmCrypto.RSA_PSS_SHA512 sign/verify', function() {\n    const text = 'HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!';\n    const rsaPssSign = new asmCrypto.RSA_PSS(privkey, new asmCrypto.Sha512());\n    const rsaPssVerify = new asmCrypto.RSA_PSS(pubKey, new asmCrypto.Sha512());\n\n    const signature = rsaPssSign.sign(asmCrypto.string_to_bytes(text));\n    rsaPssVerify.verify(signature, asmCrypto.string_to_bytes(text));\n  });\n\n  // This requires a RSA2048 key instead of RSA1024\n  it.skip('asmCrypto.RSA_PSS_SHA512 sign/verify with non-default salt length', function() {\n    const text = 'HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!HelloWorld!';\n    const rsaPssSign = new asmCrypto.RSA_PSS(privkey, new asmCrypto.Sha512(), 64);\n    const rsaPssVerify = new asmCrypto.RSA_PSS(pubKey, new asmCrypto.Sha512(), 64);\n\n    const signature = rsaPssSign.sign(asmCrypto.string_to_bytes(text));\n    rsaPssVerify.verify(signature, asmCrypto.string_to_bytes(text));\n  });\n\n  it('asmCrypto.RSA_PSS_SHA256 verify OpenSSL-signed-data', function() {\n    const key = [\n      asmCrypto.hex_to_bytes(\n        'f30be5ce8941c8e6e764c78d12f3ce6e02a0dea03577bc0c16029de258321b74ceb43ea94f768aec900011c78eb247ab0e94b4477ea8f086ba7b5ce4b03c0ad7e0bf2f54ed509a536a0f179e27db539f729b38a279873f7b3a360690c8390e289dedca6da1ba232d8edc3c1eb229e1072716ddf3ef88caf4a824c152d6ad38f1',\n      ),\n      asmCrypto.hex_to_bytes('10001'),\n      /*\n            asmCrypto.hex_to_bytes('a2f4032c2ad2b4843bf851e2c0263eed7b4da875f9e3416d4904901ec5cb32a56a416711d5794143c278897326b5595fd2f2d8bc66ab96387ea75f6ce4cc1ce7ba0269a49ce03eb4aea16ca914938e88e5398b10b314276ba9f3f2e448a5f643515ee591cb4c4c5270edccacf7e5b88f86a0c08dc05311513a4ed01802de2511'),\n            asmCrypto.hex_to_bytes('fc592285e370d57900bfd2f8c66b15274b3381ca7ec485091d5aa0092ca8f2b97f8796e608a2fc6aa1df3647b10198c49801e3201fefa72ef9d7ccafcdae5d37'),\n            asmCrypto.hex_to_bytes('f6904d99d7cf9f1237c6798e5343fe730149be31e0363bf33039af84a09b5e9d0dd71239384b6cf6421e4ad41097b2cd09fd0114eb29a4339c433f37d7286f17'),\n            asmCrypto.hex_to_bytes('252e1ce00d3abab9315b12028579918c50902e375fa624d3caf7674cf2bf91c3b2fe8f4525509e5037b9638dfc8e77abbf99c7951c1f7b4a78954b1b3bfaccd1'),\n            asmCrypto.hex_to_bytes('9f036da89c10208cc53fd14142de0509f278b69abff8fa2cda9b3961159b5e2777b78edf2c3928aaa0f59c58abe2c9c3867f8ee508ccb04340b1f5e17377763d'),\n            asmCrypto.hex_to_bytes('c07e9ca15c2cc38cc4faab0729403e02b33982b7d1219e15cd74614f3485437d2c800d66a0c368b3cf36513e4b1e05d31d7e0186f00cf036433e35f13b5cfda8')\n*/\n    ];\n\n    const text = 'Hello There!';\n\n    const signature = asmCrypto.hex_to_bytes(\n      'A68BE713861409B4E536C12066B3D30650C7578F9B7AB61C1A302B42ECA14D58AE11899BC55FCB838F0AE06B99381DE26CE8D6318BD59BBFC4FFF56A995E9EFB0306FF105766F508297D1E74F22648B6BD66C18E06F4748BD258358ECB5BB722AC4AFFA146C04EE7BE84AD77ED2A84B5458D6CA4A7DA4D86DAB3F2B39FD647F4',\n    );\n\n    const saltlen = 32;\n\n    const rsaPss = new asmCrypto.RSA_PSS(key, new asmCrypto.Sha256(), saltlen);\n    rsaPss.verify(signature, asmCrypto.string_to_bytes(text));\n  });\n});\n"
  },
  {
    "path": "test/sha1.js",
    "content": "import * as asmCrypto from '../asmcrypto.all.es8';\nimport chai from 'chai';\nconst expect = chai.expect;\n\ndescribe('SHA1', () => {\n  const sha1_vectors = [\n    ['a9993e364706816aba3e25717850c26c9cd0d89d', asmCrypto.string_to_bytes('abc')],\n    ['84983e441c3bd26ebaae4aa1f95129e5e54670f1', asmCrypto.string_to_bytes('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq')],\n    [\n      'a49b2446a02c645bf419f995b67091253a04a259',\n      asmCrypto.string_to_bytes('abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu'),\n    ],\n    ['2fd4e1c67a2d28fced849ee1bb76e7391b93eb12', asmCrypto.string_to_bytes('The quick brown fox jumps over the lazy dog')],\n    ['de9f2c7fd25e1b3afad3e85a0bd17d9b100db4b3', asmCrypto.string_to_bytes('The quick brown fox jumps over the lazy cog')],\n  ];\n\n  it('asmCrypto.SHA1.hex', function() {\n    for (let i = 0; i < sha1_vectors.length; ++i) {\n      const sha1 = new asmCrypto.Sha1();\n      expect(asmCrypto.bytes_to_hex(sha1.process(sha1_vectors[i][1]).finish().result), 'vector ' + i).to.equal(\n        sha1_vectors[i][0],\n      );\n    }\n  });\n});\n\ndescribe('HMAC-SHA1', () => {\n  const hmac_sha1_vectors = [\n    [\n      '5fd596ee78d5553c8ff4e72d266dfd192366da29',\n      asmCrypto.hex_to_bytes(\n        '000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f',\n      ),\n      asmCrypto.hex_to_bytes('53616d706c65206d65737361676520666f72206b65796c656e3d626c6f636b6c656e'),\n    ],\n    ['fbdb1d1b18aa6c08324b7d64b71fb76370690e1d', asmCrypto.string_to_bytes(''), asmCrypto.string_to_bytes('')],\n    [\n      'de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9',\n      asmCrypto.string_to_bytes('key'),\n      asmCrypto.string_to_bytes('The quick brown fox jumps over the lazy dog'),\n    ],\n    [\n      'b617318655057264e28bc0b6fb378c8ef146be00',\n      asmCrypto.hex_to_bytes('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b'),\n      asmCrypto.string_to_bytes('Hi There'),\n    ],\n    [\n      'effcdf6ae5eb2fa2d27416d5f184df9c259a7c79',\n      asmCrypto.string_to_bytes('Jefe'),\n      asmCrypto.string_to_bytes('what do ya want for nothing?'),\n    ],\n  ];\n\n  it('asmCrypto.HMAC_SHA1.hex', function() {\n    for (let i = 0; i < hmac_sha1_vectors.length; ++i) {\n      const hmacSha1 = new asmCrypto.HmacSha1(hmac_sha1_vectors[i][1]);\n\n      expect(asmCrypto.bytes_to_hex(hmacSha1.process(hmac_sha1_vectors[i][2]).finish().result), 'vector ' + i).to.equal(\n        hmac_sha1_vectors[i][0],\n      );\n    }\n  });\n});\n\ndescribe('PBKDF2-HMAC-SHA1', function () {\n  this.timeout(30000);\n  const pbkdf2_hmac_sha1_vectors = [\n    [\n      '0c60c80f961f0e71f3a9b524af6012062fe037a6',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      1,\n      20,\n    ],\n    [\n      'ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      2,\n      20,\n    ],\n    [\n      '4b007901b765489abead49d926f721d065a429c1',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      4096,\n      20,\n    ],\n    [\n      'eefe3d61cd4da4e4e9945b3d6ba2158c2634e984',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      16777216,\n      20,\n    ],\n    [\n      '3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038',\n      asmCrypto.string_to_bytes('passwordPASSWORDpassword'),\n      asmCrypto.string_to_bytes('saltSALTsaltSALTsaltSALTsaltSALTsalt'),\n      4096,\n      25,\n    ],\n    [\n      '56fa6aa75548099dcc37d7f03425e0c3',\n      asmCrypto.string_to_bytes('pass\\0word'),\n      asmCrypto.string_to_bytes('sa\\0lt'),\n      4096,\n      16,\n    ],\n  ];\n\n  it('asmCrypto.PBKDF2_HMAC_SHA1.hex', function() {\n    for (let i = 0; i < pbkdf2_hmac_sha1_vectors.length; ++i) {\n      expect(\n        // got\n        asmCrypto.bytes_to_hex(\n          asmCrypto.Pbkdf2HmacSha1(\n            pbkdf2_hmac_sha1_vectors[i][1], // password\n            pbkdf2_hmac_sha1_vectors[i][2], // salt\n            pbkdf2_hmac_sha1_vectors[i][3], // count\n            pbkdf2_hmac_sha1_vectors[i][4], // dklen\n          ),\n        ),\n\n        \"asmCrypto.PBKDF2_HMAC_SHA1.hex('\" +\n          pbkdf2_hmac_sha1_vectors[i][1] +\n          \"', '\" +\n          pbkdf2_hmac_sha1_vectors[i][2] +\n          \"', '\" +\n          pbkdf2_hmac_sha1_vectors[i][3] +\n          \"', '\" +\n          pbkdf2_hmac_sha1_vectors[i][4] +\n          \"') is equal to '\" +\n          pbkdf2_hmac_sha1_vectors[i][0] +\n          \"'\",\n      ).to.equal(pbkdf2_hmac_sha1_vectors[i][0]);\n    }\n  });\n});\n"
  },
  {
    "path": "test/sha256.js",
    "content": "import * as asmCrypto from '../asmcrypto.all.es8';\nimport chai from 'chai';\nconst expect = chai.expect;\n\ndescribe('SHA256', () => {\n  const sha256_vectors = [\n    ['e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855', asmCrypto.string_to_bytes('')],\n    ['ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad', asmCrypto.string_to_bytes('abc')],\n    ['f7846f55cf23e14eebeab5b4e1550cad5b509e3348fbc4efa3a1413d393cb650', asmCrypto.string_to_bytes('message digest')],\n    [\n      'f30ceb2bb2829e79e4ca9753d35a8ecc00262d164cc077080295381cbd643f0d',\n      asmCrypto.string_to_bytes('secure hash algorithm'),\n    ],\n    [\n      '6819d915c73f4d1e77e4e1b52d1fa0f9cf9beaead3939f15874bd988e2a23630',\n      asmCrypto.string_to_bytes('SHA256 is considered to be safe'),\n    ],\n    [\n      '248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1',\n      asmCrypto.string_to_bytes('abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq'),\n    ],\n    [\n      'f08a78cbbaee082b052ae0708f32fa1e50c5c421aa772ba5dbb406a2ea6be342',\n      asmCrypto.string_to_bytes('For this sample, this 63-byte string will be used as input data'),\n    ],\n    [\n      'ab64eff7e88e2e46165e29f2bce41826bd4c7b3552f6b382a9e7d3af47c245f8',\n      asmCrypto.string_to_bytes('This is exactly 64 bytes long, not counting the terminating byte'),\n    ],\n  ];\n\n  it('asmCrypto.SHA256.hex', function() {\n    for (let i = 0; i < sha256_vectors.length; ++i) {\n      const sha256 = new asmCrypto.Sha256();\n      expect(asmCrypto.bytes_to_hex(sha256.process(sha256_vectors[i][1]).finish().result), 'vector ' + i).to.equal(\n        sha256_vectors[i][0],\n      );\n    }\n  });\n});\ndescribe('HMAC-SHA256', () => {\n  const hmac_sha256_vectors = [\n    [\n      'b613679a0814d9ec772f95d778c35fc5ff1697c493715653c6c712144292c5ad',\n      asmCrypto.string_to_bytes(''),\n      asmCrypto.string_to_bytes(''),\n    ],\n    [\n      'f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8',\n      asmCrypto.string_to_bytes('key'),\n      asmCrypto.string_to_bytes('The quick brown fox jumps over the lazy dog'),\n    ],\n    [\n      'b54d57e9b21940b6496b58d5ac120eda9f1637788b5df058928637f2eca40cd9',\n      asmCrypto.string_to_bytes('MyVeeeeeeeeeeeeeryVeeeeeeeeeeeeeryVeeeeeeeeeeeeeryLoooooooooongPassword'),\n      asmCrypto.string_to_bytes('Lorem ipsum dolor sit amet, consectetur adipiscing elit.'),\n    ],\n  ];\n\n  it('asmCrypto.HMAC_SHA256.hex', function() {\n    for (let i = 0; i < hmac_sha256_vectors.length; ++i) {\n      const hmacSha256 = new asmCrypto.HmacSha256(hmac_sha256_vectors[i][1]);\n      expect(\n        asmCrypto.bytes_to_hex(hmacSha256.process(hmac_sha256_vectors[i][2]).finish().result),\n        'vector ' + i,\n      ).to.equal(hmac_sha256_vectors[i][0]);\n    }\n  });\n});\ndescribe('PBKDF2-HMAC-SHA256', () => {\n  const pbkdf2_hmac_sha256_vectors = [\n    [\n      '120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      1,\n      32,\n    ],\n    [\n      'ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      2,\n      32,\n    ],\n    [\n      'c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134a',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      4096,\n      32,\n    ],\n    [\n      '348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9',\n      asmCrypto.string_to_bytes('passwordPASSWORDpassword'),\n      asmCrypto.string_to_bytes('saltSALTsaltSALTsaltSALTsaltSALTsalt'),\n      4096,\n      40,\n    ],\n    [\n      '89b69d0516f829893c696226650a8687',\n      asmCrypto.string_to_bytes('pass\\0word'),\n      asmCrypto.string_to_bytes('sa\\0lt'),\n      4096,\n      16,\n    ],\n    [\n      'cdc8b1780ca68aba97f1f729c9d281719702eb4b308d7d87409817e60188be0d',\n      asmCrypto.string_to_bytes('MyVeeeeeeeeeeeeeryVeeeeeeeeeeeeeryVeeeeeeeeeeeeeryLoooooooooongPassword'),\n      asmCrypto.string_to_bytes('MyVeeeeeeeeeeeeeryVeeeeeeeeeeeeeryVeeeeeeeeeeeeeryLoooooooooongPassword'),\n      4096,\n      32,\n    ],\n  ];\n\n  it('asmCrypto.PBKDF2_HMAC_SHA256.hex', function() {\n    for (let i = 0; i < pbkdf2_hmac_sha256_vectors.length; ++i) {\n      expect(\n        // got\n        asmCrypto.bytes_to_hex(asmCrypto.Pbkdf2HmacSha256(\n          pbkdf2_hmac_sha256_vectors[i][1], // password\n          pbkdf2_hmac_sha256_vectors[i][2], // salt\n          pbkdf2_hmac_sha256_vectors[i][3], // count\n          pbkdf2_hmac_sha256_vectors[i][4], // dklen\n        )),\n        \"asmCrypto.PBKDF2_HMAC_SHA256.hex('\" +\n          pbkdf2_hmac_sha256_vectors[i][1] +\n          \"', '\" +\n          pbkdf2_hmac_sha256_vectors[i][2] +\n          \"', '\" +\n          pbkdf2_hmac_sha256_vectors[i][3] +\n          \"', '\" +\n          pbkdf2_hmac_sha256_vectors[i][4] +\n          \"') is equal to '\" +\n          pbkdf2_hmac_sha256_vectors[i][0] +\n          \"'\",\n      ).to.equal(pbkdf2_hmac_sha256_vectors[i][0]);\n    }\n  });\n});\n"
  },
  {
    "path": "test/sha512.js",
    "content": "import * as asmCrypto from '../asmcrypto.all.es8';\nimport chai from 'chai';\nconst expect = chai.expect;\n\ndescribe('SHA512', () => {\n  const sha512_vectors = [\n    [\n      'cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e',\n      asmCrypto.string_to_bytes(''),\n    ],\n    [\n      'ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f',\n      asmCrypto.string_to_bytes('abc'),\n    ],\n    [\n      '8e959b75dae313da8cf4f72814fc143f8f7779c6eb9f7fa17299aeadb6889018501d289e4900f7e4331b99dec4b5433ac7d329eeb6dd26545e96e55b874be909',\n      asmCrypto.string_to_bytes(\n        'abcdefghbcdefghicdefghijdefghijkefghijklfghijklmghijklmnhijklmnoijklmnopjklmnopqklmnopqrlmnopqrsmnopqrstnopqrstu',\n      ),\n    ],\n    [\n      '07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6',\n      asmCrypto.string_to_bytes('The quick brown fox jumps over the lazy dog'),\n    ],\n    [\n      '91ea1245f20d46ae9a037a989f54f1f790f0a47607eeb8a14d12890cea77a1bbc6c7ed9cf205e67b7f2b8fd4c7dfd3a7a8617e45f3c463d481c7e586c39ac1ed',\n      asmCrypto.string_to_bytes('The quick brown fox jumps over the lazy dog.'),\n    ],\n  ];\n\n  it('asmCrypto.SHA512.hex', function() {\n    for (let i = 0; i < sha512_vectors.length; ++i) {\n      const sha512 = new asmCrypto.Sha512();\n      expect(asmCrypto.bytes_to_hex(sha512.process(sha512_vectors[i][1]).finish().result), 'vector ' + i).to.equal(\n        sha512_vectors[i][0],\n      );\n    }\n  });\n});\ndescribe('HMAC-SHA512', () => {\n  const hmac_sha512_vectors = [\n    [\n      '87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854',\n      asmCrypto.hex_to_bytes('0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b'),\n      asmCrypto.string_to_bytes('Hi There'),\n    ],\n    [\n      '164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737',\n      asmCrypto.string_to_bytes('Jefe'),\n      asmCrypto.string_to_bytes('what do ya want for nothing?'),\n    ],\n    [\n      '80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598',\n      asmCrypto.hex_to_bytes(\n        'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',\n      ),\n      asmCrypto.string_to_bytes('Test Using Larger Than Block-Size Key - Hash Key First'),\n    ],\n  ];\n\n  it('asmCrypto.HMAC_SHA512.hex', function() {\n    for (let i = 0; i < hmac_sha512_vectors.length; ++i) {\n      const hmacSha512 = new asmCrypto.HmacSha512(hmac_sha512_vectors[i][1]);\n      expect(\n        asmCrypto.bytes_to_hex(hmacSha512.process(hmac_sha512_vectors[i][2]).finish().result),\n        'vector ' + i,\n      ).to.equal(hmac_sha512_vectors[i][0]);\n    }\n  });\n});\ndescribe('PBKDF2-HMAC-SHA512', () => {\n  const pbkdf2_hmac_sha512_vectors = [\n    [\n      '867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fce',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      1,\n      64,\n    ],\n    [\n      '867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fce',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      1,\n      64,\n    ],\n    [\n      'e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82be67335c77a6068e04112754f27ccf4e',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      2,\n      64,\n    ],\n    [\n      'd197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f87f6902e072f457b5143f30602641b3d55cd335988cb36b84376060ecd532e039b742a239434af2d5',\n      asmCrypto.string_to_bytes('password'),\n      asmCrypto.string_to_bytes('salt'),\n      4096,\n      64,\n    ],\n    [\n      '8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868c005174dc4ee71115b59f9e60cd9532fa33e0f75aefe30225c583a186cd82bd4daea9724a3d3b8',\n      asmCrypto.string_to_bytes('passwordPASSWORDpassword'),\n      asmCrypto.string_to_bytes('saltSALTsaltSALTsaltSALTsaltSALTsalt'),\n      4096,\n      64,\n    ],\n  ];\n\n  it('asmCrypto.PBKDF2_HMAC_SHA512.hex', function() {\n    for (let i = 0; i < pbkdf2_hmac_sha512_vectors.length; ++i) {\n      expect(\n        // got\n        asmCrypto.bytes_to_hex(\n          asmCrypto.Pbkdf2HmacSha512(\n            pbkdf2_hmac_sha512_vectors[i][1], // password\n            pbkdf2_hmac_sha512_vectors[i][2], // salt\n            pbkdf2_hmac_sha512_vectors[i][3], // count\n            pbkdf2_hmac_sha512_vectors[i][4], // dklen\n          ),\n        ),\n        \"asmCrypto.PBKDF2_HMAC_SHA512.hex('\" +\n          pbkdf2_hmac_sha512_vectors[i][1] +\n          \"', '\" +\n          pbkdf2_hmac_sha512_vectors[i][2] +\n          \"', '\" +\n          pbkdf2_hmac_sha512_vectors[i][3] +\n          \"', '\" +\n          pbkdf2_hmac_sha512_vectors[i][4] +\n          \"') is expect to '\" +\n          pbkdf2_hmac_sha512_vectors[i][0] +\n          \"'\",\n      ).to.equal(pbkdf2_hmac_sha512_vectors[i][0]);\n    }\n  });\n});\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n  \"compilerOptions\": {\n    \"module\": \"ES6\",\n    \"target\": \"es2017\",\n    \"lib\": [\"es5\", \"dom\", \"dom.iterable\", \"es6\"],\n    \"noEmit\": false,\n    \"noEmitOnError\": true,\n    \"strict\": true,\n    \"sourceMap\": false,\n    \"declaration\": true,\n    \"noUnusedLocals\": true,\n    \"noUnusedParameters\": true,\n    \"outDir\": \"dist_es8\"\n  },\n  \"include\": [\n    \"src/**/*.ts\"\n  ],\n  \"exclude\": [\n    \"node_modules\"\n  ],\n  \"files\": [\n    \"src/entry-export_all.ts\"\n  ]\n}\n"
  },
  {
    "path": "tslint.json",
    "content": "{\n  \"extends\": [\"tslint-plugin-prettier\"],\n  \"rules\": {\n    \"prettier\": true\n  }\n}\n"
  }
]