summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-11-04 15:55:43 +0100
committerJay Berkenbilt <ejb@ql.org>2019-11-09 14:18:02 +0100
commitbb427bd11774f47f553257cdc0693f77b559654d (patch)
tree379100926074a82f81f24d0d6cbe41631b71cc50 /include
parenteadc222ff9087c8dd41a7afced717a65802e849c (diff)
downloadqpdf-bb427bd11774f47f553257cdc0693f77b559654d.tar.zst
SHA2: switch to pluggable crypto
Diffstat (limited to 'include')
-rw-r--r--include/qpdf/QPDFCryptoImpl.hh15
1 files changed, 14 insertions, 1 deletions
diff --git a/include/qpdf/QPDFCryptoImpl.hh b/include/qpdf/QPDFCryptoImpl.hh
index b19f0112..09803a79 100644
--- a/include/qpdf/QPDFCryptoImpl.hh
+++ b/include/qpdf/QPDFCryptoImpl.hh
@@ -23,7 +23,7 @@
#define QPDFCRYPTOIMPL_HH
#include <qpdf/DLL.h>
-#include <cstring>
+#include <string>
// This class is part of qpdf's pluggable crypto provider support.
// Most users won't need to know or care about this class, but you can
@@ -41,6 +41,8 @@ class QPDF_DLL_CLASS QPDFCryptoImpl
QPDF_DLL
virtual ~QPDFCryptoImpl() = default;
+ // Hashing
+
typedef unsigned char MD5_Digest[16];
QPDF_DLL
virtual void MD5_init() = 0;
@@ -51,6 +53,17 @@ class QPDF_DLL_CLASS QPDFCryptoImpl
QPDF_DLL
virtual void MD5_digest(MD5_Digest) = 0;
+ QPDF_DLL
+ virtual void SHA2_init(int bits) = 0;
+ QPDF_DLL
+ virtual void SHA2_update(unsigned char const* data, size_t len) = 0;
+ QPDF_DLL
+ virtual void SHA2_finalize() = 0;
+ QPDF_DLL
+ virtual std::string SHA2_digest() = 0;
+
+ // Encryption/Decryption
+
// key_len of -1 means treat key_data as a null-terminated string
QPDF_DLL
virtual void RC4_init(unsigned char const* key_data, int key_len = -1) = 0;