Skip to content

Commit d4233e9

Browse files
committed
rename arguments
1 parent e9ff57d commit d4233e9

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

doc/crypt.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7106,13 +7106,13 @@ \subsection{bcrypt}
71067106

71077107
\index{bcrypt()}
71087108
\begin{alltt}
7109-
int bcrypt_pbkdf_openbsd(const char *password, unsigned long password_len,
7110-
const unsigned char *salt, unsigned long salt_len,
7111-
unsigned int rounds, int hash_idx,
7112-
unsigned char *out, unsigned long *outlen);
7109+
int bcrypt_pbkdf_openbsd(const void *secret, unsigned long secret_len,
7110+
const unsigned char *salt, unsigned long salt_len,
7111+
unsigned int rounds, int hash_idx,
7112+
unsigned char *out, unsigned long *outlen);
71137113
\end{alltt}
71147114

7115-
The \textit{password} parameter is the utf-8 encoded user password of length \textit{password\_len}.
7115+
The \textit{secret} parameter is the secret of length \textit{secret\_len} (most of the time a utf-8 encoded user password).
71167116
The \textit{salt} parameter is a pointer to the array of octets of length \textit{salt\_len} containing the salt.
71177117
The \textit{rounds} parameter defines the number of iterations of the expensive key setup that shall be executed.
71187118
The \textit{hash\_idx} parameter defines the hash algorithm that shall be used.

src/headers/tomcrypt_misc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ int base16_decode(const char *in, unsigned long inlen,
6060
#endif
6161

6262
#ifdef LTC_BCRYPT
63-
int bcrypt_pbkdf_openbsd(const char *password, unsigned long password_len,
64-
const unsigned char *salt, unsigned long salt_len,
65-
unsigned int rounds, int hash_idx,
66-
unsigned char *out, unsigned long *outlen);
63+
int bcrypt_pbkdf_openbsd(const void *secret, unsigned long secret_len,
64+
const unsigned char *salt, unsigned long salt_len,
65+
unsigned int rounds, int hash_idx,
66+
unsigned char *out, unsigned long *outlen);
6767
#endif
6868

6969
/* ===> LTC_HKDF -- RFC5869 HMAC-based Key Derivation Function <=== */

src/misc/bcrypt/bcrypt.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,23 +78,23 @@ static int _bcrypt_pbkdf_hash(const unsigned char *pass, unsigned long passlen,
7878
@param outlen [in/out] The desired size of the algorithm output
7979
@return CRYPT_OK if successful
8080
*/
81-
int bcrypt_pbkdf_openbsd(const char *password, unsigned long password_len,
82-
const unsigned char *salt, unsigned long salt_len,
83-
unsigned int rounds, int hash_idx,
84-
unsigned char *out, unsigned long *outlen)
81+
int bcrypt_pbkdf_openbsd(const void *secret, unsigned long secret_len,
82+
const unsigned char *salt, unsigned long salt_len,
83+
unsigned int rounds, int hash_idx,
84+
unsigned char *out, unsigned long *outlen)
8585
{
8686
int err;
8787
ulong32 blkno;
8888
unsigned long left, itts, x, y, hashed_pass_len, step_size, steps, dest, used_rounds;
8989
unsigned char *buf[3], blkbuf[4];
9090
unsigned char *hashed_pass;
9191

92-
LTC_ARGCHK(password != NULL);
93-
LTC_ARGCHK(salt != NULL);
94-
LTC_ARGCHK(out != NULL);
95-
LTC_ARGCHK(outlen != NULL);
92+
LTC_ARGCHK(secret != NULL);
93+
LTC_ARGCHK(salt != NULL);
94+
LTC_ARGCHK(out != NULL);
95+
LTC_ARGCHK(outlen != NULL);
9696

97-
if ((password_len == 0) || (salt_len == 0) || (*outlen == 0)) {
97+
if ((secret_len == 0) || (salt_len == 0) || (*outlen == 0)) {
9898
return CRYPT_INVALID_ARG;
9999
}
100100
/* test hash IDX */
@@ -127,7 +127,7 @@ int bcrypt_pbkdf_openbsd(const char *password, unsigned long password_l
127127
steps = (*outlen + step_size - 1) / step_size;
128128

129129
hashed_pass_len = MAXBLOCKSIZE;
130-
if ((err = hash_memory(hash_idx, (unsigned char*)password, password_len, hashed_pass, &hashed_pass_len)) != CRYPT_OK) {
130+
if ((err = hash_memory(hash_idx, (unsigned char*)secret, secret_len, hashed_pass, &hashed_pass_len)) != CRYPT_OK) {
131131
goto LBL_ERR;
132132
}
133133

0 commit comments

Comments
 (0)