sha224.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // Copyright 2012 The Closure Library Authors. All Rights Reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS-IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. /**
  15. * @fileoverview SHA-224 cryptographic hash.
  16. *
  17. * Usage:
  18. * var sha224 = new goog.crypt.Sha224();
  19. * sha224.update(bytes);
  20. * var hash = sha224.digest();
  21. *
  22. */
  23. goog.provide('goog.crypt.Sha224');
  24. goog.require('goog.crypt.Sha2');
  25. /**
  26. * SHA-224 cryptographic hash constructor.
  27. *
  28. * @constructor
  29. * @extends {goog.crypt.Sha2}
  30. * @final
  31. * @struct
  32. */
  33. goog.crypt.Sha224 = function() {
  34. goog.crypt.Sha224.base(
  35. this, 'constructor', 7, goog.crypt.Sha224.INIT_HASH_BLOCK_);
  36. };
  37. goog.inherits(goog.crypt.Sha224, goog.crypt.Sha2);
  38. /** @private {!Array<number>} */
  39. goog.crypt.Sha224.INIT_HASH_BLOCK_ = [
  40. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511,
  41. 0x64f98fa7, 0xbefa4fa4
  42. ];