#ifndef DECRYPT_H
#define DECRYPT_H
#include <config.h>
#ifdef USE_GCC_PRAGMAS
#pragma interface
#endif
#include "gtypes.h"
#include "GString.h"
class Decrypt {
public:
Decrypt(Guchar *fileKey, int keyLength, int objNum, int objGen);
void reset();
Guchar decryptByte(Guchar c);
static GBool makeFileKey(int encVersion, int encRevision, int keyLength,
GString *ownerKey, GString *userKey,
int permissions, GString *fileID,
GString *ownerPassword, GString *userPassword,
Guchar *fileKey, GBool encryptMetadata,
GBool *ownerPasswordOk);
private:
static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
GString *ownerKey, GString *userKey,
int permissions, GString *fileID,
GString *userPassword, Guchar *fileKey,
GBool encryptMetadata);
int objKeyLength;
Guchar objKey[21];
Guchar state[256];
Guchar x, y;
};
#endif