forked from BlockchainCommons/bc-ur
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove some unnecessary wrapper functions
- Loading branch information
1 parent
de039d6
commit 7650813
Showing
6 changed files
with
20 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,7 @@ | |
#include "xoshiro256.hpp" | ||
#include <limits> | ||
#include <cstring> | ||
#include <mbedtls/sha256.h> | ||
|
||
/* Written in 2018 by David Blackman and Sebastiano Vigna ([email protected]) | ||
|
@@ -55,7 +56,12 @@ void Xoshiro256::set_s(const std::array<uint8_t, 32>& a) { | |
|
||
void Xoshiro256::hash_then_set_s(const ByteVector& bytes) { | ||
std::array<uint8_t, 32> a; | ||
sha256(bytes, a); | ||
mbedtls_sha256_context ctx; | ||
mbedtls_sha256_init(&ctx); | ||
mbedtls_sha256_starts(&ctx, 0); | ||
mbedtls_sha256_update(&ctx, bytes.data(), bytes.size()); | ||
mbedtls_sha256_finish(&ctx, a.data()); | ||
mbedtls_sha256_free(&ctx); | ||
set_s(a); | ||
} | ||
|
||
|