aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFCrypto_native.cc
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-11-04 03:22:03 +0100
committerJay Berkenbilt <ejb@ql.org>2019-11-09 14:18:02 +0100
commitce8f9b6608ebcc3e88fbb1655be3e9363fa671b6 (patch)
tree4585a0a41e624ba5cc2a130a82719eee449f304e /libqpdf/QPDFCrypto_native.cc
parent5c3e856e9f0b908494126d1ea7b99c8c32d37039 (diff)
downloadqpdf-ce8f9b6608ebcc3e88fbb1655be3e9363fa671b6.tar.zst
MD5: switch to pluggable crypto
Diffstat (limited to 'libqpdf/QPDFCrypto_native.cc')
-rw-r--r--libqpdf/QPDFCrypto_native.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/libqpdf/QPDFCrypto_native.cc b/libqpdf/QPDFCrypto_native.cc
index ab9fd3a2..1ee73782 100644
--- a/libqpdf/QPDFCrypto_native.cc
+++ b/libqpdf/QPDFCrypto_native.cc
@@ -1 +1,27 @@
#include <qpdf/QPDFCrypto_native.hh>
+#include <qpdf/QUtil.hh>
+
+void
+QPDFCrypto_native::MD5_init()
+{
+ this->md5 = std::make_shared<MD5_native>();
+}
+
+void
+QPDFCrypto_native::MD5_update(unsigned char const* data, size_t len)
+{
+ this->md5->update(const_cast<unsigned char*>(data), len);
+}
+
+void
+QPDFCrypto_native::MD5_finalize()
+{
+ this->md5->finalize();
+}
+
+void
+QPDFCrypto_native::MD5_digest(MD5_Digest d)
+{
+ this->md5->digest(d);
+}
+