sha512-256.h 523 B

1234567891011121314151617
  1. /* public domain sha512/256 implementation based on fips180-3 */
  2. #include "sha512.h"
  3. #define sha512_256 sha512 /*struct*/
  4. enum { SHA512_256_DIGEST_LENGTH = 32 };
  5. /* reset state */
  6. void sha512_256_init(void *ctx);
  7. /* process message */
  8. #define sha512_256_update sha512_update
  9. /* get message digest */
  10. /* state is ruined after sum, keep a copy if multiple sum is needed */
  11. /* part of the message might be left in s, zero it if secrecy is needed */
  12. void sha512_256_sum(void *ctx, uint8_t md[SHA512_256_DIGEST_LENGTH]);