#include <arc4.h>
Inheritance diagram for MARC4_Base:
Definition at line 40 of file arc4.h.
Public Types | |
typedef SymmetricCipherFinal< MARC4_Base > | Encryption |
implements the SymmetricCipher interface | |
typedef SymmetricCipherFinal< MARC4_Base > | Decryption |
implements the SymmetricCipher interface | |
Public Member Functions | |
byte | GenerateByte () |
generate new random byte and return it | |
void | DiscardBytes (size_t n) |
generate and discard n bytes | |
void | ProcessData (byte *outString, const byte *inString, size_t length) |
encrypt or decrypt an array of bytes of specified length | |
bool | IsRandomAccess () const |
returns whether this cipher supports random access | |
bool | IsSelfInverting () const |
returns whether this transformation is self-inverting (e.g. xor with a keystream) | |
bool | IsForwardTransformation () const |
returns whether this is an encryption object | |
virtual unsigned int | GenerateBit () |
generate new random bit and return it | |
virtual word32 | GenerateWord32 (word32 a=0, word32 b=0xffffffffL) |
generate a random 32 bit word in the range min to max, inclusive | |
virtual void | GenerateBlock (byte *output, size_t size) |
generate random array of bytes | |
template<class IT> | |
void | Shuffle (IT begin, IT end) |
randomly shuffle the specified array, resulting permutation is uniformly distributed | |
virtual std::string | AlgorithmName () const |
returns name of this algorithm, not universally implemented yet | |
virtual Clonable * | Clone () const |
this is not implemented by most classes yet | |
Static Public Member Functions | |
static const char * | StaticAlgorithmName () |
static size_t __cdecl | StaticGetValidKeyLength (size_t n) |
Static Public Attributes | |
static const int | MIN_KEYLENGTH |
static const int | MAX_KEYLENGTH |
static const int | DEFAULT_KEYLENGTH |
static const int | KEYLENGTH_MULTIPLE |
static const int | IV_REQUIREMENT |
static const int | IV_LENGTH |
Protected Member Functions | |
unsigned int | GetDefaultDiscardBytes () const |
void | UncheckedSetKey (const byte *key, unsigned int length, const NameValuePairs ¶ms) |
Protected Attributes | |
FixedSizeSecBlock< byte, 256 > | m_state |
byte | m_x |
byte | m_y |
void ARC4_Base::DiscardBytes | ( | size_t | n | ) | [virtual, inherited] |
generate and discard n bytes
Default implementation is to call GenerateByte() n times.
Reimplemented from RandomNumberGenerator.
Definition at line 97 of file arc4.cpp.
References ARC4_Base::m_state, ARC4_Base::m_x, and ARC4_Base::m_y.
Referenced by ARC4_Base::UncheckedSetKey().
void ARC4_Base::ProcessData | ( | byte * | outString, | |
const byte * | inString, | |||
size_t | length | |||
) | [virtual, inherited] |
encrypt or decrypt an array of bytes of specified length
Implements StreamTransformation.
Definition at line 68 of file arc4.cpp.
References ARC4_Base::m_state, ARC4_Base::m_x, and ARC4_Base::m_y.
unsigned int RandomNumberGenerator::GenerateBit | ( | ) | [virtual, inherited] |
generate new random bit and return it
Default implementation is to call GenerateByte() and return its parity.
Reimplemented in PublicBlumBlumShub.
Definition at line 117 of file cryptlib.cpp.
References RandomNumberGenerator::GenerateByte().
Referenced by XTR_FindPrimesAndGenerator().
void RandomNumberGenerator::GenerateBlock | ( | byte * | output, | |
size_t | size | |||
) | [virtual, inherited] |
generate random array of bytes
Default implementation is to call GenerateByte() size times.
Reimplemented in KDF2_RNG, NonblockingRng, BlockingRng, and RandomPool.
Definition at line 122 of file cryptlib.cpp.
References RandomNumberGenerator::GenerateByte().
Referenced by PSSR_MEM_Base::ComputeMessageRepresentative(), DL_GroupParameters_DSA::GenerateRandom(), OAEP_Base::Pad(), Integer::Randomize(), PolynomialMod2::Randomize(), and ElGamalBase::SymmetricEncrypt().