< prev index next >

src/java.base/share/classes/javax/crypto/spec/RC5ParameterSpec.java

Print this page

        

*** 33,43 **** * algorithm. * * <p> The parameters consist of a version number, a rounds count, a word * size, and optionally an initialization vector (IV) (only in feedback mode). * ! * <p> This class can be used to initialize a <code>Cipher</code> object that * implements the <i>RC5</i> algorithm as supplied by * <a href="http://www.rsa.com">RSA Security LLC</a>, * or any parties authorized by RSA Security. * * @author Jan Luehe --- 33,43 ---- * algorithm. * * <p> The parameters consist of a version number, a rounds count, a word * size, and optionally an initialization vector (IV) (only in feedback mode). * ! * <p> This class can be used to initialize a {@code Cipher} object that * implements the <i>RC5</i> algorithm as supplied by * <a href="http://www.rsa.com">RSA Security LLC</a>, * or any parties authorized by RSA Security. * * @author Jan Luehe
*** 69,114 **** * Constructs a parameter set for RC5 from the given version, number of * rounds, word size (in bits), and IV. * * <p> Note that the size of the IV (block size) must be twice the word * size. The bytes that constitute the IV are those between ! * <code>iv[0]</code> and <code>iv[2*(wordSize/8)-1]</code> inclusive. * * @param version the version. * @param rounds the number of rounds. * @param wordSize the word size in bits. ! * @param iv the buffer with the IV. The first <code>2*(wordSize/8) ! * </code> bytes of the buffer are copied to protect against subsequent * modification. ! * @exception IllegalArgumentException if <code>iv</code> is ! * <code>null</code> or {@code (iv.length < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) { this(version, rounds, wordSize, iv, 0); } /** * Constructs a parameter set for RC5 from the given version, number of * rounds, word size (in bits), and IV. * ! * <p> The IV is taken from <code>iv</code>, starting at ! * <code>offset</code> inclusive. * Note that the size of the IV (block size), starting at ! * <code>offset</code> inclusive, must be twice the word size. * The bytes that constitute the IV are those between ! * <code>iv[offset]</code> and <code>iv[offset+2*(wordSize/8)-1]</code> * inclusive. * * @param version the version. * @param rounds the number of rounds. * @param wordSize the word size in bits. ! * @param iv the buffer with the IV. The first <code>2*(wordSize/8) ! * </code> bytes of the buffer beginning at <code>offset</code> * inclusive are copied to protect against subsequent modification. ! * @param offset the offset in <code>iv</code> where the IV starts. ! * @exception IllegalArgumentException if <code>iv</code> is ! * <code>null</code> or * {@code (iv.length - offset < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int offset) { this.version = version; --- 69,114 ---- * Constructs a parameter set for RC5 from the given version, number of * rounds, word size (in bits), and IV. * * <p> Note that the size of the IV (block size) must be twice the word * size. The bytes that constitute the IV are those between ! * {@code iv[0]} and {@code iv[2*(wordSize/8)-1]} inclusive. * * @param version the version. * @param rounds the number of rounds. * @param wordSize the word size in bits. ! * @param iv the buffer with the IV. The first {@code 2*(wordSize/8) ! * } bytes of the buffer are copied to protect against subsequent * modification. ! * @exception IllegalArgumentException if {@code iv} is ! * {@code null} or {@code (iv.length < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv) { this(version, rounds, wordSize, iv, 0); } /** * Constructs a parameter set for RC5 from the given version, number of * rounds, word size (in bits), and IV. * ! * <p> The IV is taken from {@code iv}, starting at ! * {@code offset} inclusive. * Note that the size of the IV (block size), starting at ! * {@code offset} inclusive, must be twice the word size. * The bytes that constitute the IV are those between ! * {@code iv[offset]} and {@code iv[offset+2*(wordSize/8)-1]} * inclusive. * * @param version the version. * @param rounds the number of rounds. * @param wordSize the word size in bits. ! * @param iv the buffer with the IV. The first {@code 2*(wordSize/8) ! * } bytes of the buffer beginning at {@code offset} * inclusive are copied to protect against subsequent modification. ! * @param offset the offset in {@code iv} where the IV starts. ! * @exception IllegalArgumentException if {@code iv} is ! * {@code null} or * {@code (iv.length - offset < 2 * (wordSize / 8))} */ public RC5ParameterSpec(int version, int rounds, int wordSize, byte[] iv, int offset) { this.version = version;
*** 162,177 **** /** * Tests for equality between the specified object and this * object. Two RC5ParameterSpec objects are considered equal if their * version numbers, number of rounds, word sizes, and IVs are equal. ! * (Two IV references are considered equal if both are <tt>null</tt>.) * * @param obj the object to test for equality with this object. * * @return true if the objects are considered equal, false if ! * <code>obj</code> is null or otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; } --- 162,177 ---- /** * Tests for equality between the specified object and this * object. Two RC5ParameterSpec objects are considered equal if their * version numbers, number of rounds, word sizes, and IVs are equal. ! * (Two IV references are considered equal if both are {@code null}.) * * @param obj the object to test for equality with this object. * * @return true if the objects are considered equal, false if ! * {@code obj} is null or otherwise. */ public boolean equals(Object obj) { if (obj == this) { return true; }
< prev index next >