From e6cb2c87dc119268a75ac6f41645b96400abdd7c Mon Sep 17 00:00:00 2001 From: aunsane Date: Wed, 20 Dec 2017 23:44:35 +0300 Subject: libtox moved to tox folder instead of libs --- .../crypto_pwhash_scryptsalsa208sha256/utils.c | 78 ---------------------- 1 file changed, 78 deletions(-) delete mode 100644 libs/libtox/src/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c (limited to 'libs/libtox/src/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c') diff --git a/libs/libtox/src/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c b/libs/libtox/src/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c deleted file mode 100644 index e61ccf3ecf..0000000000 --- a/libs/libtox/src/toxencryptsave/crypto_pwhash_scryptsalsa208sha256/utils.c +++ /dev/null @@ -1,78 +0,0 @@ -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif -#ifdef VANILLA_NACL /* toxcore only uses this when libsodium is unavailable */ - -#ifndef __STDC_WANT_LIB_EXT1__ -# define __STDC_WANT_LIB_EXT1__ 1 -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -#ifdef HAVE_SYS_MMAN_H -# include -#endif - -#include "utils.h" - -#ifdef _WIN32 -# include -# include -#else -# include -#endif - -#ifdef HAVE_WEAK_SYMBOLS -__attribute__((weak)) void -__sodium_dummy_symbol_to_prevent_lto(void * const pnt, const size_t len) -{ - (void) pnt; - (void) len; -} -#endif - -void -sodium_memzero(void * const pnt, const size_t len) -{ -#ifdef _WIN32 - SecureZeroMemory(pnt, len); -#elif defined(HAVE_MEMSET_S) - if (memset_s(pnt, (rsize_t) len, 0, (rsize_t) len) != 0) { - abort(); - } -#elif defined(HAVE_EXPLICIT_BZERO) - explicit_bzero(pnt, len); -#elif HAVE_WEAK_SYMBOLS - memset(pnt, 0, len); - __sodium_dummy_symbol_to_prevent_lto(pnt, len); -#else - volatile unsigned char *pnt_ = (volatile unsigned char *) pnt; - size_t i = (size_t) 0U; - - while (i < len) { - pnt_[i++] = 0U; - } -#endif -} - -int -sodium_memcmp(const void * const b1_, const void * const b2_, size_t len) -{ - const unsigned char *b1 = (const unsigned char *) b1_; - const unsigned char *b2 = (const unsigned char *) b2_; - size_t i; - unsigned char d = (unsigned char) 0U; - - for (i = 0U; i < len; i++) { - d |= b1[i] ^ b2[i]; - } - return (int) ((1 & ((d - 1) >> 8)) - 1); -} - -#endif -- cgit v1.2.3