< prev index next >

test/javax/crypto/CipherSpi/DirectBBRemaining.java

Print this page




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 7142509
  27  * @summary Cipher.doFinal(ByteBuffer,ByteBuffer) fails to
  28  *     process when in.remaining() == 0

  29  */
  30 
  31 import java.nio.ByteBuffer;
  32 import java.security.SecureRandom;
  33 import java.util.Arrays;
  34 import java.util.Random;
  35 
  36 import javax.crypto.Cipher;
  37 import javax.crypto.SecretKey;
  38 import javax.crypto.spec.SecretKeySpec;
  39 
  40 /*
  41  * Simple test case to show that Cipher.doFinal(ByteBuffer, ByteBuffer) fails to
  42  * process the data internally buffered inBB the cipher when input.remaining()
  43  * == 0 and at least one buffer is a direct buffer.
  44  */
  45 public class DirectBBRemaining {
  46 
  47     private static Random random = new SecureRandom();
  48     private static int testSizes = 40;




   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  */
  23 
  24 /**
  25  * @test
  26  * @bug 7142509
  27  * @summary Cipher.doFinal(ByteBuffer,ByteBuffer) fails to
  28  *     process when in.remaining() == 0
  29  * @key randomness
  30  */
  31 
  32 import java.nio.ByteBuffer;
  33 import java.security.SecureRandom;
  34 import java.util.Arrays;
  35 import java.util.Random;
  36 
  37 import javax.crypto.Cipher;
  38 import javax.crypto.SecretKey;
  39 import javax.crypto.spec.SecretKeySpec;
  40 
  41 /*
  42  * Simple test case to show that Cipher.doFinal(ByteBuffer, ByteBuffer) fails to
  43  * process the data internally buffered inBB the cipher when input.remaining()
  44  * == 0 and at least one buffer is a direct buffer.
  45  */
  46 public class DirectBBRemaining {
  47 
  48     private static Random random = new SecureRandom();
  49     private static int testSizes = 40;


< prev index next >