From 0a366dcbd80841e6372530e9fe9de4be9945c4ca Mon Sep 17 00:00:00 2001 From: avinal <185067@nith.ac.in> Date: Sat, 6 Mar 2021 23:12:59 +0530 Subject: [PATCH] changed according to Google Guidelines --- include/blowfish/{blowfish.hpp => blowfish.h} | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) rename include/blowfish/{blowfish.hpp => blowfish.h} (52%) diff --git a/include/blowfish/blowfish.hpp b/include/blowfish/blowfish.h similarity index 52% rename from include/blowfish/blowfish.hpp rename to include/blowfish/blowfish.h index e5730b3..f03223a 100644 --- a/include/blowfish/blowfish.hpp +++ b/include/blowfish/blowfish.h @@ -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 #include +#include -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 PArray; + std::array PArray; std::array, 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_