From dc55897c48d4bd4c001b29f34e698c0628d8a8bc Mon Sep 17 00:00:00 2001 From: "Raif S. Naffah" Date: Sun, 16 Jul 2006 02:59:31 +0000 Subject: 2006-07-16 Raif S. Naffah * gnu/javax/crypto/jce/params/BlockCipherParameters.java (engineGetParameterSpec): Should be able to return an IvParameterSpec. --- ChangeLog | 5 +++++ gnu/javax/crypto/jce/params/BlockCipherParameters.java | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0bca6da5b..4d6752b8c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2006-07-16 Raif S. Naffah + + * gnu/javax/crypto/jce/params/BlockCipherParameters.java + (engineGetParameterSpec): Should be able to return an IvParameterSpec. + 2006-07-16 Raif S. Naffah * gnu/javax/crypto/cipher/DES.java (adjustParity): Index limit now takes diff --git a/gnu/javax/crypto/jce/params/BlockCipherParameters.java b/gnu/javax/crypto/jce/params/BlockCipherParameters.java index 4ed3015fd..a85c96223 100644 --- a/gnu/javax/crypto/jce/params/BlockCipherParameters.java +++ b/gnu/javax/crypto/jce/params/BlockCipherParameters.java @@ -49,6 +49,8 @@ import java.security.spec.AlgorithmParameterSpec; import java.security.spec.InvalidParameterSpecException; import java.util.logging.Logger; +import javax.crypto.spec.IvParameterSpec; + /** * An implementation of algorithm parameters for the GNU block ciphers. This * encompasses the cipher's block size, its key size, and an optional @@ -132,6 +134,11 @@ public class BlockCipherParameters { if (c.isInstance(cipherSpec)) return cipherSpec; + if (IvParameterSpec.class.isAssignableFrom(c)) + { + IvParameterSpec result = new IvParameterSpec(cipherSpec.getIV()); + return result; + } throw new InvalidParameterSpecException(); } -- cgit v1.2.1