8136459: MessageDigest.isEqual is not a "simple byte compare"
authorvaleriep
Fri, 15 Jul 2016 01:24:22 +0000
changeset 39651 409deb371234
parent 39650 d35ef7964b1e
child 39652 4213518e2074
8136459: MessageDigest.isEqual is not a "simple byte compare" Summary: Update the corresponding javadoc with @implNote and clarification. Reviewed-by: mullan, darcy
jdk/src/java.base/share/classes/java/security/MessageDigest.java
--- a/jdk/src/java.base/share/classes/java/security/MessageDigest.java	Thu Jul 14 16:04:38 2016 -0700
+++ b/jdk/src/java.base/share/classes/java/security/MessageDigest.java	Fri Jul 15 01:24:22 2016 +0000
@@ -439,7 +439,12 @@
     }
 
     /**
-     * Compares two digests for equality. Does a simple byte compare.
+     * Compares two digests for equality. Two digests are equal if they have
+     * the same length and all bytes at corresponding positions are equal.
+     *
+     * @implNote
+     * If the digests are the same length, all bytes are examined to
+     * determine equality.
      *
      * @param digesta one of the digests to compare.
      *