8 *
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 8048604
27 * @library ../ /test/lib
28 * @summary This test verifies the assertion "There should be no transformation
29 * on the plaintext/ciphertext in encryption/decryption mechanism" for
30 * feature "NullCipher".
31 */
32
33 import javax.crypto.BadPaddingException;
34 import javax.crypto.Cipher;
35 import javax.crypto.IllegalBlockSizeException;
36 import javax.crypto.NullCipher;
37 import javax.crypto.ShortBufferException;
38 import jdk.test.lib.RandomFactory;
39
40 public class CipherNCFuncTest {
41 public static void main(String[] args) throws ShortBufferException,
42 IllegalBlockSizeException, BadPaddingException {
43 byte[] plainText = new byte[801];
44 // Initialization
45 RandomFactory.getRandom().nextBytes(plainText);
46 Cipher ci = new NullCipher();
47 // Encryption
|
8 *
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 8048604
27 * @library ../ /test/lib
28 * @build jdk.test.lib.RandomFactory
29 * @run main CipherNCFuncTest
30 * @summary This test verifies the assertion "There should be no transformation
31 * on the plaintext/ciphertext in encryption/decryption mechanism" for
32 * feature "NullCipher".
33 */
34
35 import javax.crypto.BadPaddingException;
36 import javax.crypto.Cipher;
37 import javax.crypto.IllegalBlockSizeException;
38 import javax.crypto.NullCipher;
39 import javax.crypto.ShortBufferException;
40 import jdk.test.lib.RandomFactory;
41
42 public class CipherNCFuncTest {
43 public static void main(String[] args) throws ShortBufferException,
44 IllegalBlockSizeException, BadPaddingException {
45 byte[] plainText = new byte[801];
46 // Initialization
47 RandomFactory.getRandom().nextBytes(plainText);
48 Cipher ci = new NullCipher();
49 // Encryption
|