Added the capability for custom encryption's to be added to EHC.

This commit is contained in:
2024-10-06 22:54:29 -07:00
parent 1feff0a25c
commit 8b01ee3c46
15 changed files with 392 additions and 182 deletions

View File

@@ -0,0 +1,76 @@
#include "ehs/io/socket/ehc/NetEnc.h"
namespace ehs
{
NetEnc::NetEnc()
: owner(nullptr), hashId(0)
{
}
NetEnc::NetEnc(Str_8 id)
: owner(nullptr), hashId(id.Hash_64()), id((Str_8 &&)id)
{
}
NetEnc::NetEnc(NetEnc&& enc) noexcept
: owner(enc.owner), hashId(enc.hashId), id((Str_8 &&)enc.id)
{
enc.owner = nullptr;
enc.hashId = 0;
}
NetEnc::NetEnc(const NetEnc& enc)
: owner(nullptr), hashId(enc.hashId), id(enc.id)
{
}
NetEnc& NetEnc::operator=(NetEnc&& enc) noexcept
{
if (this == &enc)
return *this;
owner = enc.owner;
hashId = enc.hashId;
id = (Str_8 &&)enc.id;
enc.owner = nullptr;
enc.hashId = 0;
return *this;
}
NetEnc& NetEnc::operator=(const NetEnc& enc)
{
if (this == &enc)
return *this;
owner = nullptr;
hashId = enc.hashId;
id = enc.id;
return *this;
}
EHC* NetEnc::GetOwner() const
{
return owner;
}
UInt_64 NetEnc::GetHashId() const
{
return hashId;
}
Str_8 NetEnc::GetId() const
{
return id;
}
void NetEnc::Encrypt(Byte *data, UInt_64 size) const
{
}
void NetEnc::Decrypt(Byte *data, UInt_64 size) const
{
}
}