summaryrefslogtreecommitdiff
path: root/gnu/javax/crypto/jce/spec
diff options
context:
space:
mode:
authorGuilhem Lavaux <guilhem@kaffe.org>2006-07-09 16:59:05 +0000
committerGuilhem Lavaux <guilhem@kaffe.org>2006-07-09 16:59:05 +0000
commit8f2887fc8c74aae0d541cbd59ea36c37d420267d (patch)
treeadfecf70948384fcc6aa9cae41103dc4551d1b53 /gnu/javax/crypto/jce/spec
parent4714fb23de2d811f49438611ac0d13ccd302e1ea (diff)
downloadclasspath-8f2887fc8c74aae0d541cbd59ea36c37d420267d.tar.gz
2006-07-09 Guilhem Lavaux <guilhem@kaffe.org>
* Merged HEAD as of 2006-06-09 0:00.
Diffstat (limited to 'gnu/javax/crypto/jce/spec')
-rw-r--r--gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.java57
-rw-r--r--gnu/javax/crypto/jce/spec/TMMHParameterSpec.java38
-rw-r--r--gnu/javax/crypto/jce/spec/UMac32ParameterSpec.java25
3 files changed, 41 insertions, 79 deletions
diff --git a/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.java b/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.java
index 63e7740ec..321b47795 100644
--- a/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.java
+++ b/gnu/javax/crypto/jce/spec/BlockCipherParameterSpec.java
@@ -43,40 +43,26 @@ import gnu.java.security.util.Util;
import java.security.spec.AlgorithmParameterSpec;
/**
- * Block cipher parameters in GNU Crypto are the cipher's name, its block
- * and key sizes, and an optional initialization vector.
+ * Block cipher parameters in GNU are the cipher's name, its block and key
+ * sizes, and an optional initialization vector.
*/
-public class BlockCipherParameterSpec implements AlgorithmParameterSpec
+public class BlockCipherParameterSpec
+ implements AlgorithmParameterSpec
{
-
- // Constants and variables.
- // -----------------------------------------------------------------------
-
- /**
- * The initialization vector.
- */
+ /** The initialization vector. */
protected byte[] iv;
-
- /**
- * The cipher's block size, in bytes.
- */
+ /** The cipher's block size, in bytes. */
protected int blockSize;
-
- /**
- * The cipher's key size, in bytes.
- */
+ /** The cipher's key size, in bytes. */
protected int keySize;
- // Constructors.
- // -----------------------------------------------------------------------
-
/**
* Create a new parameter specification.
- *
- * @param iv The initialization vector, or <code>null</code> if
- * there is no IV.
+ *
+ * @param iv The initialization vector, or <code>null</code> if there is no
+ * IV.
* @param blockSize The cipher's block size, in bytes.
- * @param keySize The cipher's key size, in bytes.
+ * @param keySize The cipher's key size, in bytes.
*/
public BlockCipherParameterSpec(byte[] iv, int blockSize, int keySize)
{
@@ -87,22 +73,19 @@ public class BlockCipherParameterSpec implements AlgorithmParameterSpec
/**
* Create a new parameter specification with no IV.
- *
+ *
* @param blockSize The cipher's block size, in bytes.
- * @param keySize The cipher's key size, in bytes.
+ * @param keySize The cipher's key size, in bytes.
*/
public BlockCipherParameterSpec(int blockSize, int keySize)
{
this(null, blockSize, keySize);
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
/**
- * Get the initialization vector for the cipher, or <code>null</code>
- * if there is no IV.
- *
+ * Get the initialization vector for the cipher, or <code>null</code> if
+ * there is no IV.
+ *
* @return The IV.
*/
public byte[] getIV()
@@ -112,7 +95,7 @@ public class BlockCipherParameterSpec implements AlgorithmParameterSpec
/**
* Get the block size of the cipher these parameters are for.
- *
+ *
* @return The block size.
*/
public int getBlockSize()
@@ -122,7 +105,7 @@ public class BlockCipherParameterSpec implements AlgorithmParameterSpec
/**
* Get the key size of the cipher these parameters are for.
- *
+ *
* @return The block size.
*/
public int getKeySize()
@@ -133,7 +116,7 @@ public class BlockCipherParameterSpec implements AlgorithmParameterSpec
public String toString()
{
return getClass().getName() + " { "
- + ((iv != null) ? ("IV=" + Util.toString(iv)) + ", " : "") + "BS="
- + blockSize + ", KS=" + keySize + " }";
+ + ((iv != null) ? ("IV=" + Util.toString(iv)) + ", " : "")
+ + "BS=" + blockSize + ", KS=" + keySize + " }";
}
}
diff --git a/gnu/javax/crypto/jce/spec/TMMHParameterSpec.java b/gnu/javax/crypto/jce/spec/TMMHParameterSpec.java
index a3b5f26e8..356437288 100644
--- a/gnu/javax/crypto/jce/spec/TMMHParameterSpec.java
+++ b/gnu/javax/crypto/jce/spec/TMMHParameterSpec.java
@@ -46,34 +46,26 @@ import java.security.spec.AlgorithmParameterSpec;
* This class represents the algorithm parameters for the Truncated
* Multi-Modular Hash function for use with JCE-derived instances of
* {@link gnu.javax.crypto.mac.TMMH16}.
- *
- * <p>This class is little more than a container for the key stream, tag
- * length, and prefix parameters for the TMMH algorithm.
+ * <p>
+ * This class is little more than a container for the key stream, tag length,
+ * and prefix parameters for the TMMH algorithm.
*/
-public class TMMHParameterSpec implements AlgorithmParameterSpec
+public class TMMHParameterSpec
+ implements AlgorithmParameterSpec
{
-
- // Constants and variables.
- // -----------------------------------------------------------------------
-
/** The keystream. */
protected IRandom keystream;
-
/** The tag length. */
protected Integer tagLength;
-
/** The prefix. */
protected byte[] prefix;
- // Constructors.
- // -----------------------------------------------------------------------
-
/**
* Create a new parameter specification.
- *
+ *
* @param keystream The (PRNG) key stream.
* @param tagLength The tag length.
- * @param prefix The prefix.
+ * @param prefix The prefix.
*/
public TMMHParameterSpec(IRandom keystream, Integer tagLength, byte[] prefix)
{
@@ -84,7 +76,7 @@ public class TMMHParameterSpec implements AlgorithmParameterSpec
/**
* Create a new parameter specification with no prefix.
- *
+ *
* @param keystream The (PRNG) key stream.
* @param tagLength The tag length.
*/
@@ -93,12 +85,9 @@ public class TMMHParameterSpec implements AlgorithmParameterSpec
this(keystream, tagLength, null);
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
/**
* Return the key stream this specification was initialized with.
- *
+ *
* @return The key stream.
*/
public IRandom getKeystream()
@@ -108,7 +97,7 @@ public class TMMHParameterSpec implements AlgorithmParameterSpec
/**
* Return the tag length this specification was initialized with.
- *
+ *
* @return The tag length.
*/
public Integer getTagLength()
@@ -117,13 +106,12 @@ public class TMMHParameterSpec implements AlgorithmParameterSpec
}
/**
- * Return the prefix, or <code>null</code> if no prefix was
- * specified.
- *
+ * Return the prefix, or <code>null</code> if no prefix was specified.
+ *
* @return The prefix.
*/
public byte[] getPrefix()
{
return prefix;
}
-} \ No newline at end of file
+}
diff --git a/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.java b/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.java
index 47d807d49..0990cc6d4 100644
--- a/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.java
+++ b/gnu/javax/crypto/jce/spec/UMac32ParameterSpec.java
@@ -41,25 +41,19 @@ package gnu.javax.crypto.jce.spec;
import java.security.spec.AlgorithmParameterSpec;
/**
- * This class represents the parameters for the UMAC-32 message
- * authentication code algorithm. In practice this means the
- * <i>Nonce</i> material used to initialize the algorithm.
+ * This class represents the parameters for the UMAC-32 message authentication
+ * code algorithm. In practice this means the <i>Nonce</i> material used to
+ * initialize the algorithm.
*/
-public class UMac32ParameterSpec implements AlgorithmParameterSpec
+public class UMac32ParameterSpec
+ implements AlgorithmParameterSpec
{
-
- // Constants and variables.
- // -----------------------------------------------------------------------
-
/** The <i>Nonce</i> material. */
protected byte[] nonce;
- // Constructors.
- // -----------------------------------------------------------------------
-
/**
* Create a new parameter instance.
- *
+ *
* @param nonce The nonce material.
*/
public UMac32ParameterSpec(byte[] nonce)
@@ -67,16 +61,13 @@ public class UMac32ParameterSpec implements AlgorithmParameterSpec
this.nonce = nonce;
}
- // Instance methods.
- // -----------------------------------------------------------------------
-
/**
* Return the nonce material.
- *
+ *
* @return The nonce material.
*/
public byte[] getNonce()
{
return nonce;
}
-} \ No newline at end of file
+}