mirror of
https://github.com/beemdevelopment/Aegis.git
synced 2025-04-26 00:36:11 +00:00
Use IvParameterSpec instead of GCMParameterSpec
Partially fixes API level 19 compatibility
This commit is contained in:
parent
0a3e6e4d90
commit
da2f69f860
1 changed files with 2 additions and 2 deletions
|
@ -20,7 +20,7 @@ import javax.crypto.IllegalBlockSizeException;
|
|||
import javax.crypto.KeyGenerator;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.SecretKey;
|
||||
import javax.crypto.spec.GCMParameterSpec;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import org.spongycastle.crypto.generators.SCrypt;
|
||||
|
@ -56,7 +56,7 @@ public class CryptoUtils {
|
|||
}
|
||||
|
||||
public static Cipher createCipher(SecretKey key, int opmode, byte[] nonce) throws NoSuchPaddingException, NoSuchAlgorithmException, InvalidAlgorithmParameterException, InvalidKeyException {
|
||||
GCMParameterSpec spec = new GCMParameterSpec(CRYPTO_TAG_SIZE * 8, nonce);
|
||||
IvParameterSpec spec = new IvParameterSpec(nonce);
|
||||
Cipher cipher = Cipher.getInstance(CRYPTO_CIPHER_AEAD);
|
||||
cipher.init(opmode, key, spec);
|
||||
return cipher;
|
||||
|
|
Loading…
Add table
Reference in a new issue