Remove crypto_pwhash_scryptxsalsa208sha256_BYTES, support any output length.

A _BYTES macro will be more useful for the crypt()-like interface.
This commit is contained in:
Frank Denis 2014-05-07 00:24:58 -07:00
parent d1a1afb6e9
commit 2702aa1a24
2 changed files with 3 additions and 11 deletions

View File

@ -42,12 +42,6 @@ pickparams(const size_t memlimit, unsigned long long opslimit,
return 0;
}
size_t
crypto_pwhash_scryptxsalsa208sha256_bytes(void)
{
return crypto_pwhash_scryptxsalsa208sha256_BYTES;
}
size_t
crypto_pwhash_scryptxsalsa208sha256_saltbytes(void)
{
@ -56,6 +50,7 @@ crypto_pwhash_scryptxsalsa208sha256_saltbytes(void)
int
crypto_pwhash_scryptxsalsa208sha256(unsigned char * const out,
unsigned long long outlen,
const char * const passwd,
unsigned long long passwdlen,
const unsigned char * const salt,
@ -78,5 +73,5 @@ crypto_pwhash_scryptxsalsa208sha256(unsigned char * const out,
(const uint8_t *) salt,
crypto_pwhash_scryptxsalsa208sha256_SALTBYTES,
(uint64_t) (1) << N_log2, r, p,
out, crypto_pwhash_scryptxsalsa208sha256_BYTES);
out, outlen);
}

View File

@ -6,7 +6,6 @@
#include "export.h"
#define crypto_pwhash_scryptxsalsa208sha256_BYTES 64
#define crypto_pwhash_scryptxsalsa208sha256_SALTBYTES 32
#ifdef __cplusplus
@ -16,14 +15,12 @@
extern "C" {
#endif
SODIUM_EXPORT
size_t crypto_pwhash_scryptxsalsa208sha256_bytes(void);
SODIUM_EXPORT
size_t crypto_pwhash_scryptxsalsa208sha256_saltbytes(void);
SODIUM_EXPORT
int crypto_pwhash_scryptxsalsa208sha256(unsigned char * const out,
unsigned long long outlen,
const char * const passwd,
unsigned long long passwdlen,
const unsigned char * const salt,