2013-03-05 07:32:27 +01:00
|
|
|
#ifndef BLOCKCIPHER_H
|
|
|
|
#define BLOCKCIPHER_H
|
|
|
|
|
|
|
|
#include "base/Interface.h"
|
|
|
|
#include "base/Range.h"
|
|
|
|
#include "base/Registry.h"
|
|
|
|
#include "base/shared_ptr.h"
|
|
|
|
#include "base/types.h"
|
|
|
|
#include "cipher/StreamCipher.h"
|
|
|
|
|
|
|
|
namespace encfs {
|
|
|
|
|
2013-03-05 07:36:32 +01:00
|
|
|
static const char NAME_AES_CBC[] = "AES/CBC";
|
|
|
|
static const char NAME_BLOWFISH_CBC[] = "Blowfish/CBC";
|
|
|
|
|
2013-03-05 07:32:27 +01:00
|
|
|
// BlockCipher is a StreamCipher with a block size.
|
|
|
|
// Encryption and decryption must be in multiples of the block size.
|
|
|
|
class BlockCipher : public StreamCipher
|
|
|
|
{
|
|
|
|
public:
|
2013-03-05 07:36:32 +01:00
|
|
|
DECLARE_REGISTERABLE_TYPE(BlockCipher);
|
2013-03-05 07:32:27 +01:00
|
|
|
|
|
|
|
BlockCipher();
|
|
|
|
virtual ~BlockCipher();
|
|
|
|
|
2013-03-05 07:36:32 +01:00
|
|
|
// Not valid until a key has been set, as they key size may determine the
|
|
|
|
// block size.
|
2013-03-05 07:32:27 +01:00
|
|
|
virtual int blockSize() const =0;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace encfs
|
|
|
|
|
|
|
|
#endif // BLOCKCIPHER_H
|