summaryrefslogtreecommitdiff
path: root/csum-file.h
diff options
context:
space:
mode:
Diffstat (limited to 'csum-file.h')
-rw-r--r--csum-file.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/csum-file.h b/csum-file.h
index e54d53d1d0..291215b34e 100644
--- a/csum-file.h
+++ b/csum-file.h
@@ -16,7 +16,9 @@ struct hashfile {
const char *name;
int do_crc;
uint32_t crc32;
- unsigned char buffer[8192];
+ size_t buffer_len;
+ unsigned char *buffer;
+ unsigned char *check_buffer;
};
/* Checkpoint */
@@ -42,6 +44,9 @@ void hashflush(struct hashfile *f);
void crc32_begin(struct hashfile *);
uint32_t crc32_end(struct hashfile *);
+/* Verify checksum validity while reading. Returns non-zero on success. */
+int hashfile_checksum_valid(const unsigned char *data, size_t len);
+
/*
* Returns the total number of bytes fed to the hashfile so far (including ones
* that have not been written out to the descriptor yet).