From 45563b75fea834895a7491c57f705b6481371962 Mon Sep 17 00:00:00 2001 From: vanitasvitae Date: Mon, 31 Jul 2017 14:57:43 +0200 Subject: [PATCH] Fix checkstyle --- .../jivesoftware/smackx/ciphers/AesGcmNoPadding.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/smack-experimental/src/main/java/org/jivesoftware/smackx/ciphers/AesGcmNoPadding.java b/smack-experimental/src/main/java/org/jivesoftware/smackx/ciphers/AesGcmNoPadding.java index 60c4f7eff..e89a64cc0 100644 --- a/smack-experimental/src/main/java/org/jivesoftware/smackx/ciphers/AesGcmNoPadding.java +++ b/smack-experimental/src/main/java/org/jivesoftware/smackx/ciphers/AesGcmNoPadding.java @@ -25,7 +25,7 @@ import javax.crypto.Cipher; 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; public abstract class AesGcmNoPadding { @@ -56,8 +56,8 @@ public abstract class AesGcmNoPadding { cipher = Cipher.getInstance(cipherMode, "BC"); SecretKey keySpec = new SecretKeySpec(key, keyType); - GCMParameterSpec gcmSpec = new GCMParameterSpec(128, iv); - cipher.init(Cipher.ENCRYPT_MODE, keySpec, gcmSpec); + IvParameterSpec ivSpec = new IvParameterSpec(iv); + cipher.init(Cipher.ENCRYPT_MODE, keySpec, ivSpec); } public AesGcmNoPadding(byte[] key, byte[] iv) throws NoSuchPaddingException, NoSuchAlgorithmException, @@ -72,8 +72,8 @@ public abstract class AesGcmNoPadding { cipher = Cipher.getInstance(cipherMode, "BC"); SecretKeySpec keySpec = new SecretKeySpec(key, keyType); - GCMParameterSpec gcmSpec = new GCMParameterSpec(128, iv); - cipher.init(Cipher.DECRYPT_MODE, keySpec, gcmSpec); + IvParameterSpec ivSpec = new IvParameterSpec(iv); + cipher.init(Cipher.DECRYPT_MODE, keySpec, ivSpec); } public byte[] getKeyAndIv() {