Skip to content

Commit 190b24b

Browse files
committed
[CODEC-213] Support JEP 287: SHA-3 Hash Algorithms
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/codec/trunk@1743938 13f79535-47bb-0310-9956-ffa450edef68
1 parent fc18ae9 commit 190b24b

2 files changed

Lines changed: 34 additions & 1 deletion

File tree

src/changes/changes.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ The <action> type attribute can be add,update,fix,remove.
4747
<action dev="ggregory" type="fix" issue="CODEC-207" due-to="Gary Gregory">Charsets Javadoc breaks build when using Java 8</action>
4848
<action dev="ggregory" type="fix" issue="CODEC-199" due-to="Yossi Tamari">Bug in HW rule in Soundex</action>
4949
<action dev="ggregory" type="fix" issue="CODEC-209" due-to="Gary Gregory">Javadoc for SHA-224 DigestUtils methods should mention Java 1.8.0 restriction instead of 1.4.0.</action>
50+
<action dev="ggregory" type="add" issue="CODEC-213" due-to="Gary Gregory">Support JEP 287: SHA-3 Hash Algorithms</action>
5051
<action dev="ggregory" type="add" issue="CODEC-212" due-to="Gary Gregory">Create a minimal Digest command line utility: org.apache.commons.codec.digest.Digest</action>
5152
<action dev="ggregory" type="add" issue="CODEC-211" due-to="Gary Gregory">Create enum MessageDigestAlgorithm and deprecate class MessageDigestAlgorithms</action>
5253
<action dev="ggregory" type="add" issue="CODEC-210" due-to="Gary Gregory">Add DigestUtils.getDigest(String, MessageDigest)</action>

src/main/java/org/apache/commons/codec/digest/MessageDigestAlgorithm.java

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,39 @@ public enum MessageDigestAlgorithm {
7474
/**
7575
* The SHA-512 hash algorithm defined in the FIPS PUB 180-2.
7676
*/
77-
SHA_512("SHA-512");
77+
SHA_512("SHA-512"),
78+
79+
/**
80+
* The SHA3-224 hash algorithm defined in the NIST FIPS 202.
81+
* <p>
82+
* Java 9 only.
83+
* </p>
84+
*/
85+
SHA3_224("SHA3-224"),
86+
87+
/**
88+
* The SHA3-256 hash algorithm defined in the NIST FIPS 202.
89+
* <p>
90+
* Java 9 only.
91+
* </p>
92+
*/
93+
SHA3_256("SHA3-256"),
94+
95+
/**
96+
* The SHA3-384 hash algorithm defined in the NIST FIPS 202.
97+
* <p>
98+
* Java 9 only.
99+
* </p>
100+
*/
101+
SHA3_384("SHA3-384"),
102+
103+
/**
104+
* The SHA3-512 hash algorithm defined in the NIST FIPS 202.
105+
* <p>
106+
* Java 9 only.
107+
* </p>
108+
*/
109+
SHA3_512("SHA3-512");
78110

79111
private final String algorithm;
80112

0 commit comments

Comments
 (0)