/*
* 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 4846410 6313661
* @summary Basic known-answer-test for Hmac and SslMac algorithms
* @author Andreas Sterbenz
*/
public class MacKAT {
if (b == null) {
return "(null)";
}
for (int i = 0; i < b.length; i++) {
int k = b[i] & 0xff;
if (i != 0) {
}
}
}
try {
int n = s.length();
StringReader r = new StringReader(s);
while (true) {
int b1 = nextNibble(r);
if (b1 < 0) {
break;
}
int b2 = nextNibble(r);
if (b2 < 0) {
throw new RuntimeException("Invalid string " + s);
}
}
return out.toByteArray();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public static byte[] b(String s) {
return parse(s);
}
while (true) {
if (ch == -1) {
return -1;
return ch - '0';
}
}
}
static abstract class Test {
}
private final byte[] input;
private final byte[] macvalue;
private final byte[] key;
}
}
}
}
}
}
private static byte[] s(String s) {
try {
return s.getBytes("UTF8");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
}
}
}
static {
BKEY = new byte[128];
}
"1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
"76:00:4a:72:98:9b:65:ec:2e:f1:43:c4:65:4a:13:71"),
"23:ae:dd:61:87:6c:7a:45:47:2f:2c:8f:ea:64:99:3e:27:5f:97:a5"),
"9b:bb:e2:aa:9b:28:1c:95:0e:ea:30:21:98:a5:7e:31:9e:bf:5f:51"),
"1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
"76:00:4a:72:98:9b:65:ec:2e:f1:43:c4:65:4a:13:71"),
BKEY),
"1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
"76:00:4a:72:98:9b:65:ec:2e:f1:43:c4:65:4a:13:71"),
BKEY),
t("HmacSHA256", ALONG, "3f:6d:08:df:0c:90:b0:e9:ed:13:4a:2e:c3:48:1d:3d:3e:61:2e:f1:30:c2:63:c4:58:57:03:c2:cb:87:15:07",
"1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
t("HmacSHA256", BLONG, "e2:4e:a3:b9:0b:b8:99:e4:71:cf:ca:9f:f8:4e:f0:34:8b:19:9f:33:4b:1a:b7:13:f7:c8:57:92:e3:03:74:78",
BKEY),
t("HmacSHA384", ALONG, "d0:f0:d4:54:1c:0a:6d:81:ed:15:20:d7:0c:96:06:61:a0:ff:c9:ff:91:e9:a0:cd:e2:45:64:9d:93:4c:a9:fa:89:ae:c0:90:e6:0b:a1:a0:56:80:57:3b:ed:4b:b0:71",
"1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
t("HmacSHA384", BLONG, "75:c4:ca:c7:f7:58:9d:d3:23:b1:1b:5c:93:2d:ec:7a:03:dc:8c:eb:8d:fe:79:46:4f:30:e7:99:62:de:44:e2:38:95:0e:79:91:78:2f:a4:05:0a:f0:17:10:38:a1:8e",
BKEY),
t("HmacSHA512", ALONG, "41:ea:4c:e5:31:3f:7c:18:0e:5e:95:a9:25:0a:10:58:e6:40:53:88:82:4f:5a:da:6f:29:de:04:7b:8e:d7:ed:7c:4d:b8:2a:48:2d:17:2a:2d:59:bb:81:9c:bf:33:40:04:77:44:fb:45:25:1f:fd:b9:29:f4:a6:69:a3:43:6f",
"1b:34:61:29:05:0d:73:db:25:d0:dd:64:06:29:f6:8a"),
t("HmacSHA512", BLONG, "fb:cf:4b:c6:d5:49:5a:5b:0b:d9:2a:32:f5:fa:68:d2:68:a4:0f:ae:53:fc:49:12:e6:1d:53:cf:b2:cb:c5:c5:f2:2d:86:bd:14:61:30:c3:a6:6f:44:1f:77:9b:aa:a1:22:48:a9:dd:d0:45:86:d1:a1:82:53:13:c4:03:06:a3",
BKEY),
};
}
}
}
}