fix mac build 3
This commit is contained in:
3
external/mx25519/src/platform.c
vendored
3
external/mx25519/src/platform.c
vendored
@@ -36,8 +36,9 @@ uint64_t mx25519_cpu_cycles() {
|
|||||||
uint64_t vct;
|
uint64_t vct;
|
||||||
__asm__ volatile("mrs %0, cntvct_el0" : "=r"(vct));
|
__asm__ volatile("mrs %0, cntvct_el0" : "=r"(vct));
|
||||||
return vct;
|
return vct;
|
||||||
#endif
|
#else
|
||||||
return clock(); /* fallback */
|
return clock(); /* fallback */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
double mx25519_wall_clock() {
|
double mx25519_wall_clock() {
|
||||||
|
|||||||
@@ -82,7 +82,8 @@ static void debug_hex(const char* label, const uint8_t* data, size_t len)
|
|||||||
static constexpr char log_category_prefix[] = "CarrotCrypto ";
|
static constexpr char log_category_prefix[] = "CarrotCrypto ";
|
||||||
char hex[130] = {0};
|
char hex[130] = {0};
|
||||||
for (size_t i = 0; i < len && i < 64; ++i) {
|
for (size_t i = 0; i < len && i < 64; ++i) {
|
||||||
sprintf(hex + i*2, "%02x", data[i]);
|
// Use snprintf to avoid deprecated sprintf and keep bounds safe
|
||||||
|
snprintf(hex + i*2, sizeof(hex) - (i*2), "%02x", data[i]);
|
||||||
}
|
}
|
||||||
LOGINFO(0, label << ": " << static_cast<const char*>(hex));
|
LOGINFO(0, label << ": " << static_cast<const char*>(hex));
|
||||||
}
|
}
|
||||||
@@ -420,4 +421,3 @@ void encrypt_anchor(
|
|||||||
|
|
||||||
} // namespace carrot
|
} // namespace carrot
|
||||||
} // namespace p2pool
|
} // namespace p2pool
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user