Add SHA3 and Keccak

The previous hash-mode 5000 covered Keccak-256 only. FIPS changed one
padding byte while adopting Keccak as the SHA3 standard, which gives us
different digests. Now we have separate kernels for SHA3 and Keccak.

 - Added hash-mode 17300 = SHA3-224
 - Added hash-mode 17400 = SHA3-256
 - Added hash-mode 17500 = SHA3-384
 - Added hash-mode 17600 = SHA3-512
 - Added hash-mode 17700 = Keccak-224
 - Added hash-mode 17800 = Keccak-256
 - Added hash-mode 17900 = Keccak-384
 - Added hash-mode 18000 = Keccak-512
 - Removed hash-mode 5000 = SHA-3 (Keccak)
This commit is contained in:
R. Yushaev
2018-10-15 16:06:31 +02:00
parent 9d7e39590b
commit 5c87720acc
36 changed files with 12960 additions and 193 deletions
+12 -3
View File
@@ -1060,7 +1060,6 @@ typedef enum hash_type
HASH_TYPE_ORACLEH = 13,
HASH_TYPE_DESRACF = 14,
HASH_TYPE_BCRYPT = 15,
HASH_TYPE_KECCAK = 16,
HASH_TYPE_NETNTLM = 17,
HASH_TYPE_RIPEMD160 = 18,
HASH_TYPE_WHIRLPOOL = 19,
@@ -1186,7 +1185,6 @@ typedef enum kern_type
KERN_TYPE_SHA1_MD5 = 4700,
KERN_TYPE_MD5_CHAP = 4800,
KERN_TYPE_SHA1_SLT_PW_SLT = 4900,
KERN_TYPE_KECCAK = 5000,
KERN_TYPE_MD5H = 5100,
KERN_TYPE_PSAFE3 = 5200,
KERN_TYPE_IKEPSK_MD5 = 5300,
@@ -1325,6 +1323,14 @@ typedef enum kern_type
KERN_TYPE_WPA_PMKID_PBKDF2 = 16800,
KERN_TYPE_WPA_PMKID_PMK = 16801,
KERN_TYPE_ANSIBLE_VAULT = 16900,
KERN_TYPE_SHA3_224 = 17300,
KERN_TYPE_SHA3_256 = 17400,
KERN_TYPE_SHA3_384 = 17500,
KERN_TYPE_SHA3_512 = 17600,
KERN_TYPE_KECCAK_224 = 17700,
KERN_TYPE_KECCAK_256 = 17800,
KERN_TYPE_KECCAK_384 = 17900,
KERN_TYPE_KECCAK_512 = 18000,
KERN_TYPE_PLAINTEXT = 99999,
} kern_type_t;
@@ -1418,7 +1424,10 @@ int des_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_bu
int episerver_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int postgresql_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int netscreen_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int keccak_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int keccak_224_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int keccak_256_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int keccak_384_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int keccak_512_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int blake2b_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int chacha20_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);
int lm_parse_hash (u8 *input_buf, u32 input_len, hash_t *hash_buf, MAYBE_UNUSED hashconfig_t *hashconfig);