Skip to content

Commit

Permalink
Merge pull request #78 from joshjdevl/disable-pwhash_scryptsalsa
Browse files Browse the repository at this point in the history
Disable pwhash scryptsalsa
  • Loading branch information
joshjdevl authored Aug 21, 2017
2 parents 7ba83d7 + e3531a8 commit 7895b17
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 11 deletions.
1 change: 1 addition & 0 deletions build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

./submodule-update.sh

gradle generateSWIGsource --full-stacktrace
gradle build --full-stacktrace
./build-kaliumjni.sh
./build-libsodiumjni.sh
10 changes: 1 addition & 9 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,10 @@ set -ev

. ./setenv.sh

rm -rf libsodium

git submodule init
git submodule sync
#git submodule update --remote --merge
git submodule update
./submodule-update.sh

pushd libsodium

git fetch && git checkout stable
git reset --hard origin/stable
git pull
./autogen.sh
./configure --quiet
make --quiet && make --quiet check
Expand Down
2 changes: 2 additions & 0 deletions jni/sodium.i
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,7 @@ const char * crypto_pwhash_primitive(void);
/*
PW-Hash scryptsalsa208sha256
*/
/*
size_t crypto_pwhash_scryptsalsa208sha256_saltbytes(void);
size_t crypto_pwhash_scryptsalsa208sha256_strbytes(void);
Expand Down Expand Up @@ -1097,6 +1098,7 @@ int crypto_pwhash_scryptsalsa208sha256_ll(const uint8_t * passwd,
uint32_t p,
uint8_t * buf,
size_t buflen);
*/

/*
ScalarMult Curve25519
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/libsodium/jni/crypto/Hash.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public String sha512(String message, Encoder encoder) {

public String pwhash_scryptsalsa208sha256(String passwd, Encoder encoder, byte[] salt, int opslimit, int memlimit) {
buffer = new byte[KEY_LEN];
sodium().crypto_pwhash_scryptsalsa208sha256(buffer, buffer.length, passwd.getBytes(), passwd.length(), salt, opslimit, memlimit);
sodium().crypto_pwhash(buffer, buffer.length, passwd.getBytes(), passwd.length(), salt, opslimit, memlimit,sodium().crypto_pwhash_alg_default());
return encoder.encode(buffer);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/libsodium/jni/encoders/Encoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public interface Encoder {

public static final Charset CHARSET = Charset.forName("US-ASCII");
public static final Charset CHARSET = Charset.forName("UTF-8");

public static final Hex HEX = new Hex();
public static final Raw RAW = new Raw();
Expand Down

0 comments on commit 7895b17

Please sign in to comment.