Sony PlayStation2 Study
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.

24 lines
625 B

4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef _SHA256_H
  2. #define _SHA256_H
  3. #include "../base/basicTypes.h"
  4. #define SHA256_SUM_LEN 32
  5. /* Reset watchdog each time we process this many bytes */
  6. #define CHUNKSZ_SHA256 (64 * 1024)
  7. typedef struct {
  8. uint32_t total[2];
  9. uint32_t state[8];
  10. uint8_t buffer[64];
  11. } sha256_context;
  12. void sha256_starts(sha256_context * ctx);
  13. void sha256_update(sha256_context *ctx, const uint8_t *input, uint32_t length);
  14. void sha256_finish(sha256_context * ctx, uint8_t digest[SHA256_SUM_LEN]);
  15. void sha256_csum_wd(const unsigned char *input, unsigned int ilen,
  16. unsigned char *output, unsigned int chunk_sz);
  17. #endif /* _SHA256_H */