|
1 | 1 | package org.bouncycastle.bcpg;
|
2 | 2 |
|
3 | 3 | /**
|
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> |
5 | 12 | */
|
6 | 13 | public interface HashAlgorithmTags
|
7 | 14 | {
|
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; |
22 | 80 |
|
| 81 | + /** |
| 82 | + * Reserved for MD4. |
| 83 | + * @deprecated non-standard |
| 84 | + */ |
23 | 85 | 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; |
28 | 106 |
|
29 |
| - |
30 |
| - int SM3 = 326; // SM3 |
| 107 | + /** |
| 108 | + * Reserved for SM3. |
| 109 | + * @deprecated non-standard |
| 110 | + */ |
| 111 | + int SM3 = 326; |
31 | 112 |
|
32 | 113 | }
|
0 commit comments