Bell catchup

This commit is contained in:
philippe44
2023-07-26 13:19:20 -07:00
parent 859efdb954
commit 232afb948b
467 changed files with 77538 additions and 37137 deletions

View File

@@ -135,14 +135,20 @@ std::vector<uint8_t> CryptoMbedTLS::pbkdf2HmacSha1(
int iterations, int digestSize) {
auto digest = std::vector<uint8_t>(digestSize);
#if MBEDTLS_VERSION_NUMBER < 0x03030000
// Init sha context
sha1Init();
mbedtls_pkcs5_pbkdf2_hmac(&sha1Context, password.data(), password.size(),
salt.data(), salt.size(), iterations, digestSize,
digest.data());
// Free sha context
mbedtls_md_free(&sha1Context);
#else
mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, password.data(), password.size(),
salt.data(), salt.size(), iterations, digestSize,
digest.data());
#endif
return digest;
}
@@ -230,4 +236,4 @@ std::vector<uint8_t> CryptoMbedTLS::generateVectorWithRandomData(
mbedtls_ctr_drbg_free(&ctrDrbg);
return randomVector;
}
}