/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: PBKDF2.cpp Date: 2022-10-08 Author: Reece ***/ #include #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(), password.length, salt.Begin(), salt.length, uIterations, ::Crypto::HashMethodToId(hashType), out.Begin(), &len) == CRYPT_OK && len == out.length; } }