Move salt outside the loop
This commit is contained in:
parent
73233c01ba
commit
b168e14985
1 changed files with 2 additions and 1 deletions
|
@ -24,10 +24,11 @@ public abstract class FullBackupBase {
|
|||
byte[] input = passphrase.replace(" ", "").getBytes();
|
||||
byte[] hash = input;
|
||||
|
||||
if (salt != null) digest.update(salt);
|
||||
|
||||
for (int i=0;i<250000;i++) {
|
||||
if (i % 1000 == 0) EventBus.getDefault().post(new BackupEvent(BackupEvent.Type.PROGRESS, 0));
|
||||
digest.update(hash);
|
||||
if (salt != null) digest.update(salt);
|
||||
hash = digest.digest(input);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue