5 void *BF_Init(byte *key, unsigned keylen);
\r
6 void BF_Enc(void *handle, byte *chipher, byte *plain, int len);
\r
7 void BF_Dec(void *handle, byte *plain, byte *chipher);
\r
8 void BF_Free(void *handle);
\r
12 Crypt::Crypt() : handle(NULL)
\r
18 if (handle != NULL) {
\r
23 BOOL Crypt::ResetStream(byte *key, unsigned int len)
\r
25 if (handle != NULL) {
\r
30 handle = BF_Init(key, len);
\r
31 if (handle == NULL) return FALSE;
\r
36 BOOL Crypt::Encrypt(byte *chipher, byte *plain, int len)
\r
38 if (handle == NULL) {
\r
39 SetLastError(ERROR_INVALID_DATA);
\r
42 BF_Enc(handle, chipher, plain, len);
\r
46 BOOL Crypt::Decrypt(byte *plain, byte *chipher)
\r
48 if (handle == NULL) {
\r
49 SetLastError(ERROR_INVALID_DATA);
\r
52 BF_Dec(handle, plain, chipher);
\r