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 *ownerPasswordOk);
50 static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
51 GString *ownerKey, GString *userKey,
52 int permissions, GString *fileID,
53 GString *userPassword, Guchar *fileKey);