SHA384.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * An implementation of the SHA-384 hash function.
  3. *
  4. * The Federal Information Processing Standards (FIPS) Specification
  5. * can be found here (FIPS 180-3):
  6. * http://csrc.nist.gov/publications/PubsFIPS.html
  7. *
  8. * Written in 2010 by Lorenz Quack <don@amberfisharts.com>
  9. *
  10. * ===================================================================
  11. * The contents of this file are dedicated to the public domain. To
  12. * the extent that dedication to the public domain is not available,
  13. * everyone is granted a worldwide, perpetual, royalty-free,
  14. * non-exclusive license to exercise all rights associated with the
  15. * contents of this file for any purpose whatsoever.
  16. * No rights are reserved.
  17. *
  18. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  19. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  20. * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  21. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
  22. * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
  23. * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  24. * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  25. * SOFTWARE.
  26. * ===================================================================
  27. *
  28. */
  29. #define MODULE_NAME SHA384
  30. #define DIGEST_SIZE (384/8)
  31. #define WORD_SIZE 8
  32. #include "common.h"
  33. /* Initial Values H */
  34. static const uint64_t H[8] = {
  35. 0xcbbb9d5dc1059ed8ULL,
  36. 0x629a292a367cd507ULL,
  37. 0x9159015a3070dd17ULL,
  38. 0x152fecd8f70e5939ULL,
  39. 0x67332667ffc00b31ULL,
  40. 0x8eb44a8768581511ULL,
  41. 0xdb0c2e0d64f98fa7ULL,
  42. 0x47b5481dbefa4fa4ULL
  43. };
  44. #include "hash_SHA2_template.c"