1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

pow-testgiver support

This commit is contained in:
ton 2020-07-06 17:07:20 +03:00
parent dbde9c1c40
commit f064b1047a
257 changed files with 6665 additions and 2608 deletions

View file

@ -16,7 +16,9 @@
Copyright 2017-2020 Telegram Systems LLP
*/
#include "td/utils/Slice.h"
#if TD_HAVE_OPENSSL
#include <openssl/crypto.h>
#endif
@ -26,16 +28,18 @@ namespace td {
void MutableSlice::fill(char c) {
std::memset(data(), c, size());
}
void MutableSlice::fill_zero() {
fill(0);
fill('\0');
}
void MutableSlice::fill_zero_secure() {
#if TD_HAVE_OPENSSL
OPENSSL_cleanse(begin(), size());
#else
volatile char *ptr = begin();
for (size_t i = 0; i < size(); i++) {
ptr[i] = 0;
ptr[i] = '\0';
}
#endif
}