6 /* A SHA1-protected file */
17 unsigned char buffer[8192];
21 struct hashfile_checkpoint {
26 extern void hashfile_checkpoint(struct hashfile *, struct hashfile_checkpoint *);
27 extern int hashfile_truncate(struct hashfile *, struct hashfile_checkpoint *);
29 /* finalize_hashfile flags */
32 #define CSUM_HASH_IN_STREAM 4
34 extern struct hashfile *hashfd(int fd, const char *name);
35 extern struct hashfile *hashfd_check(const char *name);
36 extern struct hashfile *hashfd_throughput(int fd, const char *name, struct progress *tp);
37 extern int finalize_hashfile(struct hashfile *, unsigned char *, unsigned int);
38 extern void hashwrite(struct hashfile *, const void *, unsigned int);
39 extern void hashflush(struct hashfile *f);
40 extern void crc32_begin(struct hashfile *);
41 extern uint32_t crc32_end(struct hashfile *);
43 static inline void hashwrite_u8(struct hashfile *f, uint8_t data)
45 hashwrite(f, &data, sizeof(data));
48 static inline void hashwrite_be32(struct hashfile *f, uint32_t data)
51 hashwrite(f, &data, sizeof(data));