From 7791007caf5a5c84835b889acb3e86abfbb14405 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sat, 12 Apr 2014 00:51:49 -0700 Subject: [PATCH] Remove non-threadsafe versions of the crypt(3)-like interface to scrypt. --- .../crypto_scrypt-common.c | 25 ------------------- .../scryptxsalsa208sha256/crypto_scrypt.h | 6 ----- 2 files changed, 31 deletions(-) diff --git a/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c b/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c index c03d1214..9791863d 100644 --- a/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c +++ b/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt-common.c @@ -170,22 +170,6 @@ escrypt_r(escrypt_local_t * local, return buf; } -uint8_t * -escrypt(const uint8_t * passwd, const uint8_t * setting) -{ - static uint8_t buf[4 + 1 + 5 + 5 + BYTES2CHARS(32) + 1 + HASH_LEN + 1]; - escrypt_local_t local; - uint8_t * retval; - - if (escrypt_init_local(&local)) - return NULL; - retval = escrypt_r(&local, - passwd, strlen((char *)passwd), setting, buf, sizeof(buf)); - if (escrypt_free_local(&local)) - return NULL; - return retval; -} - uint8_t * escrypt_gensalt_r(uint32_t N_log2, uint32_t r, uint32_t p, const uint8_t * src, size_t srclen, @@ -227,15 +211,6 @@ escrypt_gensalt_r(uint32_t N_log2, uint32_t r, uint32_t p, return buf; } -uint8_t * -escrypt_gensalt(uint32_t N_log2, uint32_t r, uint32_t p, - const uint8_t * src, size_t srclen) -{ - static uint8_t buf[4 + 1 + 5 + 5 + BYTES2CHARS(32) + 1]; - return escrypt_gensalt_r(N_log2, r, p, src, srclen, - buf, sizeof(buf)); -} - int crypto_scrypt(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, diff --git a/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt.h b/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt.h index cd9e53ea..2a1d8d18 100644 --- a/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt.h +++ b/src/libsodium/crypto_pwhash/scryptxsalsa208sha256/crypto_scrypt.h @@ -77,15 +77,9 @@ extern uint8_t * escrypt_r(escrypt_local_t * __local, const uint8_t * __setting, uint8_t * __buf, size_t __buflen); -extern uint8_t * escrypt(const uint8_t * __passwd, const uint8_t * __setting); - extern uint8_t * escrypt_gensalt_r( uint32_t __N_log2, uint32_t __r, uint32_t __p, const uint8_t * __src, size_t __srclen, uint8_t * __buf, size_t __buflen); -extern uint8_t * escrypt_gensalt( - uint32_t __N_log2, uint32_t __r, uint32_t __p, - const uint8_t * __src, size_t __srclen); - #endif /* !_CRYPTO_SCRYPT_H_ */