Skip to content

Commit

Permalink
Updated pwhash longs to NativeLongs
Browse files Browse the repository at this point in the history
Caused by platforms parsing the memLimit param different. That is, Ubuntu vs Android crashed alternately when changing the memLimit param to an int or a long
  • Loading branch information
gurpreet- committed Nov 27, 2018
1 parent 8e405d5 commit c19a630
Show file tree
Hide file tree
Showing 18 changed files with 5 additions and 20 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ plugins {
ext {
artifactId = "lazysodium-android"
groupId = "com.goterl.lazycode"
version = '3.4.2'
version = '3.5.0'
description = "Lazysodium (Android) makes it effortless for Android " +
"developers to get started with Libsodium's cryptography."
androidTestDir = "src/androidTest/java/com/goterl/lazycode/lazysodium"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 22/05/18 11:04 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 14/05/18 00:54 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 12/05/18 15:09 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 31/07/18 18:54 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 11/05/18 23:19 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 18/05/18 21:45 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 18/05/18 18:35 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 04/05/18 22:58 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 10/05/18 23:39 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 03/05/18 11:37 • goterl.com
*
Expand All @@ -14,6 +13,7 @@
import com.goterl.lazycode.lazysodium.exceptions.SodiumException;
import com.goterl.lazycode.lazysodium.interfaces.PwHash;
import com.goterl.lazycode.lazysodium.interfaces.Scrypt;
import com.sun.jna.NativeLong;
import org.junit.Before;
import org.junit.Test;

Expand Down Expand Up @@ -43,7 +43,7 @@ public void nativeHash() throws SodiumException {
PwHash.BYTES_MIN,
lazySodium.randomBytesBuf(PwHash.SALTBYTES),
5L,
8192 * 2,
new NativeLong(8192 * 2),
PwHash.Alg.PWHASH_ALG_ARGON2ID13
);

Expand All @@ -57,7 +57,7 @@ public void strMin() throws SodiumException {
String hash = pwHashLazy.cryptoPwHashStr(
PASSWORD,
3,
PwHash.ARGON2ID_MEMLIMIT_MIN
PwHash.MEMLIMIT_MIN
);

boolean isCorrect = pwHashLazy.cryptoPwHashStrVerify(hash, PASSWORD);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 11/05/18 12:18 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 07/05/18 12:05 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 05/06/18 00:15 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 10/05/18 22:20 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 12/05/18 18:55 • goterl.com
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
package com.goterl.lazycode.lazysodium;
/*
* Copyright (c) Terl Tech Ltd • 17/07/18 23:21 • goterl.com
*
Expand Down

0 comments on commit c19a630

Please sign in to comment.