TestSymmCiphers.java revision 149
149N/A * Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. 149N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 149N/A * This code is free software; you can redistribute it and/or modi 149N/A * under the terms of the GNU General Public License version 2 onl 149N/A * published by the Free Software Foundation. 149N/A * This code is distributed in the hope that it will be useful, bu 149N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABIL 149N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public L 149N/A * version 2 for more details (a copy is included in the LICENSE f 149N/A * accompanied this code). 149N/A * You should have received a copy of the GNU General Public Licen 149N/A * 2 along with this work; if not, write to the Free Software Foun 149N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 149N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, San 149N/A * CA 95054 USA or visit www.sun.com if you need additional inform 149N/A * @summary basic test for symmetric ciphers with padding 149N/A private static class CI {
// class for holding Cipher Information 149N/A new CI(
"ARCFOUR",
"ARCFOUR",
400),
149N/A // NSS reports CKR_DEVICE_ERROR when the data passed to 149N/A // print out debug info when exception is encountered 149N/A //debugOut("Estimated output size = " + outLen + "\n"); 149N/A // test data preparation 149N/A // test#1: byte[] in + byte[] out 149N/A //debugOut("Test#1:\n"); 149N/A // test#2: Non-direct Buffer in + non-direct Buffer out 149N/A //debugOut("Test#2:\n"); 149N/A //debugOut("inputBuf: " + inBuf + "\n"); 149N/A //debugOut("outputBuf: " + outBuf + "\n"); 149N/A // test#3: Direct Buffer in + direc Buffer out 149N/A //debugOut("Test#3:\n"); 149N/A //debugOut("(pre) inputBuf: " + inDirectBuf + "\n"); 149N/A //debugOut("(pre) outputBuf: " + outDirectBuf + "\n"); 149N/A //debugOut("(post) inputBuf: " + inDirectBuf + "\n"); 149N/A //debugOut("(post) outputBuf: " + outDirectBuf + "\n"); 149N/A // test#4: Direct Buffer in + non-direct Buffer out 149N/A //debugOut("Test#4:\n"); 149N/A //debugOut("inputBuf: " + inDirectBuf + "\n"); 149N/A //debugOut("outputBuf: " + outBuf + "\n"); 149N/A // test#5: Non-direct Buffer in + direct Buffer out 149N/A //debugOut("Test#5:\n"); 149N/A //debugOut("(pre) inputBuf: " + inBuf + "\n"); 149N/A //debugOut("(pre) outputBuf: " + outDirectBuf + "\n"); 149N/A //debugOut("(post) inputBuf: " + inBuf + "\n"); 149N/A //debugOut("(post) outputBuf: " + outDirectBuf + "\n");