summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2013-04-26 20:07:58 (GMT)
committerRemko Tronçon <git@el-tramo.be>2013-04-27 11:02:06 (GMT)
commit5d8c328e236f57d7390d32f9ea7bd17a31e1e740 (patch)
treebebe606707a6b835fe3fd15e694d629b5e420947 /Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp
parentaa131405927fc7f597ed06aff71abb0a30b59926 (diff)
downloadswift-5d8c328e236f57d7390d32f9ea7bd17a31e1e740.zip
swift-5d8c328e236f57d7390d32f9ea7bd17a31e1e740.tar.bz2
Removing third-party hash implementations.
Using library/platform implementation instead. Change-Id: I2457c2dad80e6fdda023a7f31c3906ff10fe09ed
Diffstat (limited to 'Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp')
-rw-r--r--Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp b/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp
index 6b53a1b..e669a51 100644
--- a/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp
+++ b/Swiften/FileTransfer/IncrementalBytestreamHashCalculator.cpp
@@ -4,17 +4,23 @@
* See Documentation/Licenses/BSD-simplified.txt for more information.
*/
+/*
+ * Copyright (c) 2013 Remko Tronçon
+ * Licensed under the GNU General Public License.
+ * See the COPYING file for more information.
+ */
+
+
#include <Swiften/FileTransfer/IncrementalBytestreamHashCalculator.h>
#include <Swiften/StringCodecs/Hexify.h>
-#include <Swiften/StringCodecs/MD5.h>
-#include <Swiften/StringCodecs/SHA1.h>
+#include <Swiften/Crypto/CryptoProvider.h>
namespace Swift {
-IncrementalBytestreamHashCalculator::IncrementalBytestreamHashCalculator(bool doMD5, bool doSHA1) {
- md5Hasher = doMD5 ? new MD5() : NULL;
- sha1Hasher = doSHA1 ? new SHA1() : NULL;
+IncrementalBytestreamHashCalculator::IncrementalBytestreamHashCalculator(bool doMD5, bool doSHA1, CryptoProvider* crypto) {
+ md5Hasher = doMD5 ? crypto->createMD5() : NULL;
+ sha1Hasher = doSHA1 ? crypto->createSHA1() : NULL;
}
IncrementalBytestreamHashCalculator::~IncrementalBytestreamHashCalculator() {