1 //========================================================================
5 // Copyright 1996-2003 Glyph & Cog, LLC
7 //========================================================================
14 #ifdef USE_GCC_PRAGMAS
21 //------------------------------------------------------------------------
23 //------------------------------------------------------------------------
28 // Initialize the decryptor object.
29 Decrypt(Guchar *fileKey, int keyLength, int objNum, int objGen);
35 Guchar decryptByte(Guchar c);
37 // Generate a file key. The <fileKey> buffer must have space for at
38 // least 16 bytes. Checks <ownerPassword> and then <userPassword>
39 // and returns true if either is correct. Sets <ownerPasswordOk> if
40 // the owner password was correct. Either or both of the passwords
41 // may be NULL, which is treated as an empty string.
42 static GBool makeFileKey(int encVersion, int encRevision, int keyLength,
43 GString *ownerKey, GString *userKey,
44 int permissions, GString *fileID,
45 GString *ownerPassword, GString *userPassword,
46 Guchar *fileKey, GBool encryptMetadata,
47 GBool *ownerPasswordOk);
51 static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
52 GString *ownerKey, GString *userKey,
53 int permissions, GString *fileID,
54 GString *userPassword, Guchar *fileKey,
55 GBool encryptMetadata);