reformat file

git-svn-id: http://encfs.googlecode.com/svn/trunk@84 db9cf616-1c43-0410-9cb8-a902689de0d6
This commit is contained in:
Valient Gough 2012-08-20 05:04:59 +00:00
parent f144de359f
commit 183dca787f

View File

@ -42,8 +42,8 @@ class Cipher
public: public:
// if no key length was indicated when cipher was registered, then keyLen // if no key length was indicated when cipher was registered, then keyLen
// <= 0 will be used. // <= 0 will be used.
typedef boost::shared_ptr<Cipher> (*CipherConstructor)( const Interface &iface, typedef boost::shared_ptr<Cipher> (*CipherConstructor)(
int keyLenBits ); const Interface &iface, int keyLenBits );
struct CipherAlgorithm struct CipherAlgorithm
{ {
@ -70,6 +70,7 @@ public:
const Interface &iface, const Interface &iface,
CipherConstructor constructor, CipherConstructor constructor,
bool hidden = false); bool hidden = false);
static bool Register(const char *cipherName, static bool Register(const char *cipherName,
const char *description, const char *description,
const Interface &iface, const Interface &iface,
@ -77,7 +78,6 @@ public:
CipherConstructor constructor, CipherConstructor constructor,
bool hidden = false); bool hidden = false);
Cipher(); Cipher();
virtual ~Cipher(); virtual ~Cipher();
@ -91,8 +91,10 @@ public:
virtual CipherKey newKey(const char *password, int passwdLength, virtual CipherKey newKey(const char *password, int passwdLength,
int &iterationCount, long desiredFunctionDuration, int &iterationCount, long desiredFunctionDuration,
const unsigned char *salt, int saltLen) =0; const unsigned char *salt, int saltLen) =0;
// deprecated - for backward compatibility // deprecated - for backward compatibility
virtual CipherKey newKey(const char *password, int passwdLength ) =0; virtual CipherKey newKey(const char *password, int passwdLength ) =0;
// create a new random key // create a new random key
virtual CipherKey newRandomKey() =0; virtual CipherKey newRandomKey() =0;
@ -100,6 +102,7 @@ public:
virtual CipherKey readKey(const unsigned char *data, virtual CipherKey readKey(const unsigned char *data,
const CipherKey &encodingKey, const CipherKey &encodingKey,
bool checkKey = true) =0; bool checkKey = true) =0;
virtual void writeKey(const CipherKey &key, unsigned char *data, virtual void writeKey(const CipherKey &key, unsigned char *data,
const CipherKey &encodingKey) =0; const CipherKey &encodingKey) =0;
@ -124,6 +127,7 @@ public:
// 64 bit MAC of the data with the given key // 64 bit MAC of the data with the given key
virtual uint64_t MAC_64( const unsigned char *src, int len, virtual uint64_t MAC_64( const unsigned char *src, int len,
const CipherKey &key, uint64_t *chainedIV = 0 ) const =0; const CipherKey &key, uint64_t *chainedIV = 0 ) const =0;
// based on reductions of MAC_64 // based on reductions of MAC_64
unsigned int MAC_32( const unsigned char *src, int len, unsigned int MAC_32( const unsigned char *src, int len,
const CipherKey &key, uint64_t *chainedIV = 0 ) const; const CipherKey &key, uint64_t *chainedIV = 0 ) const;
@ -160,6 +164,5 @@ public:
uint64_t iv64, const CipherKey &key) const=0; uint64_t iv64, const CipherKey &key) const=0;
}; };
#endif #endif