--- /dev/null	2014-05-03 18:05:47.580612362 +0200
+++ new/test/java/security/StandardMessageDigests/TestVectors.java	2014-05-05 13:49:22.673221048 +0200
@@ -0,0 +1,104 @@
+/*
+ * Copyright (c) 2014, Red Hat, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * 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.
+ */
+
+import java.lang.reflect.Method;
+
+import java.security.MessageDigest;
+import java.security.StandardMessageDigests;
+
+/**
+ * @test
+ * @bug 
+ * @summary Test the StandardMessageDigests class
+ */
+public class TestVectors {
+
+    private static final String[] names = {
+        "SHA1", "SHA256", "SHA384", "SHA512"
+    };
+
+    // Digests of the empty string.
+    private static final String[] emptyDigests = {
+        "da39a3ee5e6b4b0d3255bfef95601890afd80709",
+        "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
+        "38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b",
+        "cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e"
+    };
+
+    // Digests of the string "abcd".
+    private static final String[] abcdDigests = {
+        "81fe8bfe87576c3ecb22426f8e57847382917acf",
+        "88d4266fd4e6338d13b845fcf289579d209c897823b9217da3e161936f031589",
+        "1165b3406ff0b52a3d24721f785462ca2276c9f454a116c2b2ba20171a7905ea5a026682eb659c4d5f115c363aa3c79b",
+        "d8022f2060ad6efd297ab73dcc5355c9b214054b0d1776a136a669d26a7d3b14f73aa0d0ebff19ee333368f0164b6419a96da49e3e481753e7e96b716bdccb6f"
+
+    };
+
+    private static String base16(byte[] blob) {
+        StringBuilder sb = new StringBuilder();
+        for (byte b : blob) {
+            char high = Character.forDigit((b >> 4) & 0xF, 16);
+            sb.append(high);
+            char low = Character.forDigit(b & 0xF, 16);
+            sb.append(low);
+        }
+        return sb.toString();
+    }
+
+    private static MessageDigest[] createDigests() throws Exception {
+        MessageDigest[] digests = new MessageDigest[names.length];
+        Class<?> cls = StandardMessageDigests.class;
+        for (int i = 0; i < digests.length; ++i) {
+            Method method = cls.getMethod("new" + names[i]);
+            digests[i] = (MessageDigest) method.invoke(null);
+        }
+        return digests;
+    }
+
+    public static void main(String[] args) throws Exception {
+        MessageDigest[] digests1 = createDigests();
+        for (int i = 0; i < digests1.length; ++i) {
+            digests1[i].update((byte) 'a');
+            digests1[i].update((byte) 'b');
+        }
+
+        // Check independence of returned objects for the same digest
+        // algorithm.
+        MessageDigest[] digests2 = createDigests();
+        for (int i = 0; i < digests2.length; ++i) {
+            String result = base16(digests2[i].digest());
+            if (!result.equals(emptyDigests[i]))
+                throw new AssertionError("empty " + names[i] + ' ' + result);
+        }
+
+        // Check independence of the objects among themselves.
+        for (int i = 0; i < digests1.length; ++i) {
+            digests1[i].update(new byte[] {'c', 'd'});
+        }
+        for (int i = 0; i < digests1.length; ++i) {
+            String result = base16(digests1[i].digest());
+            if (!result.equals(abcdDigests[i]))
+                throw new AssertionError("abcd " + names[i] + ' ' + result);
+        }
+    }
+}
