summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/hashes.h
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-06-08 12:03:34 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-06-08 12:03:34 +0200
commit12cd178d6eb61306cc99e5e07c463c800d406771 (patch)
tree90941ebf0adb1c4b3ef9ca780a2b42cb1f2dfb16 /apt-pkg/contrib/hashes.h
parentd953d210bb54accb416f2144104b79dcd29198ba (diff)
parent31693a8ff0fe593879ed30a4dde8f9be5b0859bf (diff)
merge lp:~mvo/apt/sha512-template to add support for sha512
Diffstat (limited to 'apt-pkg/contrib/hashes.h')
-rw-r--r--apt-pkg/contrib/hashes.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/apt-pkg/contrib/hashes.h b/apt-pkg/contrib/hashes.h
index 264f7fe90..4b6a08b1f 100644
--- a/apt-pkg/contrib/hashes.h
+++ b/apt-pkg/contrib/hashes.h
@@ -16,7 +16,7 @@
#include <apt-pkg/md5.h>
#include <apt-pkg/sha1.h>
-#include <apt-pkg/sha256.h>
+#include <apt-pkg/sha2.h>
#include <algorithm>
#include <vector>
@@ -60,10 +60,11 @@ 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);