代码拉取完成,页面将自动刷新
// SPDX-License-Identifier: GPL-3.0-only
/*
* Copyright (c) 2023 Dengfeng Liu <liudf0716@gmail.com>
*/
#include <string.h>
#include <assert.h>
#include <openssl/evp.h>
#include <openssl/core_names.h>
#include "fastpbkdf2.h"
void fastpbkdf2_hmac_sha1(const uint8_t *pw, size_t npw,
const uint8_t *salt, size_t nsalt,
uint32_t iterations,
uint8_t *out, size_t nout) {
PKCS5_PBKDF2_HMAC((const char *)pw, npw,
salt, nsalt, iterations,
EVP_sha1(), nout, out);
}
void fastpbkdf2_hmac_sha256(const uint8_t *pw, size_t npw,
const uint8_t *salt, size_t nsalt,
uint32_t iterations,
uint8_t *out, size_t nout) {
PKCS5_PBKDF2_HMAC((const char *)pw, npw,
salt, nsalt, iterations,
EVP_sha256(), nout, out);
}
void fastpbkdf2_hmac_sha512(const uint8_t *pw, size_t npw,
const uint8_t *salt, size_t nsalt,
uint32_t iterations,
uint8_t *out, size_t nout) {
PKCS5_PBKDF2_HMAC((const char *)pw, npw,
salt, nsalt, iterations,
EVP_sha512(), nout, out);
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。