X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/893d3e85b98124fc28002be5584b685324646037..1dab797ca6dc0357474675a0f132c962dee4a2c2:/apt-pkg/contrib/hashes.h diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h index 264f7fe90..e702fcca2 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) { - 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 Size = 0) + { return AddFD(Fd, Size, true, true, true, true); }; + bool AddFD(int const Fd, unsigned 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);}; };