X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/ff6bb5727e35159acd061f77cc462a741d2c978e..650faab01603caac04494d54cf6b10a65c00ea13:/apt-pkg/contrib/hashes.h diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 264f7fe90..40c2ad064 100644 --- a/apt-pkg/contrib/hashes.h +++ b/apt-pkg/contrib/hashes.h @@ -16,7 +16,7 @@ #include #include -#include +#include #include #include @@ -60,13 +60,17 @@ class Hashes MD5Summation MD5; SHA1Summation SHA1; SHA256Summation SHA256; + SHA512Summation SHA512; - inline bool Add(const unsigned char *Data,unsigned long Size) + inline bool Add(const unsigned char *Data,unsigned long long Size) { - return MD5.Add(Data,Size) && SHA1.Add(Data,Size) && SHA256.Add(Data,Size); + return MD5.Add(Data,Size) && SHA1.Add(Data,Size) && SHA256.Add(Data,Size) && SHA512.Add(Data,Size); }; inline bool Add(const char *Data) {return Add((unsigned char *)Data,strlen(Data));}; - bool AddFD(int Fd,unsigned long Size); + inline bool AddFD(int const Fd,unsigned long long Size = 0) + { return AddFD(Fd, Size, true, true, true, true); }; + bool AddFD(int const Fd, unsigned long long Size, bool const addMD5, + bool const addSHA1, bool const addSHA256, bool const addSHA512); inline bool Add(const unsigned char *Beg,const unsigned char *End) {return Add(Beg,End-Beg);}; };