/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* @test
* @bug 7031343
* @summary Provide API changes to support GCM AEAD ciphers
* @author Brad Wetmore
*/
public class GCMParameterSpecTest {
// 16 elements
private static byte[] bytes = new byte[] {
0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f };
// Might as well check the Exception constructors.
try {
new AEADBadTagException();
new AEADBadTagException("Bad Tag Seen");
} catch (Exception e) {
e.printStackTrace();
failed++;
}
if (failed != 0) {
throw new Exception("Test(s) failed");
}
}
private static void newGCMParameterSpecPass(
try {
throw new Exception("tLen's not equal");
}
throw new Exception("IV's not equal");
}
} catch (Exception e) {
e.printStackTrace();
failed++;
}
}
private static void newGCMParameterSpecFail(
try {
failed++;
} catch (IllegalArgumentException e) {
// swallow
}
}
private static void newGCMParameterSpecPass(
try {
throw new Exception("tLen's not equal");
}
throw new Exception("IV's not equal");
}
} catch (Exception e) {
e.printStackTrace();
failed++;
}
}
private static void newGCMParameterSpecFail(
try {
failed++;
} catch (IllegalArgumentException e) {
// swallow
}
}
}