X-Git-Url: https://git.stg.codes/stg.git/blobdiff_plain/46b0747592074017ff0ea4b33d4a7194235886e5..7ef8de40e0bcdd931f5a400fd586fee3a1aaaeea:/libs/crypto/blowfish.c?ds=sidebyside diff --git a/libs/crypto/blowfish.c b/libs/crypto/blowfish.c index 384d3a10..42b9158a 100644 --- a/libs/crypto/blowfish.c +++ b/libs/crypto/blowfish.c @@ -384,10 +384,11 @@ Xl = Xl ^ ctx->P[0]; *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)); @@ -406,7 +407,7 @@ for (i = 0; i < N + 2; ++i) for (k = 0; k < 4; ++k) { - data = (data << 8) | key[j]; + data = (data << 8) | keyPtr[j]; j = j + 1; if (j >= keyLen) j = 0;