177 if (source ==
NULL || length < 1 || CipherKey ==
NULL) {
195 char cbuffer[MAX_KEY_BLOCK_SIZE];
196 int got =
Straw::Get(cbuffer, Encrypted_Key_Length());
202 if (got != Encrypted_Key_Length())
return(0);
208 CipherKey->Decrypt(cbuffer, got, Buffer);
209 BF.Key(Buffer, BLOWFISH_KEY_SIZE);
216 char buffer[MAX_KEY_BLOCK_SIZE];
217 memset(buffer,
'\0',
sizeof(buffer));
218 Rand.Get(buffer, BLOWFISH_KEY_SIZE);
223 Counter = BytesLeft = CipherKey->Encrypt(buffer, Plain_Key_Length(), Buffer);
224 BF.Key(buffer, BLOWFISH_KEY_SIZE);
232 IsGettingKey =
false;
241 int tocopy = (length < BytesLeft) ? length : BytesLeft;
242 memmove(source, &Buffer[Counter-BytesLeft], tocopy);
243 source = (
char *)source + tocopy;