;(function (root, factory) { if (typeof exports === "object") { // CommonJS module.exports = exports = factory(require("./core")); } else if (typeof define === "function" && define.amd) { // AMD define(["./core"], factory); } else { // Global (browser) factory(root.CryptoJS); } }(this, function (CryptoJS) { (function () { // Shortcuts var C = CryptoJS; var C_lib = C.lib; var WordArray = C_lib.WordArray; var Hasher = C_lib.Hasher; var C_algo = C.algo; // Reusable object var W = []; /** * SHA-1 hash algorithm. */ var SHA1 = C_algo.SHA1 = Hasher.extend({ _doReset: function () { this._hash = new WordArray.init([ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]); }, _doProcessBlock: function (M, offset) { // Shortcut var H = this._hash.words; // Working variables var a = H[0]; var b = H[1]; var c = H[2]; var d = H[3]; var e = H[4]; // Computation for (var i = 0; i < 80; i++) { if (i < 16) { W[i] = M[offset + i] | 0; } else { var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]; W[i] = (n << 1) | (n >>> 31); } var t = ((a << 5) | (a >>> 27)) + e + W[i]; if (i < 20) { t += ((b & c) | (~b & d)) + 0x5a827999; } else if (i < 40) { t += (b ^ c ^ d) + 0x6ed9eba1; } else if (i < 60) { t += ((b & c) | (b & d) | (c & d)) - 0x70e44324; } else /* if (i < 80) */ { t += (b ^ c ^ d) - 0x359d3e2a; } e = d; d = c; c = (b << 30) | (b >>> 2); b = a; a = t; } // Intermediate hash value H[0] = (H[0] + a) | 0; H[1] = (H[1] + b) | 0; H[2] = (H[2] + c) | 0; H[3] = (H[3] + d) | 0; H[4] = (H[4] + e) | 0; }, _doFinalize: function () { // Shortcuts var data = this._data; var dataWords = data.words; var nBitsTotal = this._nDataBytes * 8; var nBitsLeft = data.sigBytes * 8; // Add padding dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000); dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal; data.sigBytes = dataWords.length * 4; // Hash final blocks this._process(); // Return final computed hash return this._hash; }, clone: function () { var clone = Hasher.clone.call(this); clone._hash = this._hash.clone(); return clone; } }); /** * Shortcut function to the hasher's object interface. * * @param {WordArray|string} message The message to hash. * * @return {WordArray} The hash. * * @static * * @example * * var hash = CryptoJS.SHA1('message'); * var hash = CryptoJS.SHA1(wordArray); */ C.SHA1 = Hasher._createHelper(SHA1); /** * Shortcut function to the HMAC's object interface. * * @param {WordArray|string} message The message to hash. * @param {WordArray|string} key The secret key. * * @return {WordArray} The HMAC. * * @static * * @example * * var hmac = CryptoJS.HmacSHA1(message, key); */ C.HmacSHA1 = Hasher._createHmacHelper(SHA1); }()); return CryptoJS.SHA1; }));
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
docs | Folder | 0755 |
|
|
CONTRIBUTING.md | File | 482 B | 0644 |
|
LICENSE | File | 1.14 KB | 0644 |
|
README.md | File | 5.74 KB | 0644 |
|
aes.js | File | 8.45 KB | 0644 |
|
bower.json | File | 645 B | 0644 |
|
cipher-core.js | File | 28.96 KB | 0644 |
|
core.js | File | 23.08 KB | 0644 |
|
crypto-js.js | File | 193.47 KB | 0644 |
|
enc-base64.js | File | 3.99 KB | 0644 |
|
enc-base64url.js | File | 4.33 KB | 0644 |
|
enc-hex.js | File | 359 B | 0644 |
|
enc-latin1.js | File | 362 B | 0644 |
|
enc-utf16.js | File | 3.99 KB | 0644 |
|
enc-utf8.js | File | 360 B | 0644 |
|
evpkdf.js | File | 3.9 KB | 0644 |
|
format-hex.js | File | 1.78 KB | 0644 |
|
format-openssl.js | File | 416 B | 0644 |
|
hmac-md5.js | File | 422 B | 0644 |
|
hmac-ripemd160.js | File | 440 B | 0644 |
|
hmac-sha1.js | File | 425 B | 0644 |
|
hmac-sha224.js | File | 464 B | 0644 |
|
hmac-sha256.js | File | 431 B | 0644 |
|
hmac-sha3.js | File | 462 B | 0644 |
|
hmac-sha384.js | File | 501 B | 0644 |
|
hmac-sha512.js | File | 468 B | 0644 |
|
hmac.js | File | 3.89 KB | 0644 |
|
index.js | File | 1.59 KB | 0644 |
|
lib-typedarrays.js | File | 2.18 KB | 0644 |
|
md5.js | File | 9.2 KB | 0644 |
|
mode-cfb.js | File | 2.07 KB | 0644 |
|
mode-ctr-gladman.js | File | 2.28 KB | 0644 |
|
mode-ctr.js | File | 1.43 KB | 0644 |
|
mode-ecb.js | File | 893 B | 0644 |
|
mode-ofb.js | File | 1.3 KB | 0644 |
|
package.json | File | 719 B | 0644 |
|
pad-ansix923.js | File | 1.24 KB | 0644 |
|
pad-iso10126.js | File | 1.09 KB | 0644 |
|
pad-iso97971.js | File | 918 B | 0644 |
|
pad-nopadding.js | File | 554 B | 0644 |
|
pad-pkcs7.js | File | 411 B | 0644 |
|
pad-zeropadding.js | File | 1.08 KB | 0644 |
|
pbkdf2.js | File | 4.43 KB | 0644 |
|
rabbit-legacy.js | File | 6.56 KB | 0644 |
|
rabbit.js | File | 6.52 KB | 0644 |
|
rc4.js | File | 3.49 KB | 0644 |
|
ripemd160.js | File | 9.17 KB | 0644 |
|
sha1.js | File | 3.97 KB | 0644 |
|
sha224.js | File | 1.87 KB | 0644 |
|
sha256.js | File | 5.41 KB | 0644 |
|
sha3.js | File | 10.4 KB | 0644 |
|
sha384.js | File | 2.21 KB | 0644 |
|
sha512.js | File | 13.15 KB | 0644 |
|
tripledes.js | File | 24.29 KB | 0644 |
|
x64-core.js | File | 8.68 KB | 0644 |
|