AuroraRuntime/Source/Crypto/PBKDF2/PBKDF2.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

29 lines
1.0 KiB
C++

/***
Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved.
File: PBKDF2.cpp
Date: 2022-10-08
Author: Reece
***/
#include <Source/RuntimeInternal.hpp>
#include "../Crypto.hpp"
namespace Aurora::Crypto::PBKDF2
{
AUKN_SYM bool PBKDF2(const Memory::MemoryViewRead &salt,
const Memory::MemoryViewRead &password,
Hashing::EHashType hashType,
AuUInt32 uIterations,
const Memory::MemoryViewWrite &out)
{
unsigned long len = out.length;
return ::pkcs_5_alg2(password.Begin<unsigned char>(),
password.length,
salt.Begin<unsigned char>(),
salt.length,
uIterations,
::Crypto::HashMethodToId(hashType),
out.Begin<unsigned char>(),
&len) == CRYPT_OK && len == out.length;
}
}