Subversion Repositories cryptochat

Rev

View as "text/javascript" | Blame | Last modification | View Log | RSS feed

  1. /*
  2. CryptoJS v3.1.2
  3. code.google.com/p/crypto-js
  4. (c) 2009-2013 by Jeff Mott. All rights reserved.
  5. code.google.com/p/crypto-js/wiki/License
  6. */
  7. (function () {
  8.     // Shortcuts
  9.     var C = CryptoJS;
  10.     var C_x64 = C.x64;
  11.     var X64Word = C_x64.Word;
  12.     var X64WordArray = C_x64.WordArray;
  13.     var C_algo = C.algo;
  14.     var SHA512 = C_algo.SHA512;
  15.  
  16.     /**
  17.      * SHA-384 hash algorithm.
  18.      */
  19.     var SHA384 = C_algo.SHA384 = SHA512.extend({
  20.         _doReset: function () {
  21.             this._hash = new X64WordArray.init([
  22.                 new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
  23.                 new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
  24.                 new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
  25.                 new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
  26.             ]);
  27.         },
  28.  
  29.         _doFinalize: function () {
  30.             var hash = SHA512._doFinalize.call(this);
  31.  
  32.             hash.sigBytes -= 16;
  33.  
  34.             return hash;
  35.         }
  36.     });
  37.  
  38.     /**
  39.      * Shortcut function to the hasher's object interface.
  40.      *
  41.      * @param {WordArray|string} message The message to hash.
  42.      *
  43.      * @return {WordArray} The hash.
  44.      *
  45.      * @static
  46.      *
  47.      * @example
  48.      *
  49.      *     var hash = CryptoJS.SHA384('message');
  50.      *     var hash = CryptoJS.SHA384(wordArray);
  51.      */
  52.     C.SHA384 = SHA512._createHelper(SHA384);
  53.  
  54.     /**
  55.      * Shortcut function to the HMAC's object interface.
  56.      *
  57.      * @param {WordArray|string} message The message to hash.
  58.      * @param {WordArray|string} key The secret key.
  59.      *
  60.      * @return {WordArray} The HMAC.
  61.      *
  62.      * @static
  63.      *
  64.      * @example
  65.      *
  66.      *     var hmac = CryptoJS.HmacSHA384(message, key);
  67.      */
  68.     C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
  69. }());
  70.