Hi Group,
This is a general guestion. PGP provides a prewash of material using MD5
(and they also use IDEA instead of 3DES) (I think the reference I have is
correct). Looking at the source for AutoSeededX917RNG, I think a prewash
should be fairly simple.
1) Is it desireable (or needed)?
DES_EDE3::BLOCKSIZE is 8 bytes
DES_EDE3::DEFAULT_KEYLENGTH is 24 bytes
>From osrng.h, around line 110:
BYTE* seed is BLOCKSIZE + DEFAULT_KEYLENGTH bytes in length
BYTE* key is seed + BLOCKSIZE (8 bytes into seed)
do {
OS_GenerateRandomBlock( seed, seed.size() );
// Can this be moved out of the do{ } loop?
key = seed + BLOCK_CIPHER::BLOCKSIZE;
} // check that seed and key don't have same value
while ( key == seed );
// Wash 32 byte seed
// Back to Wei's code
m_rng.reset(new X917RNG(new 3DES( key, seed ) ) );
2) Would SHA256 be a good selection if a wash is chosen above?
Thanks,
Jeff