History

crypto: FIPS 202 SHA-3 register in hash info for IMA

Register FIPS 202 SHA-3 hashes in hash info for IMA and other users. Sizes 256 and up, as 224 is too weak for any practical purposes.

Dimitri John Ledkov committed 3 years ago

Commit 4b057651 parent 2ee7c1b3 files · +10 −0Browse files

Unified · Split

3 files
  1. crypto/hash_info.c +6 −0
  2. include/crypto/hash_info.h +1 −0
  3. include/uapi/linux/hash_info.h +3 −0
crypto/hash_info.c+6−0
@@ -29,6 +29,9 @@ const char *const hash_algo_name[HASH_ALGO__LAST] = { · 28 unmodified lines
2929 [HASH_ALGO_SM3_256] = "sm3",
3030 [HASH_ALGO_STREEBOG_256] = "streebog256",
3131 [HASH_ALGO_STREEBOG_512] = "streebog512",
32+ [HASH_ALGO_SHA3_256] = "sha3-256",
33+ [HASH_ALGO_SHA3_384] = "sha3-384",
34+ [HASH_ALGO_SHA3_512] = "sha3-512",
3235 };
3336 EXPORT_SYMBOL_GPL(hash_algo_name);
3437
@@ -53,5 +56,8 @@ const int hash_digest_size[HASH_ALGO__LAST] = { · 18 unmodified lines
5356 [HASH_ALGO_SM3_256] = SM3256_DIGEST_SIZE,
5457 [HASH_ALGO_STREEBOG_256] = STREEBOG256_DIGEST_SIZE,
5558 [HASH_ALGO_STREEBOG_512] = STREEBOG512_DIGEST_SIZE,
59+ [HASH_ALGO_SHA3_256] = SHA3_256_DIGEST_SIZE,
60+ [HASH_ALGO_SHA3_384] = SHA3_384_DIGEST_SIZE,
61+ [HASH_ALGO_SHA3_512] = SHA3_512_DIGEST_SIZE,
5662 };
5763 EXPORT_SYMBOL_GPL(hash_digest_size);
include/crypto/hash_info.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
1010
1111 #include <crypto/sha1.h>
1212 #include <crypto/sha2.h>
13+#include <crypto/sha3.h>
1314 #include <crypto/md5.h>
1415 #include <crypto/streebog.h>
1516
include/uapi/linux/hash_info.h+3−0
@@ -35,6 +35,9 @@ enum hash_algo { · 34 unmodified lines
3535 HASH_ALGO_SM3_256,
3636 HASH_ALGO_STREEBOG_256,
3737 HASH_ALGO_STREEBOG_512,
38+ HASH_ALGO_SHA3_256,
39+ HASH_ALGO_SHA3_384,
40+ HASH_ALGO_SHA3_512,
3841 HASH_ALGO__LAST
3942 };
4043

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t