xoreos  0.0.5
Classes | Namespaces | Enumerations | Functions | Variables
blowfish.cpp File Reference

Encryption / decryption using Bruce Schneier's Blowfish algorithm. More...

#include <cassert>
#include "src/common/util.h"
#include "src/common/error.h"
#include "src/common/scopedptr.h"
#include "src/common/memreadstream.h"
#include "src/common/blowfish.h"
Include dependency graph for blowfish.cpp:

Go to the source code of this file.

Classes

struct  Common::BlowfishContext
 

Namespaces

 Common
 

Enumerations

enum  Common::Mode { Common::kModeDecrypt = 0, Common::kModeEncrypt = 1 }
 

Functions

static uint32 Common::F (const BlowfishContext &ctx, uint32 x)
 
static void Common::blowfishEnc (BlowfishContext &ctx, uint32 &xl, uint32 &xr)
 
static void Common::blowfishDec (BlowfishContext &ctx, uint32 &xl, uint32 &xr)
 
static void Common::blowfishSetKey (BlowfishContext &ctx, const byte *key, size_t keyLength)
 
static void Common::blowfishECB (BlowfishContext &ctx, Mode mode, const byte *input, byte *output)
 
MemoryReadStream * Common::blowfishEBC (SeekableReadStream &input, const std::vector< byte > &key, Mode mode)
 
MemoryReadStream * Common::encryptBlowfishEBC (SeekableReadStream &input, const std::vector< byte > &key)
 Encrypt the stream with the Blowfish algorithm in EBC mode. More...
 
MemoryReadStream * Common::decryptBlowfishEBC (SeekableReadStream &input, const std::vector< byte > &key)
 Decrypt the stream with the Blowfish algorithm in EBC mode. More...
 

Variables

static const size_t Common::kMinKeyLength = 4
 
static const size_t Common::kMaxKeyLength = 56
 
static const size_t Common::kRoundCount = 16
 
static const size_t Common::kBlockSize = 8
 
static const uint32 Common::P [kRoundCount+2]
 
static const uint32 Common::S [4][256]
 

Detailed Description

Encryption / decryption using Bruce Schneier's Blowfish algorithm.

Definition in file blowfish.cpp.