Skip to content

Commit c5b282c

Browse files
committed
Merge branch 'pgpainless-documentHashTags'
2 parents 3793cfd + 7847acd commit c5b282c

File tree

1 file changed

+102
-21
lines changed

1 file changed

+102
-21
lines changed
Lines changed: 102 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,113 @@
11
package org.bouncycastle.bcpg;
22

33
/**
4-
* basic tags for hash algorithms
4+
* Basic tags for hash algorithms.
5+
*
6+
* @see <a href="https://www.rfc-editor.org/rfc/rfc4880.html#section-9.4">
7+
* RFC4880 - Hash Algorithms</a>
8+
* @see <a href="https://www.ietf.org/archive/id/draft-koch-librepgp-00.html#name-hash-algorithms">
9+
* LibrePGP - Hash Algorithms</a>
10+
* @see <a href="https://www.ietf.org/archive/id/draft-ietf-openpgp-crypto-refresh-13.html#name-hash-algorithms">
11+
* Crypto-Refresh - Hash Algorithms</a>
512
*/
613
public interface HashAlgorithmTags
714
{
8-
int MD5 = 1; // MD5
9-
int SHA1 = 2; // SHA-1
10-
int RIPEMD160 = 3; // RIPE-MD/160
11-
int DOUBLE_SHA = 4; // Reserved for double-width SHA (experimental)
12-
int MD2 = 5; // MD2
13-
int TIGER_192 = 6; // Reserved for TIGER/192
14-
int HAVAL_5_160 = 7; // Reserved for HAVAL (5 pass, 160-bit)
15-
16-
int SHA256 = 8; // SHA-256
17-
int SHA384 = 9; // SHA-384
18-
int SHA512 = 10; // SHA-512
19-
int SHA224 = 11; // SHA-224
20-
int SHA3_256 = 12; // SHA3-256
21-
int SHA3_512 = 14; // SHA3-512
15+
/**
16+
* MD5.
17+
* Implementations MUST NOT use this to generate signatures.
18+
* Implementations MUST NOT use this as a hash function in ECDH KDFs.
19+
* Implementations MUST NOT generate packets with this hash function in an S2K KDF.
20+
* Implementations MUST NOT use this hash function in an S2K KDF to decrypt v6+ packets.
21+
*/
22+
int MD5 = 1;
23+
/**
24+
* SHA-1.
25+
* Implementations MUST NOT use this to generate signatures.
26+
* Implementations MUST NOT use this as a hash function in ECDH KDFs.
27+
* Implementations MUST NOT generate packets with this hash function in an S2K KDF.
28+
* Implementations MUST NOT use this hash function in an S2K KDF to decrypt v6+ packets.
29+
*/
30+
int SHA1 = 2;
31+
/**
32+
* RIPEMD-160.
33+
* Implementations MUST NOT use this to generate signatures.
34+
* Implementations MUST NOT use this as a hash function in ECDH KDFs.
35+
* Implementations MUST NOT generate packets with this hash function in an S2K KDF.
36+
* Implementations MUST NOT use this hash function in an S2K KDF to decrypt v6+ packets.
37+
*/
38+
int RIPEMD160 = 3;
39+
/**
40+
* Reserved for double-width SHA (experimental).
41+
*/
42+
int DOUBLE_SHA = 4;
43+
/**
44+
* Reserved for MD2.
45+
*/
46+
int MD2 = 5;
47+
/**
48+
* Reserved for TIGER/192.
49+
*/
50+
int TIGER_192 = 6;
51+
/**
52+
* Reserved for HAVAL (5 pass, 160-bit).
53+
*/
54+
int HAVAL_5_160 = 7;
55+
/**
56+
* SHA2-256.
57+
* Compliant implementations MUST implement.
58+
*/
59+
int SHA256 = 8;
60+
/**
61+
* SHA2-384.
62+
*/
63+
int SHA384 = 9;
64+
/**
65+
* SHA2-512.
66+
*/
67+
int SHA512 = 10;
68+
/**
69+
* SHA2-224.
70+
*/
71+
int SHA224 = 11;
72+
/**
73+
* SHA3-256.
74+
*/
75+
int SHA3_256 = 12;
76+
/**
77+
* SHA3-512.
78+
*/
79+
int SHA3_512 = 14;
2280

81+
/**
82+
* Reserved for MD4.
83+
* @deprecated non-standard
84+
*/
2385
int MD4 = 301;
24-
int SHA3_224 = 312; // SHA3-224
25-
int SHA3_256_OLD = 313; //SHA3-256
26-
int SHA3_384 = 314; // SHA3-384
27-
int SHA3_512_OLD = 315; // SHA3-512
86+
/**
87+
* Reserved for SHA3-224.
88+
* @deprecated non-standard
89+
*/
90+
int SHA3_224 = 312;
91+
/**
92+
* Reserved for SHA3-256.
93+
* @deprecated non-standard
94+
*/
95+
int SHA3_256_OLD = 313;
96+
/**
97+
* Reserved for SHA3-384.
98+
* @deprecated non-standard
99+
*/
100+
int SHA3_384 = 314;
101+
/**
102+
* Reserved for SHA3-512.
103+
* @deprecated non-standard
104+
*/
105+
int SHA3_512_OLD = 315;
28106

29-
30-
int SM3 = 326; // SM3
107+
/**
108+
* Reserved for SM3.
109+
* @deprecated non-standard
110+
*/
111+
int SM3 = 326;
31112

32113
}

0 commit comments

Comments
 (0)