aboutsummaryrefslogtreecommitdiffstats
path: root/library/cryptojs/components/sha384.js
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-11-07 23:25:13 -0800
committerfriendica <info@friendica.com>2013-11-07 23:25:13 -0800
commit3a9cbcaf011f5c5d423e1cd99b43442669692129 (patch)
treed160f11dd97871d94ffe6e6d10ea48ce57eed357 /library/cryptojs/components/sha384.js
parent90ab0d963bf5074643c6f275dbb8595b6c51a03d (diff)
downloadvolse-hubzilla-3a9cbcaf011f5c5d423e1cd99b43442669692129.tar.gz
volse-hubzilla-3a9cbcaf011f5c5d423e1cd99b43442669692129.tar.bz2
volse-hubzilla-3a9cbcaf011f5c5d423e1cd99b43442669692129.zip
Wankers.
Diffstat (limited to 'library/cryptojs/components/sha384.js')
-rw-r--r--library/cryptojs/components/sha384.js69
1 files changed, 69 insertions, 0 deletions
diff --git a/library/cryptojs/components/sha384.js b/library/cryptojs/components/sha384.js
new file mode 100644
index 000000000..8106959bd
--- /dev/null
+++ b/library/cryptojs/components/sha384.js
@@ -0,0 +1,69 @@
+/*
+CryptoJS v3.1.2
+code.google.com/p/crypto-js
+(c) 2009-2013 by Jeff Mott. All rights reserved.
+code.google.com/p/crypto-js/wiki/License
+*/
+(function () {
+ // Shortcuts
+ var C = CryptoJS;
+ var C_x64 = C.x64;
+ var X64Word = C_x64.Word;
+ var X64WordArray = C_x64.WordArray;
+ var C_algo = C.algo;
+ var SHA512 = C_algo.SHA512;
+
+ /**
+ * SHA-384 hash algorithm.
+ */
+ var SHA384 = C_algo.SHA384 = SHA512.extend({
+ _doReset: function () {
+ this._hash = new X64WordArray.init([
+ new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
+ new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
+ new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
+ new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
+ ]);
+ },
+
+ _doFinalize: function () {
+ var hash = SHA512._doFinalize.call(this);
+
+ hash.sigBytes -= 16;
+
+ return hash;
+ }
+ });
+
+ /**
+ * 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.SHA384('message');
+ * var hash = CryptoJS.SHA384(wordArray);
+ */
+ C.SHA384 = SHA512._createHelper(SHA384);
+
+ /**
+ * 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.HmacSHA384(message, key);
+ */
+ C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
+}());