polserver/pol-core/pol/crypt/cryptkey.h
turleypol 43b776b94d
New format lib version (#592)
* renamed include guard to be able to use both format lib versions in
parallel

* build Fmt lib and link it into clib

* use std::string instead of format Writer for logging
added variant "2" for logging with new fmt lib

* use new logging variant for two logs

* always add \n to flush log, lets see if the assumption holds

* use new lib for tostring

* replaced all INFO_PRINTS in clib

* formatter for Token, BObject and BObjectImp

* started with bsccript

* use function instead of actual object for logging

* remaining bscript, started plib

* logvariant without newline added, more template magic

* format support for base types, added test for format padding
new version for fdump

* chanhed ecompile/runecl fixed compilation with ESCRIPT_PROFILE

* rewrite INFO_PRINT in plib,poltool/uoconvert/uotool

* replaced remaining INFO_PRINTS, renamed macros INFO_PRINT for logging
without newline, INFO_PRINTLN for newline addition.
Replaced also INFO_PRINT_TRACE and renamed it to INFO_PRINTLN_TRACE

* gitignore for fmt lib

* cleanup vim leftovers
2024-01-10 18:29:10 +01:00

45 lines
1 KiB
C++

/********************************************************************
** cryptkey.h : Encryption keys (and 'type' codes)
**
** Created: 3/1/2003, 2:59
** Author: TJ Houston <tjh@myrathi.co.uk>
**
*********************************************************************/
#ifndef __CRYPTKEY_H__
#define __CRYPTKEY_H__
#include <fmt/format.h>
#include <string>
namespace Pol
{
namespace Crypt
{
// Encryption Types
enum ECryptType
{
CRYPT_NOCRYPT = 0, //- no encryption
CRYPT_OLD_BLOWFISH = 1,
CRYPT_1_25_36 = 2,
CRYPT_BLOWFISH = 3, //- <=2.0.0 (BlowFish)
CRYPT_BLOWFISH_TWOFISH = 4, //- 2.0.3 (BlowFish+TwoFish)
CRYPT_TWOFISH = 5 //- >2.0.3 (TwoFish)
};
inline auto format_as( ECryptType c )
{
return fmt::underlying( c );
}
// Encryption keys and type
typedef struct _CryptInfo
{
unsigned int uiKey1;
unsigned int uiKey2;
ECryptType eType;
} TCryptInfo;
void CalculateCryptKeys( const std::string& name, TCryptInfo& infoCrypt );
} // namespace Crypt
} // namespace Pol
#endif //__CRYPTKEY_H__