diff options
Diffstat (limited to 'toxcore/crypto_core.c')
-rw-r--r-- | toxcore/crypto_core.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/toxcore/crypto_core.c b/toxcore/crypto_core.c index d3a3e1fc..4d536cf7 100644 --- a/toxcore/crypto_core.c +++ b/toxcore/crypto_core.c | |||
@@ -268,27 +268,6 @@ void crypto_sha512(uint8_t *hash, const uint8_t *data, size_t length) | |||
268 | crypto_hash_sha512(hash, data, length); | 268 | crypto_hash_sha512(hash, data, length); |
269 | } | 269 | } |
270 | 270 | ||
271 | void crypto_memzero(void *data, size_t length) | ||
272 | { | ||
273 | #ifdef VANILLA_NACL | ||
274 | /* TODO(c-toxcore#347): this is insecure. We need to provide our own | ||
275 | * secure memzero/memcmp for NaCL. */ | ||
276 | memset(data, 0, length); | ||
277 | #else | ||
278 | sodium_memzero(data, length); | ||
279 | #endif | ||
280 | } | ||
281 | |||
282 | int32_t crypto_memcmp(const void *p1, const void *p2, size_t length) | ||
283 | { | ||
284 | #ifdef VANILLA_NACL | ||
285 | /* TODO(c-toxcore#347): Implement secure memcmp. */ | ||
286 | return memcmp(p1, p2, length); | ||
287 | #else | ||
288 | return sodium_memcmp(p1, p2, length); | ||
289 | #endif | ||
290 | } | ||
291 | |||
292 | void random_bytes(uint8_t *data, size_t length) | 271 | void random_bytes(uint8_t *data, size_t length) |
293 | { | 272 | { |
294 | randombytes(data, length); | 273 | randombytes(data, length); |