|
|
|
@ -1,10 +1,6 @@
|
|
|
|
|
package me.impy.aegis.ui.tasks;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.os.Process;
|
|
|
|
|
|
|
|
|
|
import java.security.NoSuchAlgorithmException;
|
|
|
|
|
import java.security.spec.InvalidKeySpecException;
|
|
|
|
|
|
|
|
|
|
import javax.crypto.SecretKey;
|
|
|
|
|
|
|
|
|
@ -22,9 +18,9 @@ public class DerivationTask extends ProgressDialogTask<DerivationTask.Params, Se
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected SecretKey doInBackground(DerivationTask.Params... args) {
|
|
|
|
|
Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND + Process.THREAD_PRIORITY_MORE_FAVORABLE);
|
|
|
|
|
setPriority();
|
|
|
|
|
|
|
|
|
|
DerivationTask.Params params = args[0];
|
|
|
|
|
Params params = args[0];
|
|
|
|
|
try {
|
|
|
|
|
byte[] salt = CryptoUtils.generateSalt();
|
|
|
|
|
return params.Slot.deriveKey(params.Password, salt, CryptoUtils.CRYPTO_SCRYPT_N, CryptoUtils.CRYPTO_SCRYPT_r, CryptoUtils.CRYPTO_SCRYPT_p);
|
|
|
|
|