~bcsaller/juju-gui/update-reductions

« back to all changes in this revision

Viewing changes to lib/cryptojs/components/sha224.js

  • Committer: kapil.foss at gmail
  • Date: 2012-07-13 18:45:59 UTC
  • Revision ID: kapil.foss@gmail.com-20120713184559-2xl7be17egsrz0c9
reshape

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
CryptoJS v3.0.2
3
 
code.google.com/p/crypto-js
4
 
(c) 2009-2012 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_lib = C.lib;
11
 
    var WordArray = C_lib.WordArray;
12
 
    var C_algo = C.algo;
13
 
    var SHA256 = C_algo.SHA256;
14
 
 
15
 
    /**
16
 
     * SHA-224 hash algorithm.
17
 
     */
18
 
    var SHA224 = C_algo.SHA224 = SHA256.extend({
19
 
        _doReset: function () {
20
 
            this._hash = WordArray.create([
21
 
                0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
22
 
                0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
23
 
            ]);
24
 
        },
25
 
 
26
 
        _doFinalize: function () {
27
 
            SHA256._doFinalize.call(this);
28
 
 
29
 
            this._hash.sigBytes -= 4;
30
 
        }
31
 
    });
32
 
 
33
 
    /**
34
 
     * Shortcut function to the hasher's object interface.
35
 
     *
36
 
     * @param {WordArray|string} message The message to hash.
37
 
     *
38
 
     * @return {WordArray} The hash.
39
 
     *
40
 
     * @static
41
 
     *
42
 
     * @example
43
 
     *
44
 
     *     var hash = CryptoJS.SHA224('message');
45
 
     *     var hash = CryptoJS.SHA224(wordArray);
46
 
     */
47
 
    C.SHA224 = SHA256._createHelper(SHA224);
48
 
 
49
 
    /**
50
 
     * Shortcut function to the HMAC's object interface.
51
 
     *
52
 
     * @param {WordArray|string} message The message to hash.
53
 
     * @param {WordArray|string} key The secret key.
54
 
     *
55
 
     * @return {WordArray} The HMAC.
56
 
     *
57
 
     * @static
58
 
     *
59
 
     * @example
60
 
     *
61
 
     *     var hmac = CryptoJS.HmacSHA224(message, key);
62
 
     */
63
 
    C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
64
 
}());