11 AssertValidKeyLength(keylength);
16 memcpy(pbox, p_init,
sizeof(p_init));
17 memcpy(sbox, s_init,
sizeof(s_init));
20 for (i=0 ; i<ROUNDS+2 ; ++i)
23 for (k=0 ; k<4 ; ++k )
24 data = (data << 8) | key_string[j++ % keylength];
28 crypt_block(dspace, pbox);
30 for (i=0; i<ROUNDS; i+=2)
31 crypt_block(pbox+i, pbox+i+2);
33 crypt_block(pbox+ROUNDS, sbox);
35 for (i=0; i<4*256-2; i+=2)
36 crypt_block(sbox+i, sbox+i+2);
38 if (!IsForwardTransformation())
39 for (i=0; i<(ROUNDS+2)/2; i++)
54 for (
unsigned i=0; i<ROUNDS/2; i++)
83 for (
unsigned i=0; i<ROUNDS/2; i++)
FixedSizeSecBlock< word32, 4 *256 > sbox
Utility functions for the Crypto++ library.
void swap(dev::eth::Watch &_a, dev::eth::Watch &_b)
#define NAMESPACE_BEGIN(x)
static GetBlock< T, B, GA > Get(const void *block)
Classes for the Blowfish block cipher.
void ProcessAndXorBlock(const byte *inBlock, const byte *xorBlock, byte *outBlock) const
Encrypt or decrypt a block.
FixedSizeSecBlock< word32, ROUNDS+2 > pbox
BlockGetAndPut< word32, BigEndian > Block
void * memcpy(void *a, const void *b, size_t c)
Class specific implementation and overrides used to operate the cipher.
void crypt_block(const word32 in[2], word32 out[2]) const
Interface for retrieving values given their names.