AuroraRuntime/Source/Crypto/TDES/TDES.cpp
Reece Wilson d63571e4b5 [+] AuCompression::CompressionInterceptor
[+] AuCrypto::CBC::CBCContext
[+] AuFS::ReadDirRecursive
[+] AuFS::DirDeleter
[+] AuCrypto::PBKDF2
[+] AuCrypto::AES::CBCEncrypt
[+] AuCrypto::AES::CBCDecrypt
[+] AuCrypto::TDES::CBCEncrypt
[+] AuCrypto::TDES::CBCDecrypt
[+] Optimize read write locks
[*] Added `ContextFlags = CONTEXT_ALL` to Win32 PlatformWalkCallStack
2022-11-06 13:23:22 +00:00

52 lines
1.3 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: TDES.cpp
Date: 2022-10-08
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "../Crypto.hpp"
#include "TDES.hpp"
#include "../CBC/CBC.hpp"
namespace Aurora::Crypto::TDES
{
AUKN_SYM bool CBCEncrypt(const AuSPtr<CBC::ICBCContext> pContext,
const Memory::MemoryViewWrite &memoryView)
{
if (!pContext)
{
SysPushErrorArg();
return false;
}
if (!memoryView.ptr)
{
SysPushErrorArg();
return false;
}
return AuStaticCast<CBC::CBCContext>(pContext)->Encrypt(::Crypto::gDesCipher,
memoryView);
}
AUKN_SYM bool CBCDecrypt(const AuSPtr<CBC::ICBCContext> pContext,
const Memory::MemoryViewWrite &memoryView)
{
if (!pContext)
{
SysPushErrorArg();
return false;
}
if (!memoryView.ptr)
{
SysPushErrorArg();
return false;
}
return AuStaticCast<CBC::CBCContext>(pContext)->Decrypt(::Crypto::gDesCipher,
memoryView);
}
}