From c6a7fb5cb0459d9cfdb13834868c4b3c87fa7b7e Mon Sep 17 00:00:00 2001 From: "Raif S. Naffah" Date: Sat, 24 Jun 2006 00:09:26 +0000 Subject: 2006-06-24 Raif S. Naffah * gnu/java/security/util/Util.java: Source formatting. * gnu/java/security/util/SimpleList.java: Likewise. * gnu/java/security/util/Sequence.java: Likewise. * gnu/java/security/util/PRNG.java: Likewise. * gnu/java/security/util/ExpirableObject.java: Likewise. * gnu/java/security/util/Base64.java: Likewise. * gnu/java/security/sig/SignatureFactory.java: Likewise. * gnu/java/security/sig/ISignatureCodec.java: Likewise. * gnu/java/security/sig/ISignature.java: Likewise. * gnu/java/security/sig/BaseSignature.java: Likewise. * gnu/java/security/sig/rsa/RSAPSSSignatureRawCodec.java: Likewise. * gnu/java/security/sig/rsa/RSAPSSSignature.java: Likewise. * gnu/java/security/sig/rsa/RSAPKCS1V1_5Signature.java: Likewise. * gnu/java/security/sig/rsa/RSA.java: Likewise. * gnu/java/security/sig/rsa/EMSA_PSS.java: Likewise. * gnu/java/security/sig/rsa/EMSA_PKCS1_V1_5.java: Likewise. * gnu/java/security/sig/rsa/EME_PKCS1_V1_5.java: Likewise. * gnu/java/security/sig/dss/DSSSignatureRawCodec.java: Likewise. * gnu/java/security/sig/dss/DSSSignature.java: Likewise. * gnu/java/security/provider/X509CertificateFactory.java: Likewise. * gnu/java/security/provider/PKIXCertPathValidatorImpl.java: Likewise. * gnu/java/security/provider/Gnu.java: Likewise. * gnu/java/security/prng/RandomEventListener.java: Likewise. * gnu/java/security/prng/RandomEvent.java: Likewise. * gnu/java/security/prng/PRNGFactory.java: Likewise. * gnu/java/security/prng/MDGenerator.java: Likewise. * gnu/java/security/prng/LimitReachedException.java: Likewise. * gnu/java/security/prng/IRandom.java: Likewise. * gnu/java/security/prng/EntropySource.java: Likewise. * gnu/java/security/prng/BasePRNG.java: Likewise. --- gnu/java/security/prng/IRandom.java | 156 +++++++++++++++++------------------- 1 file changed, 75 insertions(+), 81 deletions(-) (limited to 'gnu/java/security/prng/IRandom.java') diff --git a/gnu/java/security/prng/IRandom.java b/gnu/java/security/prng/IRandom.java index 2c89e7ad5..66ad6d224 100644 --- a/gnu/java/security/prng/IRandom.java +++ b/gnu/java/security/prng/IRandom.java @@ -41,140 +41,134 @@ package gnu.java.security.prng; import java.util.Map; /** - *

The basic visible methods of any pseudo-random number generator.

- * - *

The [HAC] defines a PRNG (as implemented in this library) as follows:

- * + * The basic visible methods of any pseudo-random number generator. + *

+ * The [HAC] defines a PRNG (as implemented in this library) as follows: *

- * - *

IMPLEMENTATION NOTE: Although all the concrete classes in this + *

+ * IMPLEMENTATION NOTE: Although all the concrete classes in this * package implement the {@link Cloneable} interface, it is important to note - * here that such an operation, for those algorithms that use an underlting + * here that such an operation, for those algorithms that use an underlying * symmetric key block cipher, DOES NOT clone any session key material * that may have been used in initialising the source PRNG (the instance to be - * cloned). Instead a clone of an already initialised PRNG, that uses and + * cloned). Instead a clone of an already initialised PRNG, that uses an * underlying symmetric key block cipher, is another instance with a clone of - * the same cipher that operates with the same block size but without any - * knowledge of neither key material nor key size.

- * - *

References:

- * + * the same cipher that operates with the same block size but without + * any knowledge of neither key material nor key size. + *

+ * References: *

    - *
  1. [HAC]: Handbook of - * Applied Cryptography.
    - * CRC Press, Inc. ISBN 0-8493-8523-7, 1997
    - * Menezes, A., van Oorschot, P. and S. Vanstone.
  2. + *
  3. [HAC]: Handbook of + * Applied Cryptography.
    + * CRC Press, Inc. ISBN 0-8493-8523-7, 1997
    + * Menezes, A., van Oorschot, P. and S. Vanstone.
  4. *
*/ -public interface IRandom extends Cloneable +public interface IRandom + extends Cloneable { - - // Constants - // ------------------------------------------------------------------------- - - // Methods - // ------------------------------------------------------------------------- - /** - *

Returns the canonical name of this instance.

- * - * @return the canonical name of this instance. */ + * Returns the canonical name of this instance. + * + * @return the canonical name of this instance. + */ String name(); /** - *

Initialises the pseudo-random number generator scheme with the - * appropriate attributes.

- * + * Initialises the pseudo-random number generator scheme with the appropriate + * attributes. + * * @param attributes a set of name-value pairs that describe the desired - * future instance behaviour. + * future instance behaviour. * @exception IllegalArgumentException if at least one of the defined name/ - * value pairs contains invalid data. + * value pairs contains invalid data. */ void init(Map attributes); /** - *

Returns the next 8 bits of random data generated from this instance.

- * + * Returns the next 8 bits of random data generated from this instance. + * * @return the next 8 bits of random data generated from this instance. * @exception IllegalStateException if the instance is not yet initialised. * @exception LimitReachedException if this instance has reached its - * theoretical limit for generating non-repetitive pseudo-random data. + * theoretical limit for generating non-repetitive pseudo-random + * data. */ byte nextByte() throws IllegalStateException, LimitReachedException; /** - *

Fills the designated byte array, starting from byte at index - * offset, for a maximum of length bytes with the - * output of this generator instance. - * + * Fills the designated byte array, starting from byte at index + * offset, for a maximum of length bytes with + * the output of this generator instance. + * * @param out the placeholder to contain the generated random bytes. * @param offset the starting index in out to consider. This method - * does nothing if this parameter is not within 0 and - * out.length. - * @param length the maximum number of required random bytes. This method - * does nothing if this parameter is less than 1. + * does nothing if this parameter is not within 0 and + * out.length. + * @param length the maximum number of required random bytes. This method does + * nothing if this parameter is less than 1. * @exception IllegalStateException if the instance is not yet initialised. * @exception LimitReachedException if this instance has reached its - * theoretical limit for generating non-repetitive pseudo-random data. + * theoretical limit for generating non-repetitive pseudo-random + * data. */ void nextBytes(byte[] out, int offset, int length) throws IllegalStateException, LimitReachedException; /** - *

Supplement, or possibly replace, the random state of this PRNG with - * a random byte.

- * - *

Implementations are not required to implement this method in any - * meaningful way; this may be a no-operation, and implementations may - * throw an {@link UnsupportedOperationException}.

- * + * Supplement, or possibly replace, the random state of this PRNG with a + * random byte. + *

+ * Implementations are not required to implement this method in any meaningful + * way; this may be a no-operation, and implementations may throw an + * {@link UnsupportedOperationException}. + * * @param b The byte to add. */ void addRandomByte(byte b); /** - *

Supplement, or possibly replace, the random state of this PRNG with - * a sequence of new random bytes.

- * - *

Implementations are not required to implement this method in any - * meaningful way; this may be a no-operation, and implementations may - * throw an {@link UnsupportedOperationException}.

- * + * Supplement, or possibly replace, the random state of this PRNG with a + * sequence of new random bytes. + *

+ * Implementations are not required to implement this method in any meaningful + * way; this may be a no-operation, and implementations may throw an + * {@link UnsupportedOperationException}. + * * @param in The buffer of new random bytes to add. */ void addRandomBytes(byte[] in); /** - *

Supplement, or possibly replace, the random state of this PRNG with - * a sequence of new random bytes.

- * - *

Implementations are not required to implement this method in any - * meaningful way; this may be a no-operation, and implementations may - * throw an {@link UnsupportedOperationException}.

- * + * Supplement, or possibly replace, the random state of this PRNG with a + * sequence of new random bytes. + *

+ * Implementations are not required to implement this method in any meaningful + * way; this may be a no-operation, and implementations may throw an + * {@link UnsupportedOperationException}. + * * @param in The buffer of new random bytes to add. * @param offset The offset from whence to begin reading random bytes. * @param length The number of random bytes to add. - * @exception IndexOutOfBoundsException If offset, length, - * or offset+length is out of bounds. + * @exception IndexOutOfBoundsException If offset, length, or + * offset+length is out of bounds. */ void addRandomBytes(byte[] in, int offset, int length); /** - *

Returns a clone copy of this instance.

- * + * Returns a clone copy of this instance. + * * @return a clone copy of this instance. */ Object clone() throws CloneNotSupportedException; -} \ No newline at end of file +} -- cgit v1.2.1