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
29 [HASH_ALGO_SM3_256] = "sm3",29 [HASH_ALGO_SM3_256] = "sm3",
30 [HASH_ALGO_STREEBOG_256] = "streebog256",30 [HASH_ALGO_STREEBOG_256] = "streebog256",
31 [HASH_ALGO_STREEBOG_512] = "streebog512",31 [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",
32};35};
33EXPORT_SYMBOL_GPL(hash_algo_name);36EXPORT_SYMBOL_GPL(hash_algo_name);
34 37
@@ -53,5 +56,8 @@ const int hash_digest_size[HASH_ALGO__LAST] = { · 18 unmodified lines
53 [HASH_ALGO_SM3_256] = SM3256_DIGEST_SIZE,56 [HASH_ALGO_SM3_256] = SM3256_DIGEST_SIZE,
54 [HASH_ALGO_STREEBOG_256] = STREEBOG256_DIGEST_SIZE,57 [HASH_ALGO_STREEBOG_256] = STREEBOG256_DIGEST_SIZE,
55 [HASH_ALGO_STREEBOG_512] = STREEBOG512_DIGEST_SIZE,58 [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,
56};62};
57EXPORT_SYMBOL_GPL(hash_digest_size);63EXPORT_SYMBOL_GPL(hash_digest_size);
include/crypto/hash_info.h+1−0
@@ -10,6 +10,7 @@ · 9 unmodified lines
10 10
11#include <crypto/sha1.h>11#include <crypto/sha1.h>
12#include <crypto/sha2.h>12#include <crypto/sha2.h>
13#include <crypto/sha3.h>
13#include <crypto/md5.h>14#include <crypto/md5.h>
14#include <crypto/streebog.h>15#include <crypto/streebog.h>
15 16
include/uapi/linux/hash_info.h+3−0
@@ -35,6 +35,9 @@ enum hash_algo { · 34 unmodified lines
35 HASH_ALGO_SM3_256,35 HASH_ALGO_SM3_256,
36 HASH_ALGO_STREEBOG_256,36 HASH_ALGO_STREEBOG_256,
37 HASH_ALGO_STREEBOG_512,37 HASH_ALGO_STREEBOG_512,
38 HASH_ALGO_SHA3_256,
39 HASH_ALGO_SHA3_384,
40 HASH_ALGO_SHA3_512,
38 HASH_ALGO__LAST41 HASH_ALGO__LAST
39};42};
40 43

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