-rw-r--r-- | src/eyetil.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/eyetil.h b/src/eyetil.h index 7517ba6..8784cb4 100644 --- a/src/eyetil.h +++ b/src/eyetil.h @@ -61,32 +61,43 @@ struct md5_digester { }; template<> inline void md5_digester::update<binary_t>(const binary_t& x) { update((const unsigned char*)&(x.front()),x.size()); } #pragma pack(1) struct block512_t { enum { words = 512 / sizeof(uint16_t) }; uint16_t data[words]; inline uint8_t *dptr(size_t o) { return ((uint8_t*)this)+o; } static uint16_t tcpcksum(block512_t& data); }; #pragma pack() +struct integrity_digester { + md5_digester md5; + size_t data_size; + block512_t data; + + integrity_digester() : data_size(0) { } + void update(const void *d,size_t s); + binary_t final(const std::string& ukey); +}; + + class tmpdir_t { public: std::string dir; tmpdir_t(const std::string& dt); ~tmpdir_t(); std::string get_file(const std::string& f); }; class tarchive_t { public: struct archive *a; struct archive_entry *e; tarchive_t(void *p,size_t s); |