tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

regress-501124.js (1130B)


      1 /* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 //-----------------------------------------------------------------------------
      7 var BUGNUMBER = 501124;
      8 var summary = 'Crypotographic login routines';
      9 var actual = '';
     10 var expect = '';
     11 
     12 
     13 //-----------------------------------------------------------------------------
     14 test();
     15 //-----------------------------------------------------------------------------
     16 
     17 function test()
     18 {
     19  printBugNumber(BUGNUMBER);
     20  printStatus (summary);
     21 
     22 
     23  var hexVal = "00000000000000000000000000000000DEADBABE";
     24  var nblk   = (((hexVal.length/2) + 8) >> 6) + 1;
     25 
     26  var blks = new Array(nblk * 16);
     27 
     28  for(var i = 0; i < nblk * 16; i++)
     29    blks[i] = 0;
     30 
     31  for(i = 0; i < hexVal.length; i++) {
     32    blks[i >> 3] |= ("0x"+hexVal.charAt(i)) << (28 - (i % 8) * 4);
     33  }
     34 
     35  expect = '0,0,0,0,-559039810,0,0,0,0,0,0,0,0,0,0,0';
     36  actual   = blks + '';
     37 
     38 
     39  reportCompare(expect, actual, summary);
     40 }