From d3787c23b8d5f73dec31e17637d9a9f3639dce1d Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Sun, 9 Jun 2019 00:02:23 +0200 Subject: [PATCH] Rename PBKDF2_SHA256 to escrypt_PBKDF2_SHA256 --- .../nosse/pwhash_scryptsalsa208sha256_nosse.c | 4 ++-- .../crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c | 7 ++++--- .../crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h | 6 +++--- .../sse/pwhash_scryptsalsa208sha256_sse.c | 4 ++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c index b1c1bd84..d7bf18d2 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/nosse/pwhash_scryptsalsa208sha256_nosse.c @@ -363,7 +363,7 @@ escrypt_kdf_nosse(escrypt_local_t *local, const uint8_t *passwd, XY = (uint32_t *) ((uint8_t *) V + V_size); /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ - PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); + escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); /* 2: for i = 0 to p - 1 do */ for (i = 0; i < p; i++) { @@ -372,7 +372,7 @@ escrypt_kdf_nosse(escrypt_local_t *local, const uint8_t *passwd, } /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ - PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); + escrypt_PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); /* Success! */ return 0; diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c index 42cab61f..bcf7da55 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.c @@ -39,13 +39,14 @@ #include "utils.h" /** - * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). */ void -PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, const uint8_t *salt, - size_t saltlen, uint64_t c, uint8_t *buf, size_t dkLen) +escrypt_PBKDF2_SHA256(const uint8_t *passwd, size_t passwdlen, + const uint8_t *salt, size_t saltlen, uint64_t c, + uint8_t *buf, size_t dkLen) { crypto_auth_hmacsha256_state PShctx, hctx; size_t i; diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h index f9598c87..962b4331 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/pbkdf2-sha256.h @@ -35,11 +35,11 @@ #include "crypto_auth_hmacsha256.h" /** - * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). */ -void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, - uint8_t *, size_t); +void escrypt_PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, + uint64_t, uint8_t *, size_t); #endif /* !_SHA256_H_ */ diff --git a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c index 754a19fd..79dbb87a 100644 --- a/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c +++ b/src/libsodium/crypto_pwhash/scryptsalsa208sha256/sse/pwhash_scryptsalsa208sha256_sse.c @@ -383,7 +383,7 @@ escrypt_kdf_sse(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen, XY = (uint32_t *) ((uint8_t *) V + V_size); /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ - PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); + escrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, B_size); /* 2: for i = 0 to p - 1 do */ for (i = 0; i < p; i++) { @@ -392,7 +392,7 @@ escrypt_kdf_sse(escrypt_local_t *local, const uint8_t *passwd, size_t passwdlen, } /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ - PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); + escrypt_PBKDF2_SHA256(passwd, passwdlen, B, B_size, 1, buf, buflen); /* Success! */ return 0;