mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2026-11-24 02:51:34 -08:00
Fix small crypto code
This commit is contained in:
1 parent
5a11e47653
commit
b899212d14
10 files changed
+135
-162
No files matched your search
@@ -68,7 +68,7 @@ public class AESTest extends TestCase {
|
||||
mRand.nextBytes(ivArray);
|
||||
IvParameterSpec iv = new IvParameterSpec(ivArray);
|
||||
|
||||
Cipher android = CipherFactory.getInstance("AES/CBC/PKCS5Padding", true);
|
||||
Cipher android = CipherFactory.INSTANCE.getInstance("AES/CBC/PKCS5Padding", true);
|
||||
android.init(Cipher.ENCRYPT_MODE, key, iv);
|
||||
byte[] outAndroid = android.doFinal(input, 0, dataSize);
|
||||
|
||||
|
||||
@@ -56,7 +56,7 @@ public class CipherTest extends TestCase {
|
||||
rand.nextBytes(iv);
|
||||
rand.nextBytes(plaintext);
|
||||
|
||||
CipherEngine aes = CipherFactory.getInstance(AesEngine.CIPHER_UUID);
|
||||
CipherEngine aes = CipherFactory.INSTANCE.getInstance(AesEngine.CIPHER_UUID);
|
||||
Cipher encrypt = aes.getCipher(Cipher.ENCRYPT_MODE, key, iv);
|
||||
Cipher decrypt = aes.getCipher(Cipher.DECRYPT_MODE, key, iv);
|
||||
|
||||
@@ -78,7 +78,7 @@ public class CipherTest extends TestCase {
|
||||
rand.nextBytes(iv);
|
||||
rand.nextBytes(plaintext);
|
||||
|
||||
CipherEngine aes = CipherFactory.getInstance(AesEngine.CIPHER_UUID);
|
||||
CipherEngine aes = CipherFactory.INSTANCE.getInstance(AesEngine.CIPHER_UUID);
|
||||
Cipher encrypt = aes.getCipher(Cipher.ENCRYPT_MODE, key, iv);
|
||||
Cipher decrypt = aes.getCipher(Cipher.DECRYPT_MODE, key, iv);
|
||||
|
||||
|
||||
Reference in new issue
Block a user