mirror of
https://github.com/avinal/blowfish.git
synced 2026-01-09 22:38:33 +05:30
header files updated with uint32_t
This commit is contained in:
@@ -13,23 +13,25 @@
|
||||
#define MAXKEYBYTES 56 // 448 bits max
|
||||
#define N 16
|
||||
|
||||
#define BYTE unsigned char
|
||||
#define DWORD unsigned long
|
||||
#define WORD unsigned int
|
||||
|
||||
#if !defined(BLOWFISH_BLOWFISH_H_)
|
||||
#define BLOWFISH_BLOWFISH_H_
|
||||
|
||||
class Blowfish {
|
||||
private:
|
||||
std::array<DWORD, N + 2> PArray;
|
||||
std::array<std::array<DWORD, 256>, 4> Sboxes;
|
||||
DWORD F(DWORD x);
|
||||
std::array<uint32_t, N + 2> PArray;
|
||||
std::array<std::array<uint32_t, 256>, 4> Sboxes;
|
||||
uint32_t F(uint32_t x);
|
||||
|
||||
public:
|
||||
Blowfish() {}
|
||||
Blowfish(std::string const &key);
|
||||
void encrypt(DWORD &xl, DWORD &xr);
|
||||
void decrypt(DWORD &xl, DWORD &xr);
|
||||
Blowfish(Blowfish const &) = delete;
|
||||
|
||||
void initialize(std::string const &key);
|
||||
|
||||
void encrypt(uint32_t &xl, uint32_t &xr);
|
||||
void decrypt(uint32_t &xl, uint32_t &xr);
|
||||
};
|
||||
|
||||
#endif // BLOWFISH_BLOWFISH_H_
|
||||
|
||||
Reference in New Issue
Block a user