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 4513830
27 * @summary Verify the output size returned by AES cipher.getOutputSize
28 * method in DECRYPT mode does not add extra bytes for padding
29 * @author Valerie Peng
30 */
31 import java.io.PrintStream;
32 import java.security.*;
33 import java.security.spec.*;
34 import java.util.Random;
35
36 import javax.crypto.*;
37 import javax.crypto.spec.*;
38 import java.security.Provider;
39 import com.sun.crypto.provider.*;
40
41 public class Test4513830 {
42
43 private static final String ALGO = "AES";
44 private static final String MODE = "ECB";
45 private static final String PADDING = "PKCS5Padding";
46 private static final int KEYSIZE = 16; // in bytes
47 private static final int TEXTLENGTHS[] = {
48 16, 17, 18, 19, 20, 21, 22, 23 };
49
|
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 4513830
27 * @summary Verify the output size returned by AES cipher.getOutputSize
28 * method in DECRYPT mode does not add extra bytes for padding
29 * @author Valerie Peng
30 * @key randomness
31 */
32 import java.io.PrintStream;
33 import java.security.*;
34 import java.security.spec.*;
35 import java.util.Random;
36
37 import javax.crypto.*;
38 import javax.crypto.spec.*;
39 import java.security.Provider;
40 import com.sun.crypto.provider.*;
41
42 public class Test4513830 {
43
44 private static final String ALGO = "AES";
45 private static final String MODE = "ECB";
46 private static final String PADDING = "PKCS5Padding";
47 private static final int KEYSIZE = 16; // in bytes
48 private static final int TEXTLENGTHS[] = {
49 16, 17, 18, 19, 20, 21, 22, 23 };
50
|