mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-26 07:39:17 +00:00
Move salt outside the loop
This commit is contained in:
@@ -24,10 +24,11 @@ public abstract class FullBackupBase {
|
|||||||
byte[] input = passphrase.replace(" ", "").getBytes();
|
byte[] input = passphrase.replace(" ", "").getBytes();
|
||||||
byte[] hash = input;
|
byte[] hash = input;
|
||||||
|
|
||||||
|
if (salt != null) digest.update(salt);
|
||||||
|
|
||||||
for (int i=0;i<250000;i++) {
|
for (int i=0;i<250000;i++) {
|
||||||
if (i % 1000 == 0) EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, 0));
|
if (i % 1000 == 0) EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, 0));
|
||||||
digest.update(hash);
|
digest.update(hash);
|
||||||
if (salt != null) digest.update(salt);
|
|
||||||
hash = digest.digest(input);
|
hash = digest.digest(input);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user