changed according to Google Guidelines

This commit is contained in:
avinal
2021-03-06 23:12:59 +05:30
parent ddeda3c8d4
commit 0a366dcbd8

View File

@@ -1,4 +1,4 @@
/**
/*
* @file blowfish.hpp
* @author Avinal Kumar
* @since February 15, 2021
@@ -6,28 +6,30 @@
* Blowfish Algorithm Header File
*/
#define MAXKEYBYTES 56 // 448 bits max
#define DWORD unsigned long
#define WORD unsigned int
#define BYTE unsigned char
#if !defined(BLOWFISH_HPP)
#define BLOWFISH_HPP
#include <algorithm>
#include <array>
#include <string>
class blowfish {
#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, 16 + 2> PArray;
std::array<DWORD, N + 2> PArray;
std::array<std::array<DWORD, 256>, 4> Sboxes;
DWORD F(DWORD x);
public:
blowfish(BYTE *key, WORD keylength);
void encrypt(DWORD *xl, DWORD *xr);
void decrypt(DWORD *xl, DWORD *xr);
Blowfish(std::string const &key);
void encrypt(DWORD &xl, DWORD &xr);
void decrypt(DWORD &xl, DWORD &xr);
};
#endif // BLOWFISH_HPP
#endif // BLOWFISH_BLOWFISH_H_