1 /* Copyright (C) 2009 Trend Micro Inc.
4 * This program is a free software; you can redistribute it
5 * and/or modify it under the terms of the GNU General Public
6 * License (version 2) as published by the FSF - Free Software
10 /* OS_crypto/blowfish Library
11 * APIs for many crypto operations
21 typedef unsigned char uchar;
24 int OS_BF_Str(const char *input, char *output, const char *charkey,
25 long size, short int action)
28 static unsigned char cbc_iv [8] = {0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10};
31 memcpy(iv, cbc_iv, sizeof(iv));
33 BF_set_key(&key, (int)strlen(charkey), (const uchar *)charkey);
35 BF_cbc_encrypt((const uchar *)input, (uchar *)output, (long)size,