Path: blob/trunk/third_party/closure/goog/crypt/sha384.js
2868 views
// Copyright 2014 The Closure Library Authors. All Rights Reserved.1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// http://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS-IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314/**15* @fileoverview SHA-384 cryptographic hash.16*17* Usage:18* var sha384 = new goog.crypt.Sha384();19* sha384.update(bytes);20* var hash = sha384.digest();21*22* @author [email protected] (Frank Yellin)23*/2425goog.provide('goog.crypt.Sha384');2627goog.require('goog.crypt.Sha2_64bit');28293031/**32* Constructs a SHA-384 cryptographic hash.33*34* @constructor35* @extends {goog.crypt.Sha2_64bit}36* @final37* @struct38*/39goog.crypt.Sha384 = function() {40goog.crypt.Sha384.base(41this, 'constructor', 6 /* numHashBlocks */,42goog.crypt.Sha384.INIT_HASH_BLOCK_);43};44goog.inherits(goog.crypt.Sha384, goog.crypt.Sha2_64bit);454647/** @private {!Array<number>} */48goog.crypt.Sha384.INIT_HASH_BLOCK_ = [49// Section 5.3.4 of50// csrc.nist.gov/publications/fips/fips180-4/fips-180-4.pdf510xcbbb9d5d, 0xc1059ed8, // H0520x629a292a, 0x367cd507, // H1530x9159015a, 0x3070dd17, // H2540x152fecd8, 0xf70e5939, // H3550x67332667, 0xffc00b31, // H4560x8eb44a87, 0x68581511, // H5570xdb0c2e0d, 0x64f98fa7, // H6580x47b5481d, 0xbefa4fa4 // H759];606162