mirror of
https://github.com/redstrate/Kawari.git
synced 2025-04-27 00:47:45 +00:00
I ended up just stealing this from iolite, which in turn took it from Sapphire. I tried for a few hours to get a Rust Blowfish implementation going, but the one from Physis didn't work. I'll try again later.
21 lines
429 B
C++
21 lines
429 B
C++
#include <cstdint>
|
|
extern "C"
|
|
{
|
|
|
|
typedef void *BlowfishHandle;
|
|
|
|
#define DWORD uint32_t
|
|
#define WORD unsigned short
|
|
#define BYTE uint8_t
|
|
|
|
struct ExpandedKey
|
|
{
|
|
DWORD *PArray;
|
|
DWORD (*SBoxes)
|
|
[256];
|
|
};
|
|
|
|
BYTE *blowfish_encode(BYTE *key, uint32_t keybytes, BYTE *pInput, DWORD lSize);
|
|
BYTE *blowfish_decode(BYTE *key, uint32_t keybytes, BYTE *pInput, DWORD lSize);
|
|
//__declspec(dllexport) void destroy(BlowFish hanle);
|
|
}
|