aboutsummaryrefslogtreecommitdiff
path: root/test/compiler/7184394/TestAESEncode.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/compiler/7184394/TestAESEncode.java')
-rw-r--r--test/compiler/7184394/TestAESEncode.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/compiler/7184394/TestAESEncode.java b/test/compiler/7184394/TestAESEncode.java
index 1d6bf7fbd..f1a35bde0 100644
--- a/test/compiler/7184394/TestAESEncode.java
+++ b/test/compiler/7184394/TestAESEncode.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -33,14 +33,15 @@ public class TestAESEncode extends TestAESBase {
public void run() {
try {
if (!noReinit) cipher.init(Cipher.ENCRYPT_MODE, key, algParams);
+ encode = new byte[encodeLength];
+ if (testingMisalignment) {
+ int tempSize = cipher.update(input, encInputOffset, (msgSize - lastChunkSize), encode, encOutputOffset);
+ cipher.doFinal(input, (encInputOffset + msgSize - lastChunkSize), lastChunkSize, encode, (encOutputOffset + tempSize));
+ } else {
+ cipher.doFinal(input, encInputOffset, msgSize, encode, encOutputOffset);
+ }
if (checkOutput) {
- // checked version creates new output buffer each time
- encode = cipher.doFinal(input, 0, msgSize);
compareArrays(encode, expectedEncode);
- } else {
- // non-checked version outputs to existing encode buffer for maximum speed
- encode = new byte[cipher.getOutputSize(msgSize)];
- cipher.doFinal(input, 0, msgSize, encode);
}
}
catch (Exception e) {