updated build system
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
All checks were successful
BlockStorage/repertory/pipeline/head This commit looks good
This commit is contained in:
@@ -120,29 +120,29 @@ auto create_hash_sha512(const unsigned char *data,
|
||||
crypto_hash_sha512_state state{};
|
||||
auto res = crypto_hash_sha512_init(&state);
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception({
|
||||
function_name,
|
||||
"failed to initialize sha-512",
|
||||
std::to_string(res),
|
||||
});
|
||||
throw utils::error::create_exception(function_name,
|
||||
{
|
||||
"failed to initialize sha-512",
|
||||
std::to_string(res),
|
||||
});
|
||||
}
|
||||
|
||||
res = crypto_hash_sha512_update(&state, data, data_size);
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception({
|
||||
function_name,
|
||||
"failed to update sha-512",
|
||||
std::to_string(res),
|
||||
});
|
||||
throw utils::error::create_exception(function_name,
|
||||
{
|
||||
"failed to update sha-512",
|
||||
std::to_string(res),
|
||||
});
|
||||
}
|
||||
|
||||
res = crypto_hash_sha512_final(&state, hash.data());
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception({
|
||||
function_name,
|
||||
"failed to finalize sha-512",
|
||||
std::to_string(res),
|
||||
});
|
||||
throw utils::error::create_exception(function_name,
|
||||
{
|
||||
"failed to finalize sha-512",
|
||||
std::to_string(res),
|
||||
});
|
||||
}
|
||||
|
||||
return hash;
|
||||
@@ -157,29 +157,29 @@ auto create_hash_sha256(const unsigned char *data,
|
||||
crypto_hash_sha256_state state{};
|
||||
auto res = crypto_hash_sha256_init(&state);
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception({
|
||||
function_name,
|
||||
"failed to initialize sha-256",
|
||||
std::to_string(res),
|
||||
});
|
||||
throw utils::error::create_exception(function_name,
|
||||
{
|
||||
"failed to initialize sha-256",
|
||||
std::to_string(res),
|
||||
});
|
||||
}
|
||||
|
||||
res = crypto_hash_sha256_update(&state, data, data_size);
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception({
|
||||
function_name,
|
||||
"failed to update sha-256",
|
||||
std::to_string(res),
|
||||
});
|
||||
throw utils::error::create_exception(function_name,
|
||||
{
|
||||
"failed to update sha-256",
|
||||
std::to_string(res),
|
||||
});
|
||||
}
|
||||
|
||||
res = crypto_hash_sha256_final(&state, hash.data());
|
||||
if (res != 0) {
|
||||
throw utils::error::create_exception({
|
||||
function_name,
|
||||
"failed to finalize sha-256",
|
||||
std::to_string(res),
|
||||
});
|
||||
throw utils::error::create_exception(function_name,
|
||||
{
|
||||
"failed to finalize sha-256",
|
||||
std::to_string(res),
|
||||
});
|
||||
}
|
||||
|
||||
return hash;
|
||||
|
Reference in New Issue
Block a user