*xr = Xr;
}
//-----------------------------------------------------------------------------
-void Blowfish_Init(BLOWFISH_CTX *ctx, unsigned char *key, int keyLen)
+void Blowfish_Init(BLOWFISH_CTX *ctx, void* key, int keyLen)
{
int i, j, k;
uint32_t data, datal, datar;
+unsigned char* keyPtr = key;
memset(ctx->S, 0, sizeof(ctx->S));
for (k = 0; k < 4; ++k)
{
- data = (data << 8) | key[j];
+ data = (data << 8) | keyPtr[j];
j = j + 1;
if (j >= keyLen)
j = 0;
uint32_t S[4][256];
} BLOWFISH_CTX;
-void Blowfish_Init(BLOWFISH_CTX * ctx, unsigned char * key, int keyLen);
+void Blowfish_Init(BLOWFISH_CTX * ctx, void* key, int keyLen);
void Blowfish_Encrypt(const BLOWFISH_CTX * ctx, uint32_t * xl, uint32_t * xr);
void Blowfish_Decrypt(const BLOWFISH_CTX * ctx, uint32_t * xl, uint32_t * xr);