sha256.h 570 B

123456789101112131415161718192021222324
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #define SHA256_DIGEST_SIZE 32
  6. #define SHA256_BLOCK_SIZE 64
  7. typedef struct {
  8. uint32_t total[2];
  9. uint32_t state[8];
  10. uint32_t wbuf[16];
  11. } sha256_context;
  12. void sha256(const unsigned char* input, unsigned int ilen, unsigned char output[32]);
  13. void sha256_start(sha256_context* ctx);
  14. void sha256_finish(sha256_context* ctx, unsigned char output[32]);
  15. void sha256_update(sha256_context* ctx, const unsigned char* input, unsigned int ilen);
  16. void sha256_process(sha256_context* ctx);
  17. #ifdef __cplusplus
  18. }
  19. #endif