You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

50 lines
779 B

  1. /* Copyright (c) 2014 Cryptography Research, Inc.
  2. * Released under the MIT License. See LICENSE.txt for license information.
  3. */
  4. #ifndef __GOLDI_SHA512_H__
  5. #define __GOLDI_SHA512_H__ 1
  6. #include <stdint.h>
  7. #ifdef __cplusplus
  8. extern "C" {
  9. #endif
  10. /* TODO: KAT */
  11. /**
  12. * SHA512 hashing context.
  13. *
  14. * This structure is opaque.
  15. */
  16. struct sha512_ctx_t {
  17. /** @privatesection */
  18. uint64_t chain[8];
  19. uint8_t block[128];
  20. uint64_t nbytes;
  21. };
  22. void
  23. sha512_init (
  24. struct sha512_ctx_t *ctx
  25. );
  26. void
  27. sha512_update (
  28. struct sha512_ctx_t *ctx,
  29. const unsigned char *data,
  30. uint64_t bytes
  31. );
  32. void
  33. sha512_final (
  34. struct sha512_ctx_t *ctx,
  35. uint8_t result[64]
  36. );
  37. #ifdef __cplusplus
  38. }; /* extern "C" */
  39. #endif
  40. #endif /* __GOLDI_SHA512_H__ */