Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

Commit

Permalink
fix 普通 KeyStore 导入 OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
QuincySx committed Jul 16, 2018
1 parent f047f8a commit c31e8d8
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ dependencies {
api "com.fasterxml.jackson.core:jackson-databind:2.8.5"
api 'com.madgag.spongycastle:core:1.58.0.0'
api 'com.madgag.spongycastle:prov:1.58.0.0'
api 'com.lambdaworks:scrypt:1.4.0'

}
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,9 @@ public static EthECKeyPair decrypt(String password, KeyStoreFile walletFile)
int p = scryptKdfParams.getP();
int r = scryptKdfParams.getR();
byte[] salt = HexUtils.fromHex(scryptKdfParams.getSalt());
derivedKey = generateDerivedScryptKey(password.getBytes(Charset.forName("UTF-8")),
salt, n, r, p, dklen);
// derivedKey = generateDerivedScryptKey(password.getBytes(Charset.forName("UTF-8")),
// salt, n, r, p, dklen);
derivedKey = com.lambdaworks.crypto.SCrypt.scryptN(password.getBytes(Charset.forName("UTF-8")), salt, n, r, p, dklen);
} else if (kdfParams instanceof KeyStoreFile.Aes128CtrKdfParams) {
KeyStoreFile.Aes128CtrKdfParams aes128CtrKdfParams =
(KeyStoreFile.Aes128CtrKdfParams) crypto.getKdfparams();
Expand Down
Binary file added library/src/main/jniLibs/armeabi-v7a/libscrypt.so
Binary file not shown.
Binary file added library/src/main/jniLibs/armeabi/libscrypt.so
Binary file not shown.
Binary file added library/src/main/jniLibs/mips/libscrypt.so
Binary file not shown.
Binary file added library/src/main/jniLibs/x86/libscrypt.so
Binary file not shown.
Binary file added library/src/main/jniLibs/x86_64/libscrypt.so
Binary file not shown.

0 comments on commit c31e8d8

Please sign in to comment.