Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/pdf/xpdf/Decrypt.h
diff options
context:
space:
mode:
authorMartin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 20:32:18 (GMT)
committer Martin Kretzschmar <mkretzschmar@src.gnome.org>2002-09-18 20:32:18 (GMT)
commit7aac8dc8533347e21311b15186e0af82f1b22fd6 (patch)
tree02650bb02c8a1d8468c22f50ff151885d233016b /pdf/xpdf/Decrypt.h
parentd99fb4f4acd14fcdbda968abd907547dcc7af40c (diff)
Synched with Xpdf 0.92
this adds "decryption" support testing this code after six weeks immediately gives me segfaults (image drawing) :-O must have fixed that later without knowing :-O
Diffstat (limited to 'pdf/xpdf/Decrypt.h')
-rw-r--r--pdf/xpdf/Decrypt.h49
1 files changed, 49 insertions, 0 deletions
diff --git a/pdf/xpdf/Decrypt.h b/pdf/xpdf/Decrypt.h
new file mode 100644
index 0000000..3ea4374
--- /dev/null
+++ b/pdf/xpdf/Decrypt.h
@@ -0,0 +1,49 @@
+//========================================================================
+//
+// Decrypt.h
+//
+// Copyright 1996 Derek B. Noonburg
+//
+//========================================================================
+
+#ifndef DECRYPT_H
+#define DECRYPT_H
+
+#ifdef __GNUC__
+#pragma interface
+#endif
+
+#include "gtypes.h"
+#include "GString.h"
+
+//------------------------------------------------------------------------
+// Decrypt
+//------------------------------------------------------------------------
+
+class Decrypt {
+public:
+
+ // Initialize the decryptor object.
+ Decrypt(Guchar *fileKey, int objNum, int objGen);
+
+ // Reset decryption.
+ void reset();
+
+ // Decrypt one byte.
+ Guchar decryptByte(Guchar c);
+
+ // Generate a file key. The <fileKey> buffer must have space for
+ // at least 16 bytes. Checks user key and returns gTrue if okay.
+ // <userPassword> may be NULL.
+ static GBool makeFileKey(GString *ownerKey, GString *userKey,
+ int permissions, GString *fileID,
+ GString *userPassword, Guchar *fileKey);
+
+private:
+
+ Guchar objKey[16];
+ Guchar state[256];
+ Guchar x, y;
+};
+
+#endif