From a78fd4e9158b85277cca1749b7077f9df11f6d0f Mon Sep 17 00:00:00 2001 From: coolbry95 Date: Tue, 4 Oct 2016 00:35:49 -0400 Subject: [PATCH] changed uint to u32 --- include/cpu_md5.h | 4 +- include/cpu_sha1.h | 2 +- include/cpu_sha256.h | 2 +- include/hashes.h | 2 +- include/hlfmt.h | 8 +- include/hwmon.h | 26 +- include/interface.h | 626 ++++++++++++------------ include/mpsp.h | 22 +- include/opencl.h | 14 +- include/outfile.h | 4 +- include/potfile.h | 4 +- include/rp.h | 2 +- include/stdout.h | 2 +- include/thread.h | 4 +- include/types.h | 2 - include/weak_hash.h | 2 +- include/wordlist.h | 4 +- src/hashes.c | 92 ++-- src/hlfmt.c | 12 +- src/hwmon.c | 48 +- src/interface.c | 1104 +++++++++++++++++++++--------------------- src/mpsp.c | 150 +++--- src/opencl.c | 176 +++---- src/outfile.c | 12 +- src/potfile.c | 52 +- src/rp.c | 42 +- src/stdout.c | 48 +- src/weak_hash.c | 12 +- src/wordlist.c | 12 +- 29 files changed, 1244 insertions(+), 1246 deletions(-) diff --git a/include/cpu_md5.h b/include/cpu_md5.h index 68db3d579..33396f926 100644 --- a/include/cpu_md5.h +++ b/include/cpu_md5.h @@ -8,7 +8,7 @@ #include -void md5_64 (uint block[16], uint digest[4]); -void md5_complete_no_limit (uint digest[4], uint *plain, uint plain_len); +void md5_64 (u32 block[16], u32 digest[4]); +void md5_complete_no_limit (u32 digest[4], u32 *plain, u32 plain_len); #endif // _CPU_MD5_H diff --git a/include/cpu_sha1.h b/include/cpu_sha1.h index 73a6a1d4b..d8c6dcdcf 100644 --- a/include/cpu_sha1.h +++ b/include/cpu_sha1.h @@ -6,6 +6,6 @@ #ifndef _CPU_SHA1_H #define _CPU_SHA1_H -void sha1_64 (uint block[16], uint digest[5]); +void sha1_64 (u32 block[16], u32 digest[5]); #endif // _CPU_SHA1_H diff --git a/include/cpu_sha256.h b/include/cpu_sha256.h index e18249440..98c9ddc9d 100644 --- a/include/cpu_sha256.h +++ b/include/cpu_sha256.h @@ -6,6 +6,6 @@ #ifndef _CPU_SHA256_H #define _CPU_SHA256_H -void sha256_64 (uint block[16], uint digest[8]); +void sha256_64 (u32 block[16], u32 digest[8]); #endif // _CPU_SHA256_H diff --git a/include/hashes.h b/include/hashes.h index bcce69521..1d0bcb235 100644 --- a/include/hashes.h +++ b/include/hashes.h @@ -15,7 +15,7 @@ void save_hash (const user_options_t *user_options, const hashconfig_t *hashconf void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, plain_t *plain); -int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const uint salt_pos); +int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos); int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfile_ctx_t *potfile_ctx, outfile_ctx_t *outfile_ctx, user_options_t *user_options, char *hash_or_file); int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_options_t *user_options, status_ctx_t *status_ctx); diff --git a/include/hlfmt.h b/include/hlfmt.h index 33ce103f2..48b148d8b 100644 --- a/include/hlfmt.h +++ b/include/hlfmt.h @@ -10,11 +10,11 @@ #define HLFMTS_CNT 11 -char *strhlfmt (const uint hashfile_format); +char *strhlfmt (const u32 hashfile_format); -void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, const hashconfig_t *hashconfig, const user_options_t *user_options); -void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, const hashconfig_t *hashconfig); +void hlfmt_hash (u32 hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, const hashconfig_t *hashconfig, const user_options_t *user_options); +void hlfmt_user (u32 hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, const hashconfig_t *hashconfig); -uint hlfmt_detect (FILE *fp, uint max_check, const hashconfig_t *hashconfig); +u32 hlfmt_detect (FILE *fp, u32 max_check, const hashconfig_t *hashconfig); #endif // _HLFMT_H diff --git a/include/hwmon.h b/include/hwmon.h index 27c698cbc..6b84c67f5 100644 --- a/include/hwmon.h +++ b/include/hwmon.h @@ -6,19 +6,19 @@ #ifndef _HWMON_H #define _HWMON_H -int hm_get_threshold_slowdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_threshold_shutdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_temperature_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_fanpolicy_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_fanspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_buslanes_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_utilization_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_memoryspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_corespeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_get_throttle_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id); -int hm_set_fanspeed_with_device_id_adl (const hwmon_ctx_t *hwmon_ctx, const uint device_id, const int fanspeed, const int fanpolicy); -int hm_set_fanspeed_with_device_id_nvapi (const hwmon_ctx_t *hwmon_ctx, const uint device_id, const int fanspeed, const int fanpolicy); -int hm_set_fanspeed_with_device_id_xnvctrl (const hwmon_ctx_t *hwmon_ctx, const uint device_id, const int fanspeed); +int hm_get_threshold_slowdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_threshold_shutdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_temperature_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_fanpolicy_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_fanspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_buslanes_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_utilization_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_memoryspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_corespeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_get_throttle_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id); +int hm_set_fanspeed_with_device_id_adl (const hwmon_ctx_t *hwmon_ctx, const u32 device_id, const int fanspeed, const int fanpolicy); +int hm_set_fanspeed_with_device_id_nvapi (const hwmon_ctx_t *hwmon_ctx, const u32 device_id, const int fanspeed, const int fanpolicy); +int hm_set_fanspeed_with_device_id_xnvctrl (const hwmon_ctx_t *hwmon_ctx, const u32 device_id, const int fanspeed); int hwmon_ctx_init (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, const opencl_ctx_t *opencl_ctx); void hwmon_ctx_destroy (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, const opencl_ctx_t *opencl_ctx); diff --git a/include/interface.h b/include/interface.h index 81e624242..24a994622 100644 --- a/include/interface.h +++ b/include/interface.h @@ -25,7 +25,7 @@ typedef struct rar5 { - uint iv[4]; + u32 iv[4]; } rar5_t; @@ -37,23 +37,23 @@ typedef struct pdf int enc_md; - uint id_buf[8]; - uint u_buf[32]; - uint o_buf[32]; + u32 id_buf[8]; + u32 u_buf[32]; + u32 o_buf[32]; int id_len; int o_len; int u_len; - uint rc4key[2]; - uint rc4data[2]; + u32 rc4key[2]; + u32 rc4data[2]; } pdf_t; typedef struct wpa { - uint pke[25]; - uint eapol[64]; + u32 pke[25]; + u32 eapol[64]; int eapol_size; int keyver; u8 orig_mac1[6]; @@ -65,70 +65,70 @@ typedef struct wpa typedef struct bitcoin_wallet { - uint cry_master_buf[64]; - uint ckey_buf[64]; - uint public_key_buf[64]; + u32 cry_master_buf[64]; + u32 ckey_buf[64]; + u32 public_key_buf[64]; - uint cry_master_len; - uint ckey_len; - uint public_key_len; + u32 cry_master_len; + u32 ckey_len; + u32 public_key_len; } bitcoin_wallet_t; typedef struct sip { - uint salt_buf[30]; - uint salt_len; + u32 salt_buf[30]; + u32 salt_len; - uint esalt_buf[38]; - uint esalt_len; + u32 esalt_buf[38]; + u32 esalt_len; } sip_t; typedef struct androidfde { - uint data[384]; + u32 data[384]; } androidfde_t; typedef struct ikepsk { - uint nr_buf[16]; - uint nr_len; + u32 nr_buf[16]; + u32 nr_len; - uint msg_buf[128]; - uint msg_len; + u32 msg_buf[128]; + u32 msg_len; } ikepsk_t; typedef struct netntlm { - uint user_len; - uint domain_len; - uint srvchall_len; - uint clichall_len; + u32 user_len; + u32 domain_len; + u32 srvchall_len; + u32 clichall_len; - uint userdomain_buf[64]; - uint chall_buf[256]; + u32 userdomain_buf[64]; + u32 chall_buf[256]; } netntlm_t; typedef struct krb5pa { - uint user[16]; - uint realm[16]; - uint salt[32]; - uint timestamp[16]; - uint checksum[4]; + u32 user[16]; + u32 realm[16]; + u32 salt[32]; + u32 timestamp[16]; + u32 checksum[4]; } krb5pa_t; typedef struct krb5tgs { - uint account_info[512]; - uint checksum[4]; - uint edata2[2560]; - uint edata2_len; + u32 account_info[512]; + u32 checksum[4]; + u32 edata2[2560]; + u32 edata2_len; } krb5tgs_t; @@ -157,34 +157,34 @@ typedef struct keepass typedef struct tc { - uint salt_buf[16]; - uint data_buf[112]; - uint keyfile_buf[16]; - uint signature; + u32 salt_buf[16]; + u32 data_buf[112]; + u32 keyfile_buf[16]; + u32 signature; } tc_t; typedef struct pbkdf2_md5 { - uint salt_buf[16]; + u32 salt_buf[16]; } pbkdf2_md5_t; typedef struct pbkdf2_sha1 { - uint salt_buf[16]; + u32 salt_buf[16]; } pbkdf2_sha1_t; typedef struct pbkdf2_sha256 { - uint salt_buf[16]; + u32 salt_buf[16]; } pbkdf2_sha256_t; typedef struct pbkdf2_sha512 { - uint salt_buf[32]; + u32 salt_buf[32]; } pbkdf2_sha512_t; @@ -196,56 +196,56 @@ typedef struct agilekey typedef struct rakp { - uint salt_buf[128]; - uint salt_len; + u32 salt_buf[128]; + u32 salt_len; } rakp_t; typedef struct cloudkey { - uint data_len; - uint data_buf[512]; + u32 data_len; + u32 data_buf[512]; } cloudkey_t; typedef struct office2007 { - uint encryptedVerifier[4]; - uint encryptedVerifierHash[5]; + u32 encryptedVerifier[4]; + u32 encryptedVerifierHash[5]; - uint keySize; + u32 keySize; } office2007_t; typedef struct office2010 { - uint encryptedVerifier[4]; - uint encryptedVerifierHash[8]; + u32 encryptedVerifier[4]; + u32 encryptedVerifierHash[8]; } office2010_t; typedef struct office2013 { - uint encryptedVerifier[4]; - uint encryptedVerifierHash[8]; + u32 encryptedVerifier[4]; + u32 encryptedVerifierHash[8]; } office2013_t; typedef struct oldoffice01 { - uint version; - uint encryptedVerifier[4]; - uint encryptedVerifierHash[4]; - uint rc4key[2]; + u32 version; + u32 encryptedVerifier[4]; + u32 encryptedVerifierHash[4]; + u32 rc4key[2]; } oldoffice01_t; typedef struct oldoffice34 { - uint version; - uint encryptedVerifier[4]; - uint encryptedVerifierHash[5]; - uint rc4key[2]; + u32 version; + u32 encryptedVerifier[4]; + u32 encryptedVerifierHash[5]; + u32 rc4key[2]; } oldoffice34_t; @@ -277,7 +277,7 @@ typedef struct zip2 typedef struct win8phone { - uint salt_buf[32]; + u32 salt_buf[32]; } win8phone_t; @@ -292,8 +292,8 @@ typedef struct psafe3 typedef struct pdf14_tmp { - uint digest[4]; - uint out[4]; + u32 digest[4]; + u32 out[4]; } pdf14_tmp_t; @@ -301,24 +301,24 @@ typedef struct pdf17l8_tmp { union { - uint dgst32[16]; + u32 dgst32[16]; u64 dgst64[8]; } d; - uint dgst_len; - uint W_len; + u32 dgst_len; + u32 W_len; } pdf17l8_tmp_t; typedef struct phpass_tmp { - uint digest_buf[4]; + u32 digest_buf[4]; } phpass_tmp_t; typedef struct md5crypt_tmp { - uint digest_buf[4]; + u32 digest_buf[4]; } md5crypt_tmp_t; @@ -333,20 +333,20 @@ typedef struct sha512crypt_tmp typedef struct sha256crypt_tmp { - uint alt_result[8]; + u32 alt_result[8]; - uint p_bytes[4]; - uint s_bytes[4]; + u32 p_bytes[4]; + u32 s_bytes[4]; } sha256crypt_tmp_t; typedef struct wpa_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst[10]; - uint out[10]; + u32 dgst[10]; + u32 out[10]; } wpa_tmp_t; @@ -358,69 +358,69 @@ typedef struct bitcoin_wallet_tmp typedef struct dcc2_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst[5]; - uint out[4]; + u32 dgst[5]; + u32 out[4]; } dcc2_tmp_t; typedef struct bcrypt_tmp { - uint E[18]; + u32 E[18]; - uint P[18]; + u32 P[18]; - uint S0[256]; - uint S1[256]; - uint S2[256]; - uint S3[256]; + u32 S0[256]; + u32 S1[256]; + u32 S2[256]; + u32 S3[256]; } bcrypt_tmp_t; typedef struct pwsafe2_tmp { - uint digest[2]; + u32 digest[2]; - uint P[18]; + u32 P[18]; - uint S0[256]; - uint S1[256]; - uint S2[256]; - uint S3[256]; + u32 S0[256]; + u32 S1[256]; + u32 S2[256]; + u32 S3[256]; } pwsafe2_tmp_t; typedef struct pwsafe3_tmp { - uint digest_buf[8]; + u32 digest_buf[8]; } pwsafe3_tmp_t; typedef struct androidpin_tmp { - uint digest_buf[5]; + u32 digest_buf[5]; } androidpin_tmp_t; typedef struct androidfde_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst[10]; - uint out[10]; + u32 dgst[10]; + u32 out[10]; } androidfde_tmp_t; typedef struct tc_tmp { - uint ipad[16]; - uint opad[16]; + u32 ipad[16]; + u32 opad[16]; - uint dgst[64]; - uint out[64]; + u32 dgst[64]; + u32 out[64]; } tc_tmp_t; @@ -436,44 +436,44 @@ typedef struct tc64_tmp typedef struct agilekey_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst[5]; - uint out[5]; + u32 dgst[5]; + u32 out[5]; } agilekey_tmp_t; typedef struct mywallet_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst1[5]; - uint out1[5]; + u32 dgst1[5]; + u32 out1[5]; - uint dgst2[5]; - uint out2[5]; + u32 dgst2[5]; + u32 out2[5]; } mywallet_tmp_t; typedef struct sha1aix_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst[5]; - uint out[5]; + u32 dgst[5]; + u32 out[5]; } sha1aix_tmp_t; typedef struct sha256aix_tmp { - uint ipad[8]; - uint opad[8]; + u32 ipad[8]; + u32 opad[8]; - uint dgst[8]; - uint out[8]; + u32 dgst[8]; + u32 out[8]; } sha256aix_tmp_t; @@ -489,11 +489,11 @@ typedef struct sha512aix_tmp typedef struct lastpass_tmp { - uint ipad[8]; - uint opad[8]; + u32 ipad[8]; + u32 opad[8]; - uint dgst[8]; - uint out[8]; + u32 dgst[8]; + u32 out[8]; } lastpass_tmp_t; @@ -505,23 +505,23 @@ typedef struct drupal7_tmp typedef struct lotus8_tmp { - uint ipad[5]; - uint opad[5]; + u32 ipad[5]; + u32 opad[5]; - uint dgst[5]; - uint out[5]; + u32 dgst[5]; + u32 out[5]; } lotus8_tmp_t; typedef struct office2007_tmp { - uint out[5]; + u32 out[5]; } office2007_tmp_t; typedef struct office2010_tmp { - uint out[5]; + u32 out[5]; } office2010_tmp_t; @@ -533,7 +533,7 @@ typedef struct office2013_tmp typedef struct saph_sha1_tmp { - uint digest_buf[5]; + u32 digest_buf[5]; } saph_sha1_tmp_t; @@ -595,50 +595,50 @@ typedef struct oraclet_tmp typedef struct seven_zip_tmp { - uint block[16]; + u32 block[16]; - uint dgst[8]; + u32 dgst[8]; - uint block_len; - uint final_len; + u32 block_len; + u32 final_len; } seven_zip_tmp_t; typedef struct bsdicrypt_tmp { - uint Kc[16]; - uint Kd[16]; + u32 Kc[16]; + u32 Kd[16]; - uint iv[2]; + u32 iv[2]; } bsdicrypt_tmp_t; typedef struct rar3_tmp { - uint dgst[17][5]; + u32 dgst[17][5]; } rar3_tmp_t; typedef struct cram_md5 { - uint user[16]; + u32 user[16]; } cram_md5_t; typedef struct seven_zip { - uint iv_buf[4]; - uint iv_len; + u32 iv_buf[4]; + u32 iv_len; - uint salt_buf[4]; - uint salt_len; + u32 salt_buf[4]; + u32 salt_len; - uint crc; + u32 crc; - uint data_buf[96]; - uint data_len; + u32 data_buf[96]; + u32 data_len; - uint unpack_size; + u32 unpack_size; } seven_zip_t; @@ -1340,174 +1340,174 @@ typedef enum rounds_count * input functions */ -int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int keepass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int veracrypt_parse_hash_200000 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int veracrypt_parse_hash_500000 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int veracrypt_parse_hash_327661 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int veracrypt_parse_hash_655331 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int win8phone_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); -int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int bcrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int cisco4_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int dcc_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int dcc2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int descrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int des_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int episerver_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int ipb2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int joomla_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int postgresql_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int netscreen_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int keccak_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int lm_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md4_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md4s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5half_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5pix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5asa_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5apr1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5crypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mssql2000_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mssql2005_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int netntlmv1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int netntlmv2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oracleh_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oracles_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oraclet_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int osc_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int arubaos_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int osx1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int osx512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int phpass_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha1b64_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha1b64s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha1s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha256s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha384_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512crypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int smf_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int vb3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int vb30_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int wpa_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int psafe2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int psafe3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int ikepsk_md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int ikepsk_sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int androidpin_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int ripemd160_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int whirlpool_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int truecrypt_parse_hash_1k (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int truecrypt_parse_hash_2k (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int md5aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha256aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int agilekey_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha1aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int lastpass_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int gost_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha256crypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mssql2012_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512osx_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int episerver4_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512grub_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha512b64s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int hmacsha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int hmacsha256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int hmacsha512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int hmacmd5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int krb5pa_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int krb5tgs_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sapb_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sapg_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int drupal7_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sybasease_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mysql323_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int rakp_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int netscaler_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int chap_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int cloudkey_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int nsec3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int wbb3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int racf_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int lotus5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int lotus6_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int lotus8_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int hmailserver_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int phps_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mediawiki_b_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int peoplesoft_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int skype_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int androidfde_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int scrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int juniper_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int cisco8_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int cisco9_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int office2007_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int office2010_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int office2013_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oldoffice01_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oldoffice01cm1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oldoffice01cm2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oldoffice34_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oldoffice34cm1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int oldoffice34cm2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int radmin2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int djangosha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int djangopbkdf2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int siphash_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int crammd5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int saph_sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int redmine_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pdf11_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pdf11cm1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pdf11cm2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pdf14_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pdf17l3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pdf17l8_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pbkdf2_sha256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int prestashop_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int postgresql_auth_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mysql_auth_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int bitcoin_wallet_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sip_auth_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int crc32_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int seven_zip_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int gost2012sbog_256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int gost2012sbog_512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pbkdf2_md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pbkdf2_sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pbkdf2_sha512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int ecryptfs_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int bsdicrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int rar3hp_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int rar5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int cf10_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int mywallet_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int ms_drsr_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int androidfde_samsung_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int axcrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int sha1axcrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int keepass_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int pstoken_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int zip2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int veracrypt_parse_hash_200000 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int veracrypt_parse_hash_500000 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int veracrypt_parse_hash_327661 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int veracrypt_parse_hash_655331 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int win8phone_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); +int opencart_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig); /** * output functions */ -char *stroptitype (const uint opti_type); -char *strhashtype (const uint hash_mode); -char *strparser (const uint parser_status); +char *stroptitype (const u32 opti_type); +char *strhashtype (const u32 hash_mode); +char *strparser (const u32 parser_status); -void to_hccap_t (hccap_t *hccap, const uint salt_pos, const uint digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes); +void to_hccap_t (hccap_t *hccap, const u32 salt_pos, const u32 digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes); -void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes); +void ascii_digest (char *out_buf, const u32 salt_pos, const u32 digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes); int hashconfig_init (hashconfig_t *hashconfig, const user_options_t *user_options); void hashconfig_destroy (hashconfig_t *hashconfig); diff --git a/include/mpsp.h b/include/mpsp.h index 38cbdbabf..a3447dd4b 100644 --- a/include/mpsp.h +++ b/include/mpsp.h @@ -20,21 +20,21 @@ #define INCR_MASKS 1000 -void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]); -void mp_cut_at (char *mask, uint max); -uint mp_get_length (char *mask); +void mp_css_to_uniq_tbl (u32 css_cnt, cs_t *css, u32 uniq_tbls[SP_PW_MAX][CHARSIZ]); +void mp_cut_at (char *mask, u32 max); +u32 mp_get_length (char *mask); void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt); -cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt, const hashconfig_t *hashconfig, const user_options_t *user_options); -u64 mp_get_sum (uint css_cnt, cs_t *css); +cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, u32 *css_cnt, const hashconfig_t *hashconfig, const user_options_t *user_options); +u64 mp_get_sum (u32 css_cnt, cs_t *css); void mp_setup_sys (cs_t *mp_sys); -void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index, const hashconfig_t *hashconfig, const user_options_t *user_options); -void mp_reset_usr (cs_t *mp_usr, uint index); +void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, u32 index, const hashconfig_t *hashconfig, const user_options_t *user_options); +void mp_reset_usr (cs_t *mp_usr, u32 index); -u64 sp_get_sum (uint start, uint stop, cs_t *root_css_buf); -void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop); +u64 sp_get_sum (u32 start, u32 stop, cs_t *root_css_buf); +void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 start, u32 stop); int sp_comp_val (const void *p1, const void *p2); -void sp_setup_tbl (const char *install_dir, char *hcstat, uint disable, uint classic, hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf); -void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint threshold, uint uniq_tbls[SP_PW_MAX][CHARSIZ]); +void sp_setup_tbl (const char *install_dir, char *hcstat, u32 disable, u32 classic, hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf); +void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 threshold, u32 uniq_tbls[SP_PW_MAX][CHARSIZ]); void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out); void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out); diff --git a/include/opencl.h b/include/opencl.h index 00843265e..86819d3d8 100644 --- a/include/opencl.h +++ b/include/opencl.h @@ -20,18 +20,18 @@ static const char CL_VENDOR_POCL[] = "The pocl project"; int gidd_to_pw_t (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u64 gidd, pw_t *pw); -int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, hashconfig_t *hashconfig, const hashes_t *hashes, const outfile_ctx_t *outfile_ctx, status_ctx_t *status_ctx, const uint highest_pw_len, const uint pws_cnt, const uint fast_iteration, const uint salt_pos); +int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, hashconfig_t *hashconfig, const hashes_t *hashes, const outfile_ctx_t *outfile_ctx, status_ctx_t *status_ctx, const u32 highest_pw_len, const u32 pws_cnt, const u32 fast_iteration, const u32 salt_pos); -int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig, const user_options_t *user_options, status_ctx_t *status_ctx); -int run_kernel_mp (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num); +int run_kernel (const u32 kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u32 num, const u32 event_update, const u32 iteration, hashconfig_t *hashconfig, const user_options_t *user_options, status_ctx_t *status_ctx); +int run_kernel_mp (const u32 kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u32 num); int run_kernel_tm (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param); -int run_kernel_amp (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num); -int run_kernel_memset (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const uint value, const uint num); +int run_kernel_amp (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u32 num); +int run_kernel_memset (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u32 num); int run_kernel_bzero (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const size_t size); -int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const combinator_ctx_t *combinator_ctx, const uint pws_cnt); +int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const combinator_ctx_t *combinator_ctx, const u32 pws_cnt); -int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const uint pws_cnt); +int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 pws_cnt); int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_options); void opencl_ctx_destroy (opencl_ctx_t *opencl_ctx); diff --git a/include/outfile.h b/include/outfile.h index 2ecafba4e..9c08782f2 100644 --- a/include/outfile.h +++ b/include/outfile.h @@ -12,10 +12,10 @@ void outfile_init (outfile_ctx_t *outfile_ctx, const user_options_t *user_options); void outfile_destroy (outfile_ctx_t *outfile_ctx); -void outfile_format_plain (outfile_ctx_t *outfile_ctx, const unsigned char *plain_ptr, const uint plain_len); +void outfile_format_plain (outfile_ctx_t *outfile_ctx, const unsigned char *plain_ptr, const u32 plain_len); void outfile_write_open (outfile_ctx_t *outfile_ctx); void outfile_write_close (outfile_ctx_t *outfile_ctx); -void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsigned char *plain_ptr, const uint plain_len, const u64 crackpos, const unsigned char *username, const uint user_len, const hashconfig_t *hashconfig); +void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsigned char *plain_ptr, const u32 plain_len, const u64 crackpos, const unsigned char *username, const u32 user_len, const hashconfig_t *hashconfig); int outfile_and_hashfile (outfile_ctx_t *outfile_ctx, const char *hashfile); #endif // _OUTFILE_H diff --git a/include/potfile.h b/include/potfile.h index 3d68f2512..7d94ea31b 100644 --- a/include/potfile.h +++ b/include/potfile.h @@ -21,14 +21,14 @@ void hc_qsort_r (void *base, size_t nmemb, size_t size, int (*compar) (const vo void *hc_bsearch_r (const void *key, const void *base, size_t nmemb, size_t size, int (*compar) (const void *, const void *, void *), void *arg); void potfile_init (potfile_ctx_t *potfile_ctx, const user_options_t *user_options, const folder_config_t *folder_config); -void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plain_ptr, const uint plain_len); +void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plain_ptr, const u32 plain_len); int potfile_read_open (potfile_ctx_t *potfile_ctx); void potfile_read_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig); void potfile_read_close (potfile_ctx_t *potfile_ctx); int potfile_write_open (potfile_ctx_t *potfile_ctx); void potfile_write_close (potfile_ctx_t *potfile_ctx); void potfile_write_append (potfile_ctx_t *potfile_ctx, const char *out_buf, u8 *plain_ptr, unsigned int plain_len); -void potfile_hash_alloc (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const uint num); +void potfile_hash_alloc (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const u32 num); void potfile_hash_free (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig); void potfile_show_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *, void *)); void potfile_left_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, outfile_ctx_t *outfile_ctx, char *input_buf, int input_len, hash_t *hashes_buf, int (*sort_by_pot) (const void *, const void *, void *)); diff --git a/include/rp.h b/include/rp.h index 2768be500..98dc5e23d 100644 --- a/include/rp.h +++ b/include/rp.h @@ -25,7 +25,7 @@ int conv_itoc (const u8 c); int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], const u32 rp_gen_func_min, const u32 rp_gen_func_max); -int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule); +int cpu_rule_to_kernel_rule (char *rule_buf, u32 rule_len, kernel_rule_t *rule); int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule); bool kernel_rules_has_noop (const kernel_rule_t *kernel_rules_buf, const u32 kernel_rules_cnt); diff --git a/include/stdout.h b/include/stdout.h index e93ee5394..e7511179e 100644 --- a/include/stdout.h +++ b/include/stdout.h @@ -20,6 +20,6 @@ #include #endif // _POSIX -void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const hashconfig_t *hashconfig, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, const outfile_ctx_t *outfile_ctx, const uint pws_cnt); +void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const hashconfig_t *hashconfig, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, const outfile_ctx_t *outfile_ctx, const u32 pws_cnt); #endif // _STDOUT_H diff --git a/include/thread.h b/include/thread.h index 942222f32..b73796af3 100644 --- a/include/thread.h +++ b/include/thread.h @@ -19,7 +19,7 @@ #if defined (_WIN) #define hc_thread_create(t,f,a) t = CreateThread (NULL, 0, (LPTHREAD_START_ROUTINE) &f, a, 0, NULL) -#define hc_thread_wait(n,a) for (uint i = 0; i < n; i++) WaitForSingleObject ((a)[i], INFINITE) +#define hc_thread_wait(n,a) for (u32 i = 0; i < n; i++) WaitForSingleObject ((a)[i], INFINITE) #define hc_thread_exit(t) ExitThread (t) #define hc_thread_mutex_lock(m) EnterCriticalSection (&m) @@ -30,7 +30,7 @@ #elif defined (_POSIX) #define hc_thread_create(t,f,a) pthread_create (&t, NULL, f, a) -#define hc_thread_wait(n,a) for (uint i = 0; i < n; i++) pthread_join ((a)[i], NULL) +#define hc_thread_wait(n,a) for (u32 i = 0; i < n; i++) pthread_join ((a)[i], NULL) #define hc_thread_exit(t) pthread_exit (&t) #define hc_thread_mutex_lock(m) pthread_mutex_lock (&m) diff --git a/include/types.h b/include/types.h index 3e08ac7ea..9c2df6943 100644 --- a/include/types.h +++ b/include/types.h @@ -37,8 +37,6 @@ typedef uint16_t u16; typedef uint32_t u32; typedef uint64_t u64; -typedef uint32_t uint; // we need to get rid of this sooner or later, for consistency - #include "ext_OpenCL.h" #include "ext_ADL.h" #include "ext_nvapi.h" diff --git a/include/weak_hash.h b/include/weak_hash.h index 8d38c3d7a..aad4a9f3c 100644 --- a/include/weak_hash.h +++ b/include/weak_hash.h @@ -6,6 +6,6 @@ #ifndef _WEAK_HASH_H #define _WEAK_HASH_H -void weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const uint salt_pos); +void weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos); #endif // _WEAK_HASH_H diff --git a/include/wordlist.h b/include/wordlist.h index 5c99fcbab..90624b2d0 100644 --- a/include/wordlist.h +++ b/include/wordlist.h @@ -9,7 +9,7 @@ #include #include -uint convert_from_hex (char *line_buf, const uint line_len, const user_options_t *user_options); +u32 convert_from_hex (char *line_buf, const u32 line_len, const user_options_t *user_options); void load_segment (wl_data_t *wl_data, FILE *fd); @@ -17,7 +17,7 @@ void get_next_word_lm (char *buf, u64 sz, u64 *len, u64 *off); void get_next_word_uc (char *buf, u64 sz, u64 *len, u64 *off); void get_next_word_std (char *buf, u64 sz, u64 *len, u64 *off); -void get_next_word (wl_data_t *wl_data, const user_options_t *user_options, const user_options_extra_t *user_options_extra, FILE *fd, char **out_buf, uint *out_len); +void get_next_word (wl_data_t *wl_data, const user_options_t *user_options, const user_options_extra_t *user_options_extra, FILE *fd, char **out_buf, u32 *out_len); void pw_add (hc_device_param_t *device_param, const u8 *pw_buf, const int pw_len); diff --git a/src/hashes.c b/src/hashes.c index 1d1704c8f..1463226c7 100644 --- a/src/hashes.c +++ b/src/hashes.c @@ -32,10 +32,10 @@ int sort_by_digest_p0p1 (const void *v1, const void *v2, void *v3) hashconfig_t *hashconfig = (hashconfig_t *) v3; - const uint dgst_pos0 = hashconfig->dgst_pos0; - const uint dgst_pos1 = hashconfig->dgst_pos1; - const uint dgst_pos2 = hashconfig->dgst_pos2; - const uint dgst_pos3 = hashconfig->dgst_pos3; + const u32 dgst_pos0 = hashconfig->dgst_pos0; + const u32 dgst_pos1 = hashconfig->dgst_pos1; + const u32 dgst_pos2 = hashconfig->dgst_pos2; + const u32 dgst_pos3 = hashconfig->dgst_pos3; if (d1[dgst_pos3] > d2[dgst_pos3]) return 1; if (d1[dgst_pos3] < d2[dgst_pos3]) return -1; @@ -62,7 +62,7 @@ int sort_by_salt (const void *v1, const void *v2) if (res2 != 0) return (res2); - uint n; + u32 n; n = 16; @@ -140,15 +140,15 @@ void save_hash (const user_options_t *user_options, const hashconfig_t *hashconf exit (-1); } - for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++) + for (u32 salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++) { if (hashes->salts_shown[salt_pos] == 1) continue; salt_t *salt_buf = &hashes->salts_buf[salt_pos]; - for (uint digest_pos = 0; digest_pos < salt_buf->digests_cnt; digest_pos++) + for (u32 digest_pos = 0; digest_pos < salt_buf->digests_cnt; digest_pos++) { - uint idx = salt_buf->digests_offset + digest_pos; + u32 idx = salt_buf->digests_offset + digest_pos; if (hashes->digests_shown[idx] == 1) continue; @@ -158,7 +158,7 @@ void save_hash (const user_options_t *user_options, const hashconfig_t *hashconf { user_t *user = hashes->hash_info[idx]->user; - uint i; + u32 i; for (i = 0; i < user->user_len; i++) fputc (user->user_name[i], fp); @@ -250,7 +250,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl u64 crackpos = device_param->words_off; - uint plain_buf[16] = { 0 }; + u32 plain_buf[16] = { 0 }; u8 *plain_ptr = (u8 *) plain_buf; int plain_len = 0; @@ -268,9 +268,9 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl plain_len = (int) pw.pw_len; - const uint off = device_param->innerloop_pos + il_pos; + const u32 off = device_param->innerloop_pos + il_pos; - const uint debug_mode = debugfile_ctx->mode; + const u32 debug_mode = debugfile_ctx->mode; if (debug_mode > 0) { @@ -346,11 +346,11 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl u64 l_off = device_param->kernel_params_mp_l_buf64[3] + gidvid; u64 r_off = device_param->kernel_params_mp_r_buf64[3] + il_pos; - uint l_start = device_param->kernel_params_mp_l_buf32[5]; - uint r_start = device_param->kernel_params_mp_r_buf32[5]; + u32 l_start = device_param->kernel_params_mp_l_buf32[5]; + u32 r_start = device_param->kernel_params_mp_r_buf32[5]; - uint l_stop = device_param->kernel_params_mp_l_buf32[4]; - uint r_stop = device_param->kernel_params_mp_r_buf32[4]; + u32 l_stop = device_param->kernel_params_mp_l_buf32[4]; + u32 r_stop = device_param->kernel_params_mp_r_buf32[4]; sp_exec (l_off, (char *) plain_ptr + l_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, l_start, l_start + l_stop); sp_exec (r_off, (char *) plain_ptr + r_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, r_start, r_start + r_stop); @@ -376,8 +376,8 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl u64 off = device_param->kernel_params_mp_buf64[3] + il_pos; - uint start = 0; - uint stop = device_param->kernel_params_mp_buf32[4]; + u32 start = 0; + u32 stop = device_param->kernel_params_mp_buf32[4]; sp_exec (off, (char *) plain_ptr + plain_len, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop); @@ -407,8 +407,8 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl u64 off = device_param->kernel_params_mp_buf64[3] + il_pos; - uint start = 0; - uint stop = device_param->kernel_params_mp_buf32[4]; + u32 start = 0; + u32 stop = device_param->kernel_params_mp_buf32[4]; memmove (plain_ptr + stop, plain_ptr, plain_len); @@ -498,7 +498,7 @@ void check_hash (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, pl } } -int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const uint salt_pos) +int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos) { cpt_ctx_t *cpt_ctx = hashcat_ctx->cpt_ctx; hashconfig_t *hashconfig = hashcat_ctx->hashconfig; @@ -538,13 +538,13 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, return -1; } - uint cpt_cracked = 0; + u32 cpt_cracked = 0; hc_thread_mutex_lock (status_ctx->mux_display); - for (uint i = 0; i < num_cracked; i++) + for (u32 i = 0; i < num_cracked; i++) { - const uint hash_pos = cracked[i].hash_pos; + const u32 hash_pos = cracked[i].hash_pos; if (hashes->digests_shown[hash_pos] == 1) continue; @@ -597,9 +597,9 @@ int check_cracked (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, // otherwise host thinks again and again the hash was cracked // and returns invalid password each time - memset (hashes->digests_shown_tmp, 0, salt_buf->digests_cnt * sizeof (uint)); + memset (hashes->digests_shown_tmp, 0, salt_buf->digests_cnt * sizeof (u32)); - CL_err = hc_clEnqueueWriteBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_digests_shown, CL_TRUE, salt_buf->digests_offset * sizeof (uint), salt_buf->digests_cnt * sizeof (uint), &hashes->digests_shown_tmp[salt_buf->digests_offset], 0, NULL, NULL); + CL_err = hc_clEnqueueWriteBuffer (opencl_ctx->ocl, device_param->command_queue, device_param->d_digests_shown, CL_TRUE, salt_buf->digests_offset * sizeof (u32), salt_buf->digests_cnt * sizeof (u32), &hashes->digests_shown_tmp[salt_buf->digests_offset], 0, NULL, NULL); if (CL_err != CL_SUCCESS) { @@ -630,10 +630,10 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil * load hashes, part I: find input mode, count hashes */ - uint hashlist_mode = 0; - uint hashlist_format = HLFMT_HASHCAT; + u32 hashlist_mode = 0; + u32 hashlist_format = HLFMT_HASHCAT; - uint hashes_avail = 0; + u32 hashes_avail = 0; if ((user_options->benchmark == false) && (user_options->stdout_flag == false)) { @@ -779,7 +779,7 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil salts_buf = (salt_t *) mycalloc (1, sizeof (salt_t)); } - for (uint hash_pos = 0; hash_pos < hashes_avail; hash_pos++) + for (u32 hash_pos = 0; hash_pos < hashes_avail; hash_pos++) { hashes_buf[hash_pos].digest = ((char *) digests_buf) + (hash_pos * hashconfig->dgst_size); @@ -807,7 +807,7 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil * load hashes, part III: parse hashes or generate them if benchmark */ - uint hashes_cnt = 0; + u32 hashes_cnt = 0; if (user_options->benchmark == true) { @@ -836,7 +836,7 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil { char *input_buf = hash_or_file; - uint input_len = strlen (input_buf); + u32 input_len = strlen (input_buf); char *hash_buf = NULL; int hash_len = 0; @@ -899,7 +899,7 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil return -1; } - uint hccap_size = sizeof (hccap_t); + u32 hccap_size = sizeof (hccap_t); char *in = (char *) mymalloc (hccap_size); @@ -1070,7 +1070,7 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil return -1; } - uint line_num = 0; + u32 line_num = 0; char *line_buf = (char *) mymalloc (HCBUFSIZ_LARGE); @@ -1242,7 +1242,7 @@ int hashes_init_stage1 (hashes_t *hashes, const hashconfig_t *hashconfig, potfil int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_options_t *user_options, status_ctx_t *status_ctx) { hash_t *hashes_buf = hashes->hashes_buf; - uint hashes_cnt = hashes->hashes_cnt; + u32 hashes_cnt = hashes->hashes_cnt; /** * Remove duplicates @@ -1252,7 +1252,7 @@ int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_o hashes_cnt = 1; - for (uint hashes_pos = 1; hashes_pos < hashes->hashes_cnt; hashes_pos++) + for (u32 hashes_pos = 1; hashes_pos < hashes->hashes_cnt; hashes_pos++) { if (hashconfig->is_salted) { @@ -1300,14 +1300,14 @@ int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_o if (user_options->quiet == false) log_info_nn ("Structuring salts for cracking task..."); - uint digests_cnt = hashes_cnt; - uint digests_done = 0; + u32 digests_cnt = hashes_cnt; + u32 digests_done = 0; - uint *digests_shown = (uint *) mycalloc (digests_cnt, sizeof (uint)); - uint *digests_shown_tmp = (uint *) mycalloc (digests_cnt, sizeof (uint)); + u32 *digests_shown = (u32 *) mycalloc (digests_cnt, sizeof (u32)); + u32 *digests_shown_tmp = (u32 *) mycalloc (digests_cnt, sizeof (u32)); - uint salts_cnt = 0; - uint salts_done = 0; + u32 salts_cnt = 0; + u32 salts_done = 0; hashinfo_t **hash_info = NULL; @@ -1317,7 +1317,7 @@ int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_o if (user_options->username && (user_options->remove || user_options->show)) { - uint user_pos; + u32 user_pos; for (user_pos = 0; user_pos < hashes_cnt; user_pos++) { @@ -1328,7 +1328,7 @@ int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_o } } - uint *salts_shown = (uint *) mycalloc (digests_cnt, sizeof (uint)); + u32 *salts_shown = (u32 *) mycalloc (digests_cnt, sizeof (u32)); salt_t *salt_buf; @@ -1371,7 +1371,7 @@ int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_o // copy from inner loop - for (uint hashes_pos = 1; hashes_pos < hashes_cnt; hashes_pos++) + for (u32 hashes_pos = 1; hashes_pos < hashes_cnt; hashes_pos++) { if (hashconfig->is_salted) { @@ -1413,7 +1413,7 @@ int hashes_init_stage2 (hashes_t *hashes, const hashconfig_t *hashconfig, user_o } } - for (uint salt_pos = 0; salt_pos < salts_cnt; salt_pos++) + for (u32 salt_pos = 0; salt_pos < salts_cnt; salt_pos++) { salt_t *salt_buf = &salts_buf_new[salt_pos]; diff --git a/src/hlfmt.c b/src/hlfmt.c index 290ccae7d..7b91bef1b 100644 --- a/src/hlfmt.c +++ b/src/hlfmt.c @@ -285,7 +285,7 @@ static void hlfmt_user_shadow (char *line_buf, int line_len, char **userbuf_pos, // hlfmt main -char *strhlfmt (const uint hashfile_format) +char *strhlfmt (const u32 hashfile_format) { switch (hashfile_format) { @@ -304,7 +304,7 @@ char *strhlfmt (const uint hashfile_format) return ((char *) "Unknown"); } -void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, const hashconfig_t *hashconfig, const user_options_t *user_options) +void hlfmt_hash (u32 hashfile_format, char *line_buf, int line_len, char **hashbuf_pos, int *hashbuf_len, const hashconfig_t *hashconfig, const user_options_t *user_options) { switch (hashfile_format) { @@ -315,7 +315,7 @@ void hlfmt_hash (uint hashfile_format, char *line_buf, int line_len, char **hash } } -void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, const hashconfig_t *hashconfig) +void hlfmt_user (u32 hashfile_format, char *line_buf, int line_len, char **userbuf_pos, int *userbuf_len, const hashconfig_t *hashconfig) { switch (hashfile_format) { @@ -326,16 +326,16 @@ void hlfmt_user (uint hashfile_format, char *line_buf, int line_len, char **user } } -uint hlfmt_detect (FILE *fp, uint max_check, const hashconfig_t *hashconfig) +u32 hlfmt_detect (FILE *fp, u32 max_check, const hashconfig_t *hashconfig) { // Exception: those formats are wrongly detected as HLFMT_SHADOW, prevent it if (hashconfig->hash_mode == 5300) return HLFMT_HASHCAT; if (hashconfig->hash_mode == 5400) return HLFMT_HASHCAT; - uint *formats_cnt = (uint *) mycalloc (HLFMTS_CNT, sizeof (uint)); + u32 *formats_cnt = (u32 *) mycalloc (HLFMTS_CNT, sizeof (u32)); - uint num_check = 0; + u32 num_check = 0; char *line_buf = (char *) mymalloc (HCBUFSIZ_LARGE); diff --git a/src/hwmon.c b/src/hwmon.c index 66bdf32b8..21a57d14b 100644 --- a/src/hwmon.c +++ b/src/hwmon.c @@ -54,7 +54,7 @@ static int hm_get_adapter_index_nvml (const hwmon_ctx_t *hwmon_ctx, HM_ADAPTER_N { int pGpuCount = 0; - for (uint i = 0; i < DEVICES_MAX; i++) + for (u32 i = 0; i < DEVICES_MAX; i++) { if (hm_NVML_nvmlDeviceGetHandleByIndex (hwmon_ctx->hm_nvml, 1, i, &nvmlGPUHandle[i]) != NVML_SUCCESS) break; @@ -99,7 +99,7 @@ static void hm_sort_adl_adapters_by_busid_devid (u32 *valid_adl_device_list, int u32 bus_num_y = info_y.iBusNumber; u32 dev_num_y = info_y.iDeviceNumber; - uint need_swap = 0; + u32 need_swap = 0; if (bus_num_y < bus_num_x) { @@ -312,7 +312,7 @@ static int hm_get_adapter_index_adl (hm_attrs_t *hm_device, u32 *valid_adl_devic return num_adl_adapters; } -int hm_get_threshold_slowdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_threshold_slowdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -352,7 +352,7 @@ int hm_get_threshold_slowdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, cons return -1; } -int hm_get_threshold_shutdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_threshold_shutdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -385,7 +385,7 @@ int hm_get_threshold_shutdown_with_device_id (const hwmon_ctx_t *hwmon_ctx, cons return -1; } -int hm_get_temperature_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_temperature_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -420,7 +420,7 @@ int hm_get_temperature_with_device_id (const hwmon_ctx_t *hwmon_ctx, const openc { int temperature = 0; - if (hm_NVML_nvmlDeviceGetTemperature (hwmon_ctx->hm_nvml, 1, hwmon_ctx->hm_device[device_id].nvml, NVML_TEMPERATURE_GPU, (uint *) &temperature) != NVML_SUCCESS) return -1; + if (hm_NVML_nvmlDeviceGetTemperature (hwmon_ctx->hm_nvml, 1, hwmon_ctx->hm_device[device_id].nvml, NVML_TEMPERATURE_GPU, (u32 *) &temperature) != NVML_SUCCESS) return -1; return temperature; } @@ -428,7 +428,7 @@ int hm_get_temperature_with_device_id (const hwmon_ctx_t *hwmon_ctx, const openc return -1; } -int hm_get_fanpolicy_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_fanpolicy_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -469,7 +469,7 @@ int hm_get_fanpolicy_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ return -1; } -int hm_get_fanspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_fanspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -512,7 +512,7 @@ int hm_get_fanspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_c { int speed = 0; - if (hm_NVML_nvmlDeviceGetFanSpeed (hwmon_ctx->hm_nvml, 0, hwmon_ctx->hm_device[device_id].nvml, (uint *) &speed) != NVML_SUCCESS) return -1; + if (hm_NVML_nvmlDeviceGetFanSpeed (hwmon_ctx->hm_nvml, 0, hwmon_ctx->hm_device[device_id].nvml, (u32 *) &speed) != NVML_SUCCESS) return -1; return speed; } @@ -521,7 +521,7 @@ int hm_get_fanspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_c return -1; } -int hm_get_buslanes_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_buslanes_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -553,7 +553,7 @@ int hm_get_buslanes_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_c return -1; } -int hm_get_utilization_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_utilization_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -585,7 +585,7 @@ int hm_get_utilization_with_device_id (const hwmon_ctx_t *hwmon_ctx, const openc return -1; } -int hm_get_memoryspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_memoryspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -617,7 +617,7 @@ int hm_get_memoryspeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const openc return -1; } -int hm_get_corespeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_corespeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -649,7 +649,7 @@ int hm_get_corespeed_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ return -1; } -int hm_get_throttle_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const uint device_id) +int hm_get_throttle_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_ctx_t *opencl_ctx, const u32 device_id) { if (hwmon_ctx->enabled == false) return -1; @@ -684,7 +684,7 @@ int hm_get_throttle_with_device_id (const hwmon_ctx_t *hwmon_ctx, const opencl_c return -1; } -int hm_set_fanspeed_with_device_id_adl (const hwmon_ctx_t *hwmon_ctx, const uint device_id, const int fanspeed, const int fanpolicy) +int hm_set_fanspeed_with_device_id_adl (const hwmon_ctx_t *hwmon_ctx, const u32 device_id, const int fanspeed, const int fanpolicy) { if (hwmon_ctx->enabled == false) return -1; @@ -744,7 +744,7 @@ int hm_set_fanspeed_with_device_id_adl (const hwmon_ctx_t *hwmon_ctx, const uint return -1; } -int hm_set_fanspeed_with_device_id_nvapi (const hwmon_ctx_t *hwmon_ctx, const uint device_id, const int fanspeed, const int fanpolicy) +int hm_set_fanspeed_with_device_id_nvapi (const hwmon_ctx_t *hwmon_ctx, const u32 device_id, const int fanspeed, const int fanpolicy) { if (hwmon_ctx->enabled == false) return -1; @@ -779,7 +779,7 @@ int hm_set_fanspeed_with_device_id_nvapi (const hwmon_ctx_t *hwmon_ctx, const ui return -1; } -int hm_set_fanspeed_with_device_id_xnvctrl (const hwmon_ctx_t *hwmon_ctx, const uint device_id, const int fanspeed) +int hm_set_fanspeed_with_device_id_xnvctrl (const hwmon_ctx_t *hwmon_ctx, const u32 device_id, const int fanspeed) { if (hwmon_ctx->enabled == false) return -1; @@ -898,7 +898,7 @@ int hwmon_ctx_init (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, { if (hm_XNVCTRL_XOpenDisplay (hwmon_ctx->hm_xnvctrl) == 0) { - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -980,7 +980,7 @@ int hwmon_ctx_init (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, * HM devices: copy */ - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -988,7 +988,7 @@ int hwmon_ctx_init (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, if ((device_param->device_type & CL_DEVICE_TYPE_GPU) == 0) continue; - const uint platform_devices_id = device_param->platform_devices_id; + const u32 platform_devices_id = device_param->platform_devices_id; if (device_param->device_vendor_id == VENDOR_ID_AMD) { @@ -1022,7 +1022,7 @@ int hwmon_ctx_init (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, * powertune on user request */ - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -1210,7 +1210,7 @@ int hwmon_ctx_init (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_options, if (user_options->gpu_temp_retain) { - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -1275,7 +1275,7 @@ void hwmon_ctx_destroy (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_optio if (user_options->gpu_temp_retain) { - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -1307,7 +1307,7 @@ void hwmon_ctx_destroy (hwmon_ctx_t *hwmon_ctx, const user_options_t *user_optio // reset power tuning - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; diff --git a/src/interface.c b/src/interface.c index 90ae7a352..fe6cbce82 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1999,7 +1999,7 @@ static void drupal7_encode (u8 digest[64], u8 buf[43]) * parser */ -static uint parse_and_store_salt (char *out, char *in, uint salt_len, const hashconfig_t *hashconfig) +static u32 parse_and_store_salt (char *out, char *in, u32 salt_len, const hashconfig_t *hashconfig) { u8 tmp[256] = { 0 }; @@ -2016,7 +2016,7 @@ static uint parse_and_store_salt (char *out, char *in, uint salt_len, const hash { u32 new_salt_len = salt_len / 2; - for (uint i = 0, j = 0; i < new_salt_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < new_salt_len; i += 1, j += 2) { u8 p0 = tmp[j + 0]; u8 p1 = tmp[j + 1]; @@ -2043,18 +2043,18 @@ static uint parse_and_store_salt (char *out, char *in, uint salt_len, const hash { if (salt_len < 20) { - u32 *tmp_uint = (u32 *) tmp; + u32 *tmp_u32 = (u32 *) tmp; - tmp_uint[9] = ((tmp_uint[4] >> 8) & 0x00FF0000) | ((tmp_uint[4] >> 16) & 0x000000FF); - tmp_uint[8] = ((tmp_uint[4] << 8) & 0x00FF0000) | ((tmp_uint[4] >> 0) & 0x000000FF); - tmp_uint[7] = ((tmp_uint[3] >> 8) & 0x00FF0000) | ((tmp_uint[3] >> 16) & 0x000000FF); - tmp_uint[6] = ((tmp_uint[3] << 8) & 0x00FF0000) | ((tmp_uint[3] >> 0) & 0x000000FF); - tmp_uint[5] = ((tmp_uint[2] >> 8) & 0x00FF0000) | ((tmp_uint[2] >> 16) & 0x000000FF); - tmp_uint[4] = ((tmp_uint[2] << 8) & 0x00FF0000) | ((tmp_uint[2] >> 0) & 0x000000FF); - tmp_uint[3] = ((tmp_uint[1] >> 8) & 0x00FF0000) | ((tmp_uint[1] >> 16) & 0x000000FF); - tmp_uint[2] = ((tmp_uint[1] << 8) & 0x00FF0000) | ((tmp_uint[1] >> 0) & 0x000000FF); - tmp_uint[1] = ((tmp_uint[0] >> 8) & 0x00FF0000) | ((tmp_uint[0] >> 16) & 0x000000FF); - tmp_uint[0] = ((tmp_uint[0] << 8) & 0x00FF0000) | ((tmp_uint[0] >> 0) & 0x000000FF); + tmp_u32[9] = ((tmp_u32[4] >> 8) & 0x00FF0000) | ((tmp_u32[4] >> 16) & 0x000000FF); + tmp_u32[8] = ((tmp_u32[4] << 8) & 0x00FF0000) | ((tmp_u32[4] >> 0) & 0x000000FF); + tmp_u32[7] = ((tmp_u32[3] >> 8) & 0x00FF0000) | ((tmp_u32[3] >> 16) & 0x000000FF); + tmp_u32[6] = ((tmp_u32[3] << 8) & 0x00FF0000) | ((tmp_u32[3] >> 0) & 0x000000FF); + tmp_u32[5] = ((tmp_u32[2] >> 8) & 0x00FF0000) | ((tmp_u32[2] >> 16) & 0x000000FF); + tmp_u32[4] = ((tmp_u32[2] << 8) & 0x00FF0000) | ((tmp_u32[2] >> 0) & 0x000000FF); + tmp_u32[3] = ((tmp_u32[1] >> 8) & 0x00FF0000) | ((tmp_u32[1] >> 16) & 0x000000FF); + tmp_u32[2] = ((tmp_u32[1] << 8) & 0x00FF0000) | ((tmp_u32[1] >> 0) & 0x000000FF); + tmp_u32[1] = ((tmp_u32[0] >> 8) & 0x00FF0000) | ((tmp_u32[0] >> 16) & 0x000000FF); + tmp_u32[0] = ((tmp_u32[0] << 8) & 0x00FF0000) | ((tmp_u32[0] >> 0) & 0x000000FF); salt_len = salt_len * 2; } @@ -2088,7 +2088,7 @@ static uint parse_and_store_salt (char *out, char *in, uint salt_len, const hash if (hashconfig->opts_type & OPTS_TYPE_ST_GENERATE_LE) { - u32 *tmp_uint = (uint *) tmp; + u32 *tmp_u32 = (u32 *) tmp; u32 max = len / 4; @@ -2096,7 +2096,7 @@ static uint parse_and_store_salt (char *out, char *in, uint salt_len, const hash for (u32 i = 0; i < max; i++) { - tmp_uint[i] = byte_swap_32 (tmp_uint[i]); + tmp_u32[i] = byte_swap_32 (tmp_u32[i]); } // Important: we may need to increase the length of memcpy since @@ -2117,7 +2117,7 @@ static uint parse_and_store_salt (char *out, char *in, uint salt_len, const hash #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" -int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int bcrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3200) || (input_len > DISPLAY_LEN_MAX_3200)) return (PARSER_GLOBAL_LENGTH); @@ -2139,7 +2139,7 @@ int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const salt_pos++; - uint salt_len = 16; + u32 salt_len = 16; salt->salt_len = salt_len; @@ -2176,7 +2176,7 @@ int bcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int cisco4_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5700) || (input_len > DISPLAY_LEN_MAX_5700)) return (PARSER_GLOBAL_LENGTH); @@ -2209,7 +2209,7 @@ int cisco4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int lm_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3000) || (input_len > DISPLAY_LEN_MAX_3000)) return (PARSER_GLOBAL_LENGTH); @@ -2221,7 +2221,7 @@ int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hash digest[0] = byte_swap_32 (digest[0]); digest[1] = byte_swap_32 (digest[1]); - uint tt; + u32 tt; IP (digest[0], digest[1], tt); @@ -2233,7 +2233,7 @@ int lm_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hash return (PARSER_OK); } -int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int arubaos_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_125) || (input_len > DISPLAY_LEN_MAX_125)) return (PARSER_GLOBAL_LENGTH); @@ -2257,7 +2257,7 @@ int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const digest[3] -= SHA1M_D; digest[4] -= SHA1M_E; - uint salt_len = 10; + u32 salt_len = 10; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -2270,7 +2270,7 @@ int arubaos_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int osx1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_122) || (input_len > DISPLAY_LEN_MAX_122)) return (PARSER_GLOBAL_LENGTH); @@ -2292,7 +2292,7 @@ int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha digest[3] -= SHA1M_D; digest[4] -= SHA1M_E; - uint salt_len = 8; + u32 salt_len = 8; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -2305,7 +2305,7 @@ int osx1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int osx512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1722) || (input_len > DISPLAY_LEN_MAX_1722)) return (PARSER_GLOBAL_LENGTH); @@ -2333,7 +2333,7 @@ int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const digest[6] -= SHA512M_G; digest[7] -= SHA512M_H; - uint salt_len = 8; + u32 salt_len = 8; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -2346,7 +2346,7 @@ int osx512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int osc_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -2378,7 +2378,7 @@ int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -2393,7 +2393,7 @@ int osc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int netscreen_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -2487,7 +2487,7 @@ int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (input_buf[30] != ':') return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 30 - 1; + u32 salt_len = input_len - 30 - 1; char *salt_buf = input_buf + 30 + 1; @@ -2509,7 +2509,7 @@ int netscreen_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int smf_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -2538,7 +2538,7 @@ int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -2553,7 +2553,7 @@ int smf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int dcc2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -2570,7 +2570,7 @@ int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha salt_t *salt = hash_buf->salt; - uint iter = atoi (iter_pos); + u32 iter = atoi (iter_pos); if (iter < 1) { @@ -2591,7 +2591,7 @@ int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha digest_pos++; - uint salt_len = digest_pos - salt_pos - 1; + u32 salt_len = digest_pos - salt_pos - 1; u32 *digest = (u32 *) hash_buf->digest; @@ -2611,7 +2611,7 @@ int dcc2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int wpa_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -2636,7 +2636,7 @@ int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has Wireless Device Nonce (referred to as Supplicant Nonce Snonce) */ - uint salt_len = strlen (in.essid); + u32 salt_len = strlen (in.essid); if (salt_len > 36) { @@ -2727,12 +2727,12 @@ int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has } } - uint32_t *p0 = (uint32_t *) in.essid; - uint32_t c0 = 0; - uint32_t c1 = 0; + u32 *p0 = (u32 *) in.essid; + u32 c0 = 0; + u32 c1 = 0; - for (uint i = 0; i < sizeof (in.essid) / sizeof (uint32_t); i++) c0 ^= *p0++; - for (uint i = 0; i < sizeof (wpa->pke) / sizeof (wpa->pke[0]); i++) c1 ^= wpa->pke[i]; + for (u32 i = 0; i < sizeof (in.essid) / sizeof (u32); i++) c0 ^= *p0++; + for (u32 i = 0; i < sizeof (wpa->pke) / sizeof (wpa->pke[0]); i++) c1 ^= wpa->pke[i]; salt->salt_buf[10] = c0; salt->salt_buf[11] = c1; @@ -2740,7 +2740,7 @@ int wpa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int psafe2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -2787,7 +2787,7 @@ int psafe2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int psafe3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -2853,7 +2853,7 @@ int psafe3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int phpass_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_400) || (input_len > DISPLAY_LEN_MAX_400)) return (PARSER_GLOBAL_LENGTH); @@ -2865,7 +2865,7 @@ int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *iter_pos = input_buf + 3; - uint salt_iter = 1u << itoa64_to_int (iter_pos[0]); + u32 salt_iter = 1u << itoa64_to_int (iter_pos[0]); if (salt_iter > 0x80000000) return (PARSER_SALT_ITERATION); @@ -2875,7 +2875,7 @@ int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *salt_pos = iter_pos + 1; - uint salt_len = 8; + u32 salt_len = 8; memcpy ((char *) salt->salt_buf, salt_pos, salt_len); @@ -2888,7 +2888,7 @@ int phpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5crypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (input_len < DISPLAY_LEN_MIN_500) return (PARSER_GLOBAL_LENGTH); @@ -2900,7 +2900,7 @@ int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons char *salt_pos = input_buf + 3; - uint iterations_len = 0; + u32 iterations_len = 0; if (memcmp (salt_pos, "rounds=", 7) == 0) { @@ -2930,7 +2930,7 @@ int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len > 8) return (PARSER_SALT_LENGTH); @@ -2940,7 +2940,7 @@ int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons hash_pos++; - uint hash_len = input_len - 3 - iterations_len - salt_len - 1; + u32 hash_len = input_len - 3 - iterations_len - salt_len - 1; if (hash_len != 22) return (PARSER_HASH_LENGTH); @@ -2949,7 +2949,7 @@ int md5crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5apr1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_MD5APR1, input_buf, 6)) return (PARSER_SIGNATURE_UNMATCHED); @@ -2959,7 +2959,7 @@ int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *salt_pos = input_buf + 6; - uint iterations_len = 0; + u32 iterations_len = 0; if (memcmp (salt_pos, "rounds=", 7) == 0) { @@ -2989,7 +2989,7 @@ int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len > 8) return (PARSER_SALT_LENGTH); @@ -3004,7 +3004,7 @@ int md5apr1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int episerver_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_141) || (input_len > DISPLAY_LEN_MAX_141)) return (PARSER_GLOBAL_LENGTH); @@ -3022,7 +3022,7 @@ int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con hash_pos++; - uint salt_len = hash_pos - salt_pos - 1; + u32 salt_len = hash_pos - salt_pos - 1; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -3053,7 +3053,7 @@ int episerver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int descrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1500) || (input_len > DISPLAY_LEN_MAX_1500)) return (PARSER_GLOBAL_LENGTH); @@ -3080,7 +3080,7 @@ int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons memcpy (digest, tmp_buf, 8); - uint tt; + u32 tt; IP (digest[0], digest[1], tt); @@ -3090,7 +3090,7 @@ int descrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md4_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_900) || (input_len > DISPLAY_LEN_MAX_900)) return (PARSER_GLOBAL_LENGTH); @@ -3114,7 +3114,7 @@ int md4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md4s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3146,7 +3146,7 @@ int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -3161,7 +3161,7 @@ int md4s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_0) || (input_len > DISPLAY_LEN_MAX_0)) return (PARSER_GLOBAL_LENGTH); @@ -3185,7 +3185,7 @@ int md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5half_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5100) || (input_len > DISPLAY_LEN_MAX_5100)) return (PARSER_GLOBAL_LENGTH); @@ -3202,7 +3202,7 @@ int md5half_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3234,7 +3234,7 @@ int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -3249,7 +3249,7 @@ int md5s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5pix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2400) || (input_len > DISPLAY_LEN_MAX_2400)) return (PARSER_GLOBAL_LENGTH); @@ -3285,7 +3285,7 @@ int md5pix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5asa_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3329,7 +3329,7 @@ int md5asa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[16] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 16 - 1; + u32 salt_len = input_len - 16 - 1; char *salt_buf = input_buf + 16 + 1; @@ -3365,7 +3365,7 @@ static void transform_netntlmv1_key (const u8 *nthash, u8 *key) key[7] |= 0x01; } -int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int netntlmv1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5500) || (input_len > DISPLAY_LEN_MAX_5500)) return (PARSER_GLOBAL_LENGTH); @@ -3385,7 +3385,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (unused_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint user_len = unused_pos - user_pos; + u32 user_len = unused_pos - user_pos; if (user_len > 60) return (PARSER_SALT_LENGTH); @@ -3395,7 +3395,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (domain_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint unused_len = domain_pos - unused_pos; + u32 unused_len = domain_pos - unused_pos; if (unused_len != 0) return (PARSER_SALT_LENGTH); @@ -3405,7 +3405,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (srvchall_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint domain_len = srvchall_pos - domain_pos; + u32 domain_len = srvchall_pos - domain_pos; if (domain_len > 45) return (PARSER_SALT_LENGTH); @@ -3415,7 +3415,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint srvchall_len = hash_pos - srvchall_pos; + u32 srvchall_len = hash_pos - srvchall_pos; // if (srvchall_len != 0) return (PARSER_SALT_LENGTH); @@ -3425,13 +3425,13 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (clichall_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint hash_len = clichall_pos - hash_pos; + u32 hash_len = clichall_pos - hash_pos; if (hash_len != 48) return (PARSER_HASH_LENGTH); clichall_pos++; - uint clichall_len = input_len - user_len - 1 - unused_len - 1 - domain_len - 1 - srvchall_len - 1 - hash_len - 1; + u32 clichall_len = input_len - user_len - 1 - unused_len - 1 - domain_len - 1 - srvchall_len - 1 - hash_len - 1; if (clichall_len != 16) return (PARSER_SALT_LENGTH); @@ -3451,13 +3451,13 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * handle username and domainname */ - for (uint i = 0; i < user_len; i++) + for (u32 i = 0; i < user_len; i++) { *userdomain_ptr++ = user_pos[i]; *userdomain_ptr++ = 0; } - for (uint i = 0; i < domain_len; i++) + for (u32 i = 0; i < domain_len; i++) { *userdomain_ptr++ = domain_pos[i]; *userdomain_ptr++ = 0; @@ -3467,7 +3467,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * handle server challenge encoding */ - for (uint i = 0; i < srvchall_len; i += 2) + for (u32 i = 0; i < srvchall_len; i += 2) { const char p0 = srvchall_pos[i + 0]; const char p1 = srvchall_pos[i + 1]; @@ -3480,7 +3480,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * handle client challenge encoding */ - for (uint i = 0; i < clichall_len; i += 2) + for (u32 i = 0; i < clichall_len; i += 2) { const char p0 = clichall_pos[i + 0]; const char p1 = clichall_pos[i + 1]; @@ -3495,7 +3495,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con char *salt_buf_ptr = (char *) salt->salt_buf; - uint salt_len = parse_and_store_salt (salt_buf_ptr, clichall_pos, clichall_len, hashconfig); + u32 salt_len = parse_and_store_salt (salt_buf_ptr, clichall_pos, clichall_len, hashconfig); if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH); @@ -3513,7 +3513,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con /* special case, last 8 byte do not need to be checked since they are brute-forced next */ - uint digest_tmp[2] = { 0 }; + u32 digest_tmp[2] = { 0 }; digest_tmp[0] = hex_to_u32 ((const u8 *) &hash_pos[32]); digest_tmp[1] = hex_to_u32 ((const u8 *) &hash_pos[40]); @@ -3527,7 +3527,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con { if ((netntlm->chall_buf[2] == 0) && (netntlm->chall_buf[3] == 0) && (netntlm->chall_buf[4] == 0) && (netntlm->chall_buf[5] == 0)) { - uint w[16] = { 0 }; + u32 w[16] = { 0 }; w[ 0] = netntlm->chall_buf[6]; w[ 1] = netntlm->chall_buf[7]; @@ -3536,7 +3536,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con w[ 4] = 0x80; w[14] = 16 * 8; - uint dgst[4] = { 0 }; + u32 dgst[4] = { 0 }; dgst[0] = MD5M_A; dgst[1] = MD5M_B; @@ -3552,19 +3552,19 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con /* precompute netntlmv1 exploit start */ - for (uint i = 0; i < 0x10000; i++) + for (u32 i = 0; i < 0x10000; i++) { - uint key_md4[2] = { i, 0 }; - uint key_des[2] = { 0, 0 }; + u32 key_md4[2] = { i, 0 }; + u32 key_des[2] = { 0, 0 }; transform_netntlmv1_key ((u8 *) key_md4, (u8 *) key_des); - uint Kc[16] = { 0 }; - uint Kd[16] = { 0 }; + u32 Kc[16] = { 0 }; + u32 Kd[16] = { 0 }; _des_keysetup (key_des, Kc, Kd); - uint data3[2] = { salt->salt_buf[0], salt->salt_buf[1] }; + u32 data3[2] = { salt->salt_buf[0], salt->salt_buf[1] }; _des_encrypt (data3, Kc, Kd); @@ -3601,7 +3601,7 @@ int netntlmv1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int netntlmv2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5600) || (input_len > DISPLAY_LEN_MAX_5600)) return (PARSER_GLOBAL_LENGTH); @@ -3621,7 +3621,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (unused_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint user_len = unused_pos - user_pos; + u32 user_len = unused_pos - user_pos; if (user_len > 60) return (PARSER_SALT_LENGTH); @@ -3631,7 +3631,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (domain_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint unused_len = domain_pos - unused_pos; + u32 unused_len = domain_pos - unused_pos; if (unused_len != 0) return (PARSER_SALT_LENGTH); @@ -3641,7 +3641,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (srvchall_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint domain_len = srvchall_pos - domain_pos; + u32 domain_len = srvchall_pos - domain_pos; if (domain_len > 45) return (PARSER_SALT_LENGTH); @@ -3651,7 +3651,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint srvchall_len = hash_pos - srvchall_pos; + u32 srvchall_len = hash_pos - srvchall_pos; if (srvchall_len != 16) return (PARSER_SALT_LENGTH); @@ -3661,13 +3661,13 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (clichall_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint hash_len = clichall_pos - hash_pos; + u32 hash_len = clichall_pos - hash_pos; if (hash_len != 32) return (PARSER_HASH_LENGTH); clichall_pos++; - uint clichall_len = input_len - user_len - 1 - unused_len - 1 - domain_len - 1 - srvchall_len - 1 - hash_len - 1; + u32 clichall_len = input_len - user_len - 1 - unused_len - 1 - domain_len - 1 - srvchall_len - 1 - hash_len - 1; if (clichall_len > 1024) return (PARSER_SALT_LENGTH); @@ -3689,13 +3689,13 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * handle username and domainname */ - for (uint i = 0; i < user_len; i++) + for (u32 i = 0; i < user_len; i++) { *userdomain_ptr++ = toupper (user_pos[i]); *userdomain_ptr++ = 0; } - for (uint i = 0; i < domain_len; i++) + for (u32 i = 0; i < domain_len; i++) { *userdomain_ptr++ = domain_pos[i]; *userdomain_ptr++ = 0; @@ -3707,7 +3707,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * handle server challenge encoding */ - for (uint i = 0; i < srvchall_len; i += 2) + for (u32 i = 0; i < srvchall_len; i += 2) { const char p0 = srvchall_pos[i + 0]; const char p1 = srvchall_pos[i + 1]; @@ -3720,7 +3720,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * handle client challenge encoding */ - for (uint i = 0; i < clichall_len; i += 2) + for (u32 i = 0; i < clichall_len; i += 2) { const char p0 = clichall_pos[i + 0]; const char p1 = clichall_pos[i + 1]; @@ -3758,18 +3758,18 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con salt->salt_buf[6] = 0; salt->salt_buf[7] = 0; - uint *uptr; + u32 *uptr; - uptr = (uint *) netntlm->userdomain_buf; + uptr = (u32 *) netntlm->userdomain_buf; - for (uint i = 0; i < 16; i += 16) + for (u32 i = 0; i < 16; i += 16) { md5_64 (uptr, salt->salt_buf); } - uptr = (uint *) netntlm->chall_buf; + uptr = (u32 *) netntlm->chall_buf; - for (uint i = 0; i < 256; i += 16) + for (u32 i = 0; i < 256; i += 16) { md5_64 (uptr, salt->salt_buf); } @@ -3779,7 +3779,7 @@ int netntlmv2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int joomla_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3811,7 +3811,7 @@ int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -3826,7 +3826,7 @@ int joomla_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int postgresql_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3858,7 +3858,7 @@ int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -3873,7 +3873,7 @@ int postgresql_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2600) || (input_len > DISPLAY_LEN_MAX_2600)) return (PARSER_GLOBAL_LENGTH); @@ -3904,7 +3904,7 @@ int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *salt_buf_ptr = (char *) salt->salt_buf; - uint salt_len = parse_and_store_salt (salt_buf_ptr, (char *) "", 0, hashconfig); + u32 salt_len = parse_and_store_salt (salt_buf_ptr, (char *) "", 0, hashconfig); if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH); @@ -3913,7 +3913,7 @@ int md5md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int vb3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3945,7 +3945,7 @@ int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -3960,7 +3960,7 @@ int vb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int vb30_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -3987,7 +3987,7 @@ int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -4002,7 +4002,7 @@ int vb30_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int dcc_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4034,7 +4034,7 @@ int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -4049,7 +4049,7 @@ int dcc_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int ipb2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4076,11 +4076,11 @@ int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; - uint salt_pc_block[16] = { 0 }; + u32 salt_pc_block[16] = { 0 }; char *salt_pc_block_ptr = (char *) salt_pc_block; @@ -4092,7 +4092,7 @@ int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha salt_pc_block[14] = salt_len * 8; - uint salt_pc_digest[4] = { MD5M_A, MD5M_B, MD5M_C, MD5M_D }; + u32 salt_pc_digest[4] = { MD5M_A, MD5M_B, MD5M_C, MD5M_D }; md5_64 (salt_pc_block, salt_pc_digest); @@ -4117,7 +4117,7 @@ int ipb2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_100) || (input_len > DISPLAY_LEN_MAX_100)) return (PARSER_GLOBAL_LENGTH); @@ -4138,7 +4138,7 @@ int sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha1axcrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13300) || (input_len > DISPLAY_LEN_MAX_13300)) return (PARSER_GLOBAL_LENGTH); @@ -4157,7 +4157,7 @@ int sha1axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha1s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4186,7 +4186,7 @@ int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -4201,7 +4201,7 @@ int sha1s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h return (PARSER_OK); } -int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pstoken_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13500) || (input_len > DISPLAY_LEN_MAX_13500)) return (PARSER_GLOBAL_LENGTH); @@ -4219,7 +4219,7 @@ int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -4227,7 +4227,7 @@ int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const u8 *pstoken_ptr = (u8 *) pstoken->salt_buf; - for (uint i = 0, j = 0; i < salt_len; i += 2, j += 1) + for (u32 i = 0, j = 0; i < salt_len; i += 2, j += 1) { pstoken_ptr[j] = hex_to_u8 ((const u8 *) &salt_buf[i]); } @@ -4260,7 +4260,7 @@ int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const for (int i = 0; i < (int) pstoken->salt_len - 63; i += 64) { - uint w[16]; + u32 w[16]; w[ 0] = byte_swap_32 (pstoken->salt_buf[pstoken->pc_offset + 0]); w[ 1] = byte_swap_32 (pstoken->salt_buf[pstoken->pc_offset + 1]); @@ -4287,7 +4287,7 @@ int pstoken_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha1b64_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_101) || (input_len > DISPLAY_LEN_MAX_101)) return (PARSER_GLOBAL_LENGTH); @@ -4316,7 +4316,7 @@ int sha1b64_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha1b64s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_111) || (input_len > DISPLAY_LEN_MAX_111)) return (PARSER_GLOBAL_LENGTH); @@ -4364,7 +4364,7 @@ int sha1b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mssql2000_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_131) || (input_len > DISPLAY_LEN_MAX_131)) return (PARSER_GLOBAL_LENGTH); @@ -4376,7 +4376,7 @@ int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con char *salt_buf = input_buf + 6; - uint salt_len = 8; + u32 salt_len = 8; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -4403,7 +4403,7 @@ int mssql2000_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mssql2005_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_132) || (input_len > DISPLAY_LEN_MAX_132)) return (PARSER_GLOBAL_LENGTH); @@ -4415,7 +4415,7 @@ int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con char *salt_buf = input_buf + 6; - uint salt_len = 8; + u32 salt_len = 8; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -4442,7 +4442,7 @@ int mssql2005_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mssql2012_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1731) || (input_len > DISPLAY_LEN_MAX_1731)) return (PARSER_GLOBAL_LENGTH); @@ -4454,7 +4454,7 @@ int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con char *salt_buf = input_buf + 6; - uint salt_len = 8; + u32 salt_len = 8; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -4487,7 +4487,7 @@ int mssql2012_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oracleh_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4512,7 +4512,7 @@ int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[16] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 16 - 1; + u32 salt_len = input_len - 16 - 1; char *salt_buf = input_buf + 16 + 1; @@ -4527,7 +4527,7 @@ int oracleh_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oracles_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_112) || (input_len > DISPLAY_LEN_MAX_112)) return (PARSER_GLOBAL_LENGTH); @@ -4549,7 +4549,7 @@ int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -4564,7 +4564,7 @@ int oracles_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oraclet_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12300) || (input_len > DISPLAY_LEN_MAX_12300)) return (PARSER_GLOBAL_LENGTH); @@ -4604,7 +4604,7 @@ int oraclet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1400) || (input_len > DISPLAY_LEN_MAX_1400)) return (PARSER_GLOBAL_LENGTH); @@ -4631,7 +4631,7 @@ int sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha256s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4666,7 +4666,7 @@ int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[64] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 64 - 1; + u32 salt_len = input_len - 64 - 1; char *salt_buf = input_buf + 64 + 1; @@ -4681,7 +4681,7 @@ int sha256s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha384_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10800) || (input_len > DISPLAY_LEN_MAX_10800)) return (PARSER_GLOBAL_LENGTH); @@ -4708,7 +4708,7 @@ int sha384_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1700) || (input_len > DISPLAY_LEN_MAX_1700)) return (PARSER_GLOBAL_LENGTH); @@ -4735,7 +4735,7 @@ int sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -4770,7 +4770,7 @@ int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[128] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 128 - 1; + u32 salt_len = input_len - 128 - 1; char *salt_buf = input_buf + 128 + 1; @@ -4785,7 +4785,7 @@ int sha512s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512crypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_SHA512CRYPT, input_buf, 3)) return (PARSER_SIGNATURE_UNMATCHED); @@ -4795,7 +4795,7 @@ int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c char *salt_pos = input_buf + 3; - uint iterations_len = 0; + u32 iterations_len = 0; if (memcmp (salt_pos, "rounds=", 7) == 0) { @@ -4825,7 +4825,7 @@ int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len > 16) return (PARSER_SALT_LENGTH); @@ -4840,7 +4840,7 @@ int sha512crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int keccak_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5000) || (input_len > DISPLAY_LEN_MAX_5000)) return (PARSER_GLOBAL_LENGTH); @@ -4850,9 +4850,9 @@ int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const salt_t *salt = hash_buf->salt; - uint keccak_mdlen = input_len / 2; + u32 keccak_mdlen = input_len / 2; - for (uint i = 0; i < keccak_mdlen / 8; i++) + for (u32 i = 0; i < keccak_mdlen / 8; i++) { digest[i] = hex_to_u64 ((const u8 *) &input_buf[i * 16]); @@ -4864,7 +4864,7 @@ int keccak_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int ikepsk_md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5300) || (input_len > DISPLAY_LEN_MAX_5300)) return (PARSER_GLOBAL_LENGTH); @@ -4951,7 +4951,7 @@ int ikepsk_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int ikepsk_sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5400) || (input_len > DISPLAY_LEN_MAX_5400)) return (PARSER_GLOBAL_LENGTH); @@ -5034,7 +5034,7 @@ int ikepsk_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int ripemd160_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6000) || (input_len > DISPLAY_LEN_MAX_6000)) return (PARSER_GLOBAL_LENGTH); @@ -5055,7 +5055,7 @@ int ripemd160_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int whirlpool_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6100) || (input_len > DISPLAY_LEN_MAX_6100)) return (PARSER_GLOBAL_LENGTH); @@ -5081,7 +5081,7 @@ int whirlpool_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int androidpin_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_5800) || (input_len > DISPLAY_LEN_MAX_5800)) return (PARSER_GLOBAL_LENGTH); @@ -5097,7 +5097,7 @@ int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -5114,7 +5114,7 @@ int androidpin_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int truecrypt_parse_hash_1k (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -5163,7 +5163,7 @@ int truecrypt_parse_hash_1k (char *input_buf, uint input_len, hash_t *hash_buf, return (PARSER_OK); } -int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int truecrypt_parse_hash_2k (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -5212,7 +5212,7 @@ int truecrypt_parse_hash_2k (char *input_buf, uint input_len, hash_t *hash_buf, return (PARSER_OK); } -int veracrypt_parse_hash_200000 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int veracrypt_parse_hash_200000 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -5261,7 +5261,7 @@ int veracrypt_parse_hash_200000 (char *input_buf, uint input_len, hash_t *hash_b return (PARSER_OK); } -int veracrypt_parse_hash_500000 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int veracrypt_parse_hash_500000 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -5310,7 +5310,7 @@ int veracrypt_parse_hash_500000 (char *input_buf, uint input_len, hash_t *hash_b return (PARSER_OK); } -int veracrypt_parse_hash_327661 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int veracrypt_parse_hash_327661 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -5359,7 +5359,7 @@ int veracrypt_parse_hash_327661 (char *input_buf, uint input_len, hash_t *hash_b return (PARSER_OK); } -int veracrypt_parse_hash_655331 (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int veracrypt_parse_hash_655331 (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { u32 *digest = (u32 *) hash_buf->digest; @@ -5408,7 +5408,7 @@ int veracrypt_parse_hash_655331 (char *input_buf, uint input_len, hash_t *hash_b return (PARSER_OK); } -int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int md5aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6300) || (input_len > DISPLAY_LEN_MAX_6300)) return (PARSER_GLOBAL_LENGTH); @@ -5424,7 +5424,7 @@ int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len < 8) return (PARSER_SALT_LENGTH); @@ -5441,7 +5441,7 @@ int md5aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha1aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6700) || (input_len > DISPLAY_LEN_MAX_6700)) return (PARSER_GLOBAL_LENGTH); @@ -5463,7 +5463,7 @@ int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len < 16) return (PARSER_SALT_LENGTH); @@ -5490,7 +5490,7 @@ int sha1aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha256aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6400) || (input_len > DISPLAY_LEN_MAX_6400)) return (PARSER_GLOBAL_LENGTH); @@ -5512,7 +5512,7 @@ int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len < 16) return (PARSER_SALT_LENGTH); @@ -5542,7 +5542,7 @@ int sha256aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512aix_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6500) || (input_len > DISPLAY_LEN_MAX_6500)) return (PARSER_GLOBAL_LENGTH); @@ -5564,7 +5564,7 @@ int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len < 16) return (PARSER_SALT_LENGTH); @@ -5594,7 +5594,7 @@ int sha512aix_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int agilekey_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6600) || (input_len > DISPLAY_LEN_MAX_6600)) return (PARSER_GLOBAL_LENGTH); @@ -5614,7 +5614,7 @@ int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (saltbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint iterations_len = saltbuf_pos - iterations_pos; + u32 iterations_len = saltbuf_pos - iterations_pos; if (iterations_len > 6) return (PARSER_SALT_LENGTH); @@ -5624,11 +5624,11 @@ int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (cipherbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint saltbuf_len = cipherbuf_pos - saltbuf_pos; + u32 saltbuf_len = cipherbuf_pos - saltbuf_pos; if (saltbuf_len != 16) return (PARSER_SALT_LENGTH); - uint cipherbuf_len = input_len - iterations_len - 1 - saltbuf_len - 1; + u32 cipherbuf_len = input_len - iterations_len - 1 - saltbuf_len - 1; if (cipherbuf_len != 2080) return (PARSER_HASH_LENGTH); @@ -5646,7 +5646,7 @@ int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons char *saltbuf_ptr = (char *) salt->salt_buf; - for (uint i = 0; i < saltbuf_len; i += 2) + for (u32 i = 0; i < saltbuf_len; i += 2) { const char p0 = saltbuf_pos[i + 0]; const char p1 = saltbuf_pos[i + 1]; @@ -5661,11 +5661,11 @@ int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons * handle cipher encoding */ - uint *tmp = (uint *) mymalloc (32); + u32 *tmp = (u32 *) mymalloc (32); char *cipherbuf_ptr = (char *) tmp; - for (uint i = 2016; i < cipherbuf_len; i += 2) + for (u32 i = 2016; i < cipherbuf_len; i += 2) { const char p0 = cipherbuf_pos[i + 0]; const char p1 = cipherbuf_pos[i + 1]; @@ -5689,7 +5689,7 @@ int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons myfree (tmp); - for (uint i = 0, j = 0; i < 1040; i += 1, j += 2) + for (u32 i = 0, j = 0; i < 1040; i += 1, j += 2) { const char p0 = cipherbuf_pos[j + 0]; const char p1 = cipherbuf_pos[j + 1]; @@ -5710,7 +5710,7 @@ int agilekey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int lastpass_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6800) || (input_len > DISPLAY_LEN_MAX_6800)) return (PARSER_GLOBAL_LENGTH); @@ -5724,7 +5724,7 @@ int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (iterations_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint hash_len = iterations_pos - hashbuf_pos; + u32 hash_len = iterations_pos - hashbuf_pos; if ((hash_len != 32) && (hash_len != 64)) return (PARSER_HASH_LENGTH); @@ -5734,11 +5734,11 @@ int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (saltbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint iterations_len = saltbuf_pos - iterations_pos; + u32 iterations_len = saltbuf_pos - iterations_pos; saltbuf_pos++; - uint salt_len = input_len - hash_len - 1 - iterations_len - 1; + u32 salt_len = input_len - hash_len - 1 - iterations_len - 1; if (salt_len > 32) return (PARSER_SALT_LENGTH); @@ -5760,7 +5760,7 @@ int lastpass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int gost_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_6900) || (input_len > DISPLAY_LEN_MAX_6900)) return (PARSER_GLOBAL_LENGTH); @@ -5787,7 +5787,7 @@ int gost_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha256crypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_SHA256CRYPT, input_buf, 3)) return (PARSER_SIGNATURE_UNMATCHED); @@ -5797,7 +5797,7 @@ int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c char *salt_pos = input_buf + 3; - uint iterations_len = 0; + u32 iterations_len = 0; if (memcmp (salt_pos, "rounds=", 7) == 0) { @@ -5827,7 +5827,7 @@ int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len > 16) return (PARSER_SALT_LENGTH); @@ -5842,9 +5842,9 @@ int sha256crypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512osx_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { - uint max_len = DISPLAY_LEN_MAX_7100 + (2 * 128); + u32 max_len = DISPLAY_LEN_MAX_7100 + (2 * 128); if ((input_len < DISPLAY_LEN_MIN_7100) || (input_len > max_len)) return (PARSER_GLOBAL_LENGTH); @@ -5881,7 +5881,7 @@ int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con digest[6] = hex_to_u64 ((const u8 *) &hash_pos[ 96]); digest[7] = hex_to_u64 ((const u8 *) &hash_pos[112]); - uint salt_len = hash_pos - salt_pos - 1; + u32 salt_len = hash_pos - salt_pos - 1; if ((salt_len % 2) != 0) return (PARSER_SALT_LENGTH); @@ -5914,7 +5914,7 @@ int sha512osx_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int episerver4_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1441) || (input_len > DISPLAY_LEN_MAX_1441)) return (PARSER_GLOBAL_LENGTH); @@ -5932,7 +5932,7 @@ int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co hash_pos++; - uint salt_len = hash_pos - salt_pos - 1; + u32 salt_len = hash_pos - salt_pos - 1; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -5969,9 +5969,9 @@ int episerver4_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512grub_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { - uint max_len = DISPLAY_LEN_MAX_7200 + (8 * 128); + u32 max_len = DISPLAY_LEN_MAX_7200 + (8 * 128); if ((input_len < DISPLAY_LEN_MIN_7200) || (input_len > max_len)) return (PARSER_GLOBAL_LENGTH); @@ -6008,13 +6008,13 @@ int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co digest[6] = hex_to_u64 ((const u8 *) &hash_pos[ 96]); digest[7] = hex_to_u64 ((const u8 *) &hash_pos[112]); - uint salt_len = hash_pos - salt_pos - 1; + u32 salt_len = hash_pos - salt_pos - 1; salt_len /= 2; char *salt_buf_ptr = (char *) pbkdf2_sha512->salt_buf; - uint i; + u32 i; for (i = 0; i < salt_len; i++) { @@ -6033,7 +6033,7 @@ int sha512grub_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sha512b64s_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1711) || (input_len > DISPLAY_LEN_MAX_1711)) return (PARSER_GLOBAL_LENGTH); @@ -6087,7 +6087,7 @@ int sha512b64s_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int hmacmd5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -6114,7 +6114,7 @@ int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -6129,7 +6129,7 @@ int hmacmd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int hmacsha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -6152,7 +6152,7 @@ int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -6167,7 +6167,7 @@ int hmacsha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int hmacsha256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -6193,7 +6193,7 @@ int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (input_buf[64] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 64 - 1; + u32 salt_len = input_len - 64 - 1; char *salt_buf = input_buf + 64 + 1; @@ -6208,7 +6208,7 @@ int hmacsha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int hmacsha512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (hashconfig->opts_type & OPTS_TYPE_ST_HEX) { @@ -6234,7 +6234,7 @@ int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (input_buf[128] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 128 - 1; + u32 salt_len = input_len - 128 - 1; char *salt_buf = input_buf + 128 + 1; @@ -6249,7 +6249,7 @@ int hmacsha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int krb5pa_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7500) || (input_len > DISPLAY_LEN_MAX_7500)) return (PARSER_GLOBAL_LENGTH); @@ -6271,7 +6271,7 @@ int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (realm_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint user_len = realm_pos - user_pos; + u32 user_len = realm_pos - user_pos; if (user_len >= 64) return (PARSER_SALT_LENGTH); @@ -6281,7 +6281,7 @@ int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (salt_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint realm_len = salt_pos - realm_pos; + u32 realm_len = salt_pos - realm_pos; if (realm_len >= 64) return (PARSER_SALT_LENGTH); @@ -6291,13 +6291,13 @@ int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (data_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = data_pos - salt_pos; + u32 salt_len = data_pos - salt_pos; if (salt_len >= 128) return (PARSER_SALT_LENGTH); data_pos++; - uint data_len = input_len - 10 - 1 - user_len - 1 - realm_len - 1 - salt_len - 1; + u32 data_len = input_len - 10 - 1 - user_len - 1 - realm_len - 1 - salt_len - 1; if (data_len != ((36 + 16) * 2)) return (PARSER_SALT_LENGTH); @@ -6311,7 +6311,7 @@ int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *timestamp_ptr = (char *) krb5pa->timestamp; - for (uint i = 0; i < (36 * 2); i += 2) + for (u32 i = 0; i < (36 * 2); i += 2) { const char p0 = data_pos[i + 0]; const char p1 = data_pos[i + 1]; @@ -6322,7 +6322,7 @@ int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *checksum_ptr = (char *) krb5pa->checksum; - for (uint i = (36 * 2); i < ((36 + 16) * 2); i += 2) + for (u32 i = (36 * 2); i < ((36 + 16) * 2); i += 2) { const char p0 = data_pos[i + 0]; const char p1 = data_pos[i + 1]; @@ -6355,7 +6355,7 @@ int krb5pa_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sapb_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7700) || (input_len > DISPLAY_LEN_MAX_7700)) return (PARSER_GLOBAL_LENGTH); @@ -6373,13 +6373,13 @@ int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len >= 40) return (PARSER_SALT_LENGTH); hash_pos++; - uint hash_len = input_len - 1 - salt_len; + u32 hash_len = input_len - 1 - salt_len; if (hash_len != 16) return (PARSER_HASH_LENGTH); @@ -6387,9 +6387,9 @@ int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha * valid some data */ - uint user_len = 0; + u32 user_len = 0; - for (uint i = 0; i < salt_len; i++) + for (u32 i = 0; i < salt_len; i++) { if (salt_pos[i] == ' ') continue; @@ -6425,7 +6425,7 @@ int sapb_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sapg_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7800) || (input_len > DISPLAY_LEN_MAX_7800)) return (PARSER_GLOBAL_LENGTH); @@ -6443,13 +6443,13 @@ int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len >= 40) return (PARSER_SALT_LENGTH); hash_pos++; - uint hash_len = input_len - 1 - salt_len; + u32 hash_len = input_len - 1 - salt_len; if (hash_len != 40) return (PARSER_HASH_LENGTH); @@ -6457,9 +6457,9 @@ int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha * valid some data */ - uint user_len = 0; + u32 user_len = 0; - for (uint i = 0; i < salt_len; i++) + for (u32 i = 0; i < salt_len; i++) { if (salt_pos[i] == ' ') continue; @@ -6497,7 +6497,7 @@ int sapg_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int drupal7_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7900) || (input_len > DISPLAY_LEN_MAX_7900)) return (PARSER_GLOBAL_LENGTH); @@ -6509,7 +6509,7 @@ int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *iter_pos = input_buf + 3; - uint salt_iter = 1u << itoa64_to_int (iter_pos[0]); + u32 salt_iter = 1u << itoa64_to_int (iter_pos[0]); if (salt_iter > 0x80000000) return (PARSER_SALT_ITERATION); @@ -6519,7 +6519,7 @@ int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *salt_pos = iter_pos + 1; - uint salt_len = 8; + u32 salt_len = 8; memcpy ((char *) salt->salt_buf, salt_pos, salt_len); @@ -6549,7 +6549,7 @@ int drupal7_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sybasease_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8000) || (input_len > DISPLAY_LEN_MAX_8000)) return (PARSER_GLOBAL_LENGTH); @@ -6561,7 +6561,7 @@ int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con char *salt_buf = input_buf + 6; - uint salt_len = 16; + u32 salt_len = 16; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -6585,7 +6585,7 @@ int sybasease_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mysql323_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_200) || (input_len > DISPLAY_LEN_MAX_200)) return (PARSER_GLOBAL_LENGTH); @@ -6599,7 +6599,7 @@ int mysql323_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int rakp_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7300) || (input_len > DISPLAY_LEN_MAX_7300)) return (PARSER_GLOBAL_LENGTH); @@ -6615,7 +6615,7 @@ int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (hashbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint saltbuf_len = hashbuf_pos - saltbuf_pos; + u32 saltbuf_len = hashbuf_pos - saltbuf_pos; if (saltbuf_len < 64) return (PARSER_SALT_LENGTH); if (saltbuf_len > 512) return (PARSER_SALT_LENGTH); @@ -6624,15 +6624,15 @@ int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha hashbuf_pos++; - uint hashbuf_len = input_len - saltbuf_len - 1; + u32 hashbuf_len = input_len - saltbuf_len - 1; if (hashbuf_len != 40) return (PARSER_HASH_LENGTH); char *salt_ptr = (char *) saltbuf_pos; char *rakp_ptr = (char *) rakp->salt_buf; - uint i; - uint j; + u32 i; + u32 j; for (i = 0, j = 0; i < saltbuf_len; i += 2, j += 1) { @@ -6668,7 +6668,7 @@ int rakp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int netscaler_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8100) || (input_len > DISPLAY_LEN_MAX_8100)) return (PARSER_GLOBAL_LENGTH); @@ -6704,7 +6704,7 @@ int netscaler_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int chap_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_4800) || (input_len > DISPLAY_LEN_MAX_4800)) return (PARSER_GLOBAL_LENGTH); @@ -6754,7 +6754,7 @@ int chap_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int cloudkey_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8200) || (input_len > DISPLAY_LEN_MAX_8200)) return (PARSER_GLOBAL_LENGTH); @@ -6774,7 +6774,7 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (saltbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint hashbuf_len = saltbuf_pos - hashbuf_pos; + const u32 hashbuf_len = saltbuf_pos - hashbuf_pos; if (hashbuf_len != 64) return (PARSER_HASH_LENGTH); @@ -6784,7 +6784,7 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (iteration_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint saltbuf_len = iteration_pos - saltbuf_pos; + const u32 saltbuf_len = iteration_pos - saltbuf_pos; if (saltbuf_len != 32) return (PARSER_SALT_LENGTH); @@ -6794,12 +6794,12 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (databuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint iteration_len = databuf_pos - iteration_pos; + const u32 iteration_len = databuf_pos - iteration_pos; if (iteration_len < 1) return (PARSER_SALT_ITERATION); if (iteration_len > 8) return (PARSER_SALT_ITERATION); - const uint databuf_len = input_len - hashbuf_len - 1 - saltbuf_len - 1 - iteration_len - 1; + const u32 databuf_len = input_len - hashbuf_len - 1 - saltbuf_len - 1 - iteration_len - 1; if (databuf_len < 1) return (PARSER_SALT_LENGTH); if (databuf_len > 2048) return (PARSER_SALT_LENGTH); @@ -6821,7 +6821,7 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons char *saltbuf_ptr = (char *) salt->salt_buf; - for (uint i = 0; i < saltbuf_len; i += 2) + for (u32 i = 0; i < saltbuf_len; i += 2) { const char p0 = saltbuf_pos[i + 0]; const char p1 = saltbuf_pos[i + 1]; @@ -6843,7 +6843,7 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons char *databuf_ptr = (char *) cloudkey->data_buf; - for (uint i = 0; i < databuf_len; i += 2) + for (u32 i = 0; i < databuf_len; i += 2) { const char p0 = databuf_pos[i + 0]; const char p1 = databuf_pos[i + 1]; @@ -6854,7 +6854,7 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons *databuf_ptr++ = 0x80; - for (uint i = 0; i < 512; i++) + for (u32 i = 0; i < 512; i++) { cloudkey->data_buf[i] = byte_swap_32 (cloudkey->data_buf[i]); } @@ -6864,7 +6864,7 @@ int cloudkey_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int nsec3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8300) || (input_len > DISPLAY_LEN_MAX_8300)) return (PARSER_GLOBAL_LENGTH); @@ -6882,7 +6882,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h if (domainbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint hashbuf_len = domainbuf_pos - hashbuf_pos; + const u32 hashbuf_len = domainbuf_pos - hashbuf_pos; if (hashbuf_len != 32) return (PARSER_HASH_LENGTH); @@ -6894,7 +6894,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h if (saltbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint domainbuf_len = saltbuf_pos - domainbuf_pos; + const u32 domainbuf_len = saltbuf_pos - domainbuf_pos; if (domainbuf_len >= 32) return (PARSER_SALT_LENGTH); @@ -6904,7 +6904,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h if (iteration_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint saltbuf_len = iteration_pos - saltbuf_pos; + const u32 saltbuf_len = iteration_pos - saltbuf_pos; if (saltbuf_len >= 28) return (PARSER_SALT_LENGTH); // 28 = 32 - 4; 4 = length @@ -6912,7 +6912,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h iteration_pos++; - const uint iteration_len = input_len - hashbuf_len - 1 - domainbuf_len - 1 - saltbuf_len - 1; + const u32 iteration_len = input_len - hashbuf_len - 1 - domainbuf_len - 1 - saltbuf_len - 1; if (iteration_len < 1) return (PARSER_SALT_ITERATION); if (iteration_len > 5) return (PARSER_SALT_ITERATION); @@ -6945,7 +6945,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h char *len_ptr = NULL; - for (uint i = 0; i < domainbuf_len; i++) + for (u32 i = 0; i < domainbuf_len; i++) { if (salt_buf_pc_ptr[i] == '.') { @@ -6965,7 +6965,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h char *salt_buf_ptr = (char *) salt->salt_buf; - const uint salt_len = parse_and_store_salt (salt_buf_ptr, saltbuf_pos, saltbuf_len, hashconfig); + const u32 salt_len = parse_and_store_salt (salt_buf_ptr, saltbuf_pos, saltbuf_len, hashconfig); if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH); @@ -6978,7 +6978,7 @@ int nsec3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h return (PARSER_OK); } -int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int wbb3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8400) || (input_len > DISPLAY_LEN_MAX_8400)) return (PARSER_GLOBAL_LENGTH); @@ -6994,7 +6994,7 @@ int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -7009,7 +7009,7 @@ int wbb3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int opencart_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13900) || (input_len > DISPLAY_LEN_MAX_13900)) return (PARSER_GLOBAL_LENGTH); @@ -7025,7 +7025,7 @@ int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -7040,7 +7040,7 @@ int opencart_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int racf_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { const u8 ascii_to_ebcdic[] = { @@ -7076,11 +7076,11 @@ int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (digest_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = digest_pos - salt_pos; + u32 salt_len = digest_pos - salt_pos; if (salt_len > 8) return (PARSER_SALT_LENGTH); - uint hash_len = input_len - 1 - salt_len - 1 - 6; + u32 hash_len = input_len - 1 - salt_len - 1 - 6; if (hash_len != 16) return (PARSER_HASH_LENGTH); @@ -7095,16 +7095,16 @@ int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha salt->salt_len = salt_len; - for (uint i = 0; i < salt_len; i++) + for (u32 i = 0; i < salt_len; i++) { salt_buf_pc_ptr[i] = ascii_to_ebcdic[(int) salt_buf_ptr[i]]; } - for (uint i = salt_len; i < 8; i++) + for (u32 i = salt_len; i < 8; i++) { salt_buf_pc_ptr[i] = 0x40; } - uint tt; + u32 tt; IP (salt->salt_buf_pc[0], salt->salt_buf_pc[1], tt); @@ -7127,7 +7127,7 @@ int racf_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int des_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_14000) || (input_len > DISPLAY_LEN_MAX_14000)) return (PARSER_GLOBAL_LENGTH); @@ -7141,11 +7141,11 @@ int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has if (input_buf[16] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = salt_pos - digest_pos; + u32 salt_len = salt_pos - digest_pos; if (salt_len != 16) return (PARSER_SALT_LENGTH); - uint hash_len = input_len - 1 - salt_len; + u32 hash_len = input_len - 1 - salt_len; if (hash_len != 16) return (PARSER_HASH_LENGTH); @@ -7159,7 +7159,7 @@ int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has salt->salt_len = salt_len; - uint tt; + u32 tt; salt->salt_buf_pc[0] = byte_swap_32 (salt->salt_buf[0]); salt->salt_buf_pc[1] = byte_swap_32 (salt->salt_buf[1]); @@ -7182,7 +7182,7 @@ int des_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const has return (PARSER_OK); } -int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int lotus5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8600) || (input_len > DISPLAY_LEN_MAX_8600)) return (PARSER_GLOBAL_LENGTH); @@ -7201,7 +7201,7 @@ int lotus5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int lotus6_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8700) || (input_len > DISPLAY_LEN_MAX_8700)) return (PARSER_GLOBAL_LENGTH); @@ -7230,7 +7230,7 @@ int lotus6_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int lotus8_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9100) || (input_len > DISPLAY_LEN_MAX_9100)) return (PARSER_GLOBAL_LENGTH); @@ -7286,7 +7286,7 @@ int lotus8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int hmailserver_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_1421) || (input_len > DISPLAY_LEN_MAX_1421)) return (PARSER_GLOBAL_LENGTH); @@ -7318,7 +7318,7 @@ int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c char *salt_buf_ptr = (char *) salt->salt_buf; - const uint salt_len = parse_and_store_salt (salt_buf_ptr, salt_buf_pos, 6, hashconfig); + const u32 salt_len = parse_and_store_salt (salt_buf_ptr, salt_buf_pos, 6, hashconfig); if (salt_len == UINT_MAX) return (PARSER_SALT_LENGTH); @@ -7327,7 +7327,7 @@ int hmailserver_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int phps_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_2612) || (input_len > DISPLAY_LEN_MAX_2612)) return (PARSER_GLOBAL_LENGTH); @@ -7343,7 +7343,7 @@ int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (digest_buf == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = digest_buf - salt_buf; + u32 salt_len = digest_buf - salt_buf; digest_buf++; // skip the '$' symbol @@ -7373,7 +7373,7 @@ int phps_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mediawiki_b_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_3711) || (input_len > DISPLAY_LEN_MAX_3711)) return (PARSER_GLOBAL_LENGTH); @@ -7389,7 +7389,7 @@ int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c if (digest_buf == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = digest_buf - salt_buf; + u32 salt_len = digest_buf - salt_buf; digest_buf++; // skip the '$' symbol @@ -7421,7 +7421,7 @@ int mediawiki_b_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int peoplesoft_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_133) || (input_len > DISPLAY_LEN_MAX_133)) return (PARSER_GLOBAL_LENGTH); @@ -7454,7 +7454,7 @@ int peoplesoft_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int skype_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_23) || (input_len > DISPLAY_LEN_MAX_23)) return (PARSER_GLOBAL_LENGTH); @@ -7479,7 +7479,7 @@ int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h if (input_buf[32] != ':') return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -7502,7 +7502,7 @@ int skype_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h return (PARSER_OK); } -int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int androidfde_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8800) || (input_len > DISPLAY_LEN_MAX_8800)) return (PARSER_GLOBAL_LENGTH); @@ -7524,7 +7524,7 @@ int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (saltbuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint saltlen_len = saltbuf_pos - saltlen_pos; + u32 saltlen_len = saltbuf_pos - saltlen_pos; if (saltlen_len != 2) return (PARSER_SALT_LENGTH); @@ -7534,7 +7534,7 @@ int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (keylen_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint saltbuf_len = keylen_pos - saltbuf_pos; + u32 saltbuf_len = keylen_pos - saltbuf_pos; if (saltbuf_len != 32) return (PARSER_SALT_LENGTH); @@ -7544,7 +7544,7 @@ int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (keybuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint keylen_len = keybuf_pos - keylen_pos; + u32 keylen_len = keybuf_pos - keylen_pos; if (keylen_len != 2) return (PARSER_SALT_LENGTH); @@ -7554,13 +7554,13 @@ int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (databuf_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint keybuf_len = databuf_pos - keybuf_pos; + u32 keybuf_len = databuf_pos - keybuf_pos; if (keybuf_len != 32) return (PARSER_SALT_LENGTH); databuf_pos++; - uint data_len = input_len - 1 - 3 - 1 - saltlen_len - 1 - saltbuf_len - 1 - keylen_len - 1 - keybuf_len - 1; + u32 data_len = input_len - 1 - 3 - 1 - saltlen_len - 1 - saltbuf_len - 1 - keylen_len - 1 - keybuf_len - 1; if (data_len != 3072) return (PARSER_SALT_LENGTH); @@ -7586,7 +7586,7 @@ int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co salt->salt_len = 16; salt->salt_iter = ROUNDS_ANDROIDFDE - 1; - for (uint i = 0, j = 0; i < 3072; i += 8, j += 1) + for (u32 i = 0, j = 0; i < 3072; i += 8, j += 1) { androidfde->data[j] = hex_to_u32 ((const u8 *) &databuf_pos[i]); } @@ -7594,7 +7594,7 @@ int androidfde_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int scrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_8900) || (input_len > DISPLAY_LEN_MAX_8900)) return (PARSER_GLOBAL_LENGTH); @@ -7684,7 +7684,7 @@ int scrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int juniper_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_501) || (input_len > DISPLAY_LEN_MAX_501)) return (PARSER_GLOBAL_LENGTH); @@ -7721,7 +7721,7 @@ int juniper_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int cisco8_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9200) || (input_len > DISPLAY_LEN_MAX_9200)) return (PARSER_GLOBAL_LENGTH); @@ -7745,7 +7745,7 @@ int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len != 14) return (PARSER_SALT_LENGTH); @@ -7772,7 +7772,7 @@ int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const u8 tmp_buf[100] = { 0 }; - uint hash_len = input_len - 3 - salt_len - 1; + u32 hash_len = input_len - 3 - salt_len - 1; int tmp_len = base64_decode (itoa64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); @@ -7792,7 +7792,7 @@ int cisco8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int cisco9_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9300) || (input_len > DISPLAY_LEN_MAX_9300)) return (PARSER_GLOBAL_LENGTH); @@ -7814,7 +7814,7 @@ int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; if (salt_len != 14) return (PARSER_SALT_LENGTH); @@ -7830,7 +7830,7 @@ int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const u8 tmp_buf[100] = { 0 }; - uint hash_len = input_len - 3 - salt_len - 1; + u32 hash_len = input_len - 3 - salt_len - 1; int tmp_len = base64_decode (itoa64_to_int, (const u8 *) hash_pos, hash_len, tmp_buf); @@ -7847,7 +7847,7 @@ int cisco9_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int office2007_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9400) || (input_len > DISPLAY_LEN_MAX_9400)) return (PARSER_GLOBAL_LENGTH); @@ -7929,21 +7929,21 @@ int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (encryptedVerifierHash_len != 40) return (PARSER_SALT_LENGTH); - const uint version = atoi (version_pos); + const u32 version = atoi (version_pos); if (version != 2007) return (PARSER_SALT_VALUE); - const uint verifierHashSize = atoi (verifierHashSize_pos); + const u32 verifierHashSize = atoi (verifierHashSize_pos); if (verifierHashSize != 20) return (PARSER_SALT_VALUE); - const uint keySize = atoi (keySize_pos); + const u32 keySize = atoi (keySize_pos); if ((keySize != 128) && (keySize != 256)) return (PARSER_SALT_VALUE); office2007->keySize = keySize; - const uint saltSize = atoi (saltSize_pos); + const u32 saltSize = atoi (saltSize_pos); if (saltSize != 16) return (PARSER_SALT_VALUE); @@ -7986,7 +7986,7 @@ int office2007_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int office2010_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9500) || (input_len > DISPLAY_LEN_MAX_9500)) return (PARSER_GLOBAL_LENGTH); @@ -8068,19 +8068,19 @@ int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (encryptedVerifierHash_len != 64) return (PARSER_SALT_LENGTH); - const uint version = atoi (version_pos); + const u32 version = atoi (version_pos); if (version != 2010) return (PARSER_SALT_VALUE); - const uint spinCount = atoi (spinCount_pos); + const u32 spinCount = atoi (spinCount_pos); if (spinCount != 100000) return (PARSER_SALT_VALUE); - const uint keySize = atoi (keySize_pos); + const u32 keySize = atoi (keySize_pos); if (keySize != 128) return (PARSER_SALT_VALUE); - const uint saltSize = atoi (saltSize_pos); + const u32 saltSize = atoi (saltSize_pos); if (saltSize != 16) return (PARSER_SALT_VALUE); @@ -8126,7 +8126,7 @@ int office2010_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int office2013_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9600) || (input_len > DISPLAY_LEN_MAX_9600)) return (PARSER_GLOBAL_LENGTH); @@ -8208,19 +8208,19 @@ int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (encryptedVerifierHash_len != 64) return (PARSER_SALT_LENGTH); - const uint version = atoi (version_pos); + const u32 version = atoi (version_pos); if (version != 2013) return (PARSER_SALT_VALUE); - const uint spinCount = atoi (spinCount_pos); + const u32 spinCount = atoi (spinCount_pos); if (spinCount != 100000) return (PARSER_SALT_VALUE); - const uint keySize = atoi (keySize_pos); + const u32 keySize = atoi (keySize_pos); if (keySize != 256) return (PARSER_SALT_VALUE); - const uint saltSize = atoi (saltSize_pos); + const u32 saltSize = atoi (saltSize_pos); if (saltSize != 16) return (PARSER_SALT_VALUE); @@ -8266,7 +8266,7 @@ int office2013_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oldoffice01_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9700) || (input_len > DISPLAY_LEN_MAX_9700)) return (PARSER_GLOBAL_LENGTH); @@ -8318,7 +8318,7 @@ int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c if (encryptedVerifierHash_len != 32) return (PARSER_SALT_LENGTH); - const uint version = *version_pos - 0x30; + const u32 version = *version_pos - 0x30; if (version != 0 && version != 1) return (PARSER_SALT_VALUE); @@ -8389,12 +8389,12 @@ int oldoffice01_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int oldoffice01cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oldoffice01cm1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { return oldoffice01_parse_hash (input_buf, input_len, hash_buf, hashconfig); } -int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oldoffice01cm2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9720) || (input_len > DISPLAY_LEN_MAX_9720)) return (PARSER_GLOBAL_LENGTH); @@ -8456,7 +8456,7 @@ int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf if (rc4key_len != 10) return (PARSER_SALT_LENGTH); - const uint version = *version_pos - 0x30; + const u32 version = *version_pos - 0x30; if (version != 0 && version != 1) return (PARSER_SALT_VALUE); @@ -8544,7 +8544,7 @@ int oldoffice01cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf return (PARSER_OK); } -int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oldoffice34_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9800) || (input_len > DISPLAY_LEN_MAX_9800)) return (PARSER_GLOBAL_LENGTH); @@ -8596,7 +8596,7 @@ int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c if (encryptedVerifierHash_len != 40) return (PARSER_SALT_LENGTH); - const uint version = *version_pos - 0x30; + const u32 version = *version_pos - 0x30; if (version != 3 && version != 4) return (PARSER_SALT_VALUE); @@ -8664,14 +8664,14 @@ int oldoffice34_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int oldoffice34cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oldoffice34cm1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if (memcmp (SIGNATURE_OLDOFFICE3, input_buf, 12)) return (PARSER_SIGNATURE_UNMATCHED); return oldoffice34_parse_hash (input_buf, input_len, hash_buf, hashconfig); } -int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int oldoffice34cm2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9820) || (input_len > DISPLAY_LEN_MAX_9820)) return (PARSER_GLOBAL_LENGTH); @@ -8733,7 +8733,7 @@ int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf if (rc4key_len != 10) return (PARSER_SALT_LENGTH); - const uint version = *version_pos - 0x30; + const u32 version = *version_pos - 0x30; if (version != 3 && version != 4) return (PARSER_SALT_VALUE); @@ -8818,7 +8818,7 @@ int oldoffice34cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf return (PARSER_OK); } -int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int radmin2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_9900) || (input_len > DISPLAY_LEN_MAX_9900)) return (PARSER_GLOBAL_LENGTH); @@ -8837,7 +8837,7 @@ int radmin2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int djangosha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_124) || (input_len > DISPLAY_LEN_MAX_124)) return (PARSER_GLOBAL_LENGTH); @@ -8894,7 +8894,7 @@ int djangosha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int djangopbkdf2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10000) || (input_len > DISPLAY_LEN_MAX_10000)) return (PARSER_GLOBAL_LENGTH); @@ -8928,7 +8928,7 @@ int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - const uint salt_len = hash_pos - salt_pos; + const u32 salt_len = hash_pos - salt_pos; hash_pos++; @@ -8953,7 +8953,7 @@ int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, u8 tmp_buf[100] = { 0 }; - uint hash_len = input_len - (hash_pos - input_buf); + u32 hash_len = input_len - (hash_pos - input_buf); if (hash_len != 44) return (PARSER_HASH_LENGTH); @@ -8973,7 +8973,7 @@ int djangopbkdf2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, return (PARSER_OK); } -int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int siphash_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10100) || (input_len > DISPLAY_LEN_MAX_10100)) return (PARSER_GLOBAL_LENGTH); @@ -9017,7 +9017,7 @@ int siphash_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int crammd5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10200) || (input_len > DISPLAY_LEN_MAX_10200)) return (PARSER_GLOBAL_LENGTH); @@ -9035,11 +9035,11 @@ int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = hash_pos - salt_pos; + u32 salt_len = hash_pos - salt_pos; hash_pos++; - uint hash_len = input_len - 10 - salt_len - 1; + u32 hash_len = input_len - 10 - salt_len - 1; // base64 decode salt @@ -9067,7 +9067,7 @@ int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (hash_len < 32 + 1) return (PARSER_HASH_LENGTH); - uint user_len = hash_len - 32; + u32 user_len = hash_len - 32; const u8 *tmp_hash = tmp_buf + user_len; @@ -9091,7 +9091,7 @@ int crammd5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int saph_sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10300) || (input_len > DISPLAY_LEN_MAX_10300)) return (PARSER_GLOBAL_LENGTH); @@ -9138,7 +9138,7 @@ int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con // copy the salt - uint salt_len = decoded_len - 20; + u32 salt_len = decoded_len - 20; if (salt_len < 4) return (PARSER_SALT_LENGTH); if (salt_len > 16) return (PARSER_SALT_LENGTH); @@ -9160,7 +9160,7 @@ int saph_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int redmine_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_7600) || (input_len > DISPLAY_LEN_MAX_7600)) return (PARSER_GLOBAL_LENGTH); @@ -9176,7 +9176,7 @@ int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (input_buf[40] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 40 - 1; + u32 salt_len = input_len - 40 - 1; char *salt_buf = input_buf + 40 + 1; @@ -9191,7 +9191,7 @@ int redmine_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pdf11_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10400) || (input_len > DISPLAY_LEN_MAX_10400)) return (PARSER_GLOBAL_LENGTH); @@ -9395,12 +9395,12 @@ int pdf11_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h return (PARSER_OK); } -int pdf11cm1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pdf11cm1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { return pdf11_parse_hash (input_buf, input_len, hash_buf, hashconfig); } -int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pdf11cm2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10420) || (input_len > DISPLAY_LEN_MAX_10420)) return (PARSER_GLOBAL_LENGTH); @@ -9635,7 +9635,7 @@ int pdf11cm2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pdf14_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10500) || (input_len > DISPLAY_LEN_MAX_10500)) return (PARSER_GLOBAL_LENGTH); @@ -9850,7 +9850,7 @@ int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h // precompute rc4 data for later use - uint padding[8] = + u32 padding[8] = { 0x5e4ebf28, 0x418a754e, @@ -9864,14 +9864,14 @@ int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h // md5 - uint salt_pc_block[32] = { 0 }; + u32 salt_pc_block[32] = { 0 }; char *salt_pc_ptr = (char *) salt_pc_block; memcpy (salt_pc_ptr, padding, 32); memcpy (salt_pc_ptr + 32, pdf->id_buf, pdf->id_len); - uint salt_pc_digest[4] = { 0 }; + u32 salt_pc_digest[4] = { 0 }; md5_complete_no_limit (salt_pc_digest, salt_pc_block, 32 + pdf->id_len); @@ -9900,7 +9900,7 @@ int pdf14_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h return (PARSER_OK); } -int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pdf17l3_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { int ret = pdf17l8_parse_hash (input_buf, input_len, hash_buf, hashconfig); @@ -9927,7 +9927,7 @@ int pdf17l3_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pdf17l8_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10600) || (input_len > DISPLAY_LEN_MAX_10600)) return (PARSER_GLOBAL_LENGTH); @@ -10051,9 +10051,9 @@ int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if ((enc_md != 0) && (enc_md != 1)) return (PARSER_SALT_VALUE); - const uint id_len = atoi (id_len_pos); - const uint u_len = atoi (u_len_pos); - const uint o_len = atoi (o_len_pos); + const u32 id_len = atoi (id_len_pos); + const u32 u_len = atoi (u_len_pos); + const u32 o_len = atoi (o_len_pos); if (V_len > 6) return (PARSER_SALT_LENGTH); if (R_len > 6) return (PARSER_SALT_LENGTH); @@ -10098,7 +10098,7 @@ int pdf17l8_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pbkdf2_sha256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_10900) || (input_len > DISPLAY_LEN_MAX_10900)) return (PARSER_GLOBAL_LENGTH); @@ -10185,7 +10185,7 @@ int pbkdf2_sha256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, return (PARSER_OK); } -int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int prestashop_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11000) || (input_len > DISPLAY_LEN_MAX_11000)) return (PARSER_GLOBAL_LENGTH); @@ -10205,7 +10205,7 @@ int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co if (input_buf[32] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 32 - 1; + u32 salt_len = input_len - 32 - 1; char *salt_buf = input_buf + 32 + 1; @@ -10220,7 +10220,7 @@ int prestashop_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int postgresql_auth_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11100) || (input_len > DISPLAY_LEN_MAX_11100)) return (PARSER_GLOBAL_LENGTH); @@ -10242,13 +10242,13 @@ int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_bu hash_pos++; - uint hash_len = input_len - (hash_pos - input_buf); + u32 hash_len = input_len - (hash_pos - input_buf); if (hash_len != 32) return (PARSER_HASH_LENGTH); - uint user_len = salt_pos - user_pos - 1; + u32 user_len = salt_pos - user_pos - 1; - uint salt_len = hash_pos - salt_pos - 1; + u32 salt_len = hash_pos - salt_pos - 1; if (salt_len != 8) return (PARSER_SALT_LENGTH); @@ -10293,7 +10293,7 @@ int postgresql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_bu return (PARSER_OK); } -int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mysql_auth_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11200) || (input_len > DISPLAY_LEN_MAX_11200)) return (PARSER_GLOBAL_LENGTH); @@ -10311,11 +10311,11 @@ int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co hash_pos++; - uint hash_len = input_len - (hash_pos - input_buf); + u32 hash_len = input_len - (hash_pos - input_buf); if (hash_len != 40) return (PARSER_HASH_LENGTH); - uint salt_len = hash_pos - salt_pos - 1; + u32 salt_len = hash_pos - salt_pos - 1; if (salt_len != 40) return (PARSER_SALT_LENGTH); @@ -10342,7 +10342,7 @@ int mysql_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int bitcoin_wallet_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11300) || (input_len > DISPLAY_LEN_MAX_11300)) return (PARSER_GLOBAL_LENGTH); @@ -10426,31 +10426,31 @@ int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf u32 public_key_buf_len = input_len - 1 - 7 - 1 - cry_master_len_len - 1 - cry_master_buf_len - 1 - cry_salt_len_len - 1 - cry_salt_buf_len - 1 - cry_rounds_len - 1 - ckey_len_len - 1 - ckey_buf_len - 1 - public_key_len_len - 1; - const uint cry_master_len = atoi (cry_master_len_pos); - const uint cry_salt_len = atoi (cry_salt_len_pos); - const uint ckey_len = atoi (ckey_len_pos); - const uint public_key_len = atoi (public_key_len_pos); + const u32 cry_master_len = atoi (cry_master_len_pos); + const u32 cry_salt_len = atoi (cry_salt_len_pos); + const u32 ckey_len = atoi (ckey_len_pos); + const u32 public_key_len = atoi (public_key_len_pos); if (cry_master_buf_len != cry_master_len) return (PARSER_SALT_VALUE); if (cry_salt_buf_len != cry_salt_len) return (PARSER_SALT_VALUE); if (ckey_buf_len != ckey_len) return (PARSER_SALT_VALUE); if (public_key_buf_len != public_key_len) return (PARSER_SALT_VALUE); - for (uint i = 0, j = 0; j < cry_master_len; i += 1, j += 8) + for (u32 i = 0, j = 0; j < cry_master_len; i += 1, j += 8) { bitcoin_wallet->cry_master_buf[i] = hex_to_u32 ((const u8 *) &cry_master_buf_pos[j]); bitcoin_wallet->cry_master_buf[i] = byte_swap_32 (bitcoin_wallet->cry_master_buf[i]); } - for (uint i = 0, j = 0; j < ckey_len; i += 1, j += 8) + for (u32 i = 0, j = 0; j < ckey_len; i += 1, j += 8) { bitcoin_wallet->ckey_buf[i] = hex_to_u32 ((const u8 *) &ckey_buf_pos[j]); bitcoin_wallet->ckey_buf[i] = byte_swap_32 (bitcoin_wallet->ckey_buf[i]); } - for (uint i = 0, j = 0; j < public_key_len; i += 1, j += 8) + for (u32 i = 0, j = 0; j < public_key_len; i += 1, j += 8) { bitcoin_wallet->public_key_buf[i] = hex_to_u32 ((const u8 *) &public_key_buf_pos[j]); @@ -10476,20 +10476,20 @@ int bitcoin_wallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf if (cry_rounds_len >= 7) return (PARSER_SALT_VALUE); - const uint cry_rounds = atoi (cry_rounds_pos); + const u32 cry_rounds = atoi (cry_rounds_pos); salt->salt_iter = cry_rounds - 1; char *salt_buf_ptr = (char *) salt->salt_buf; - const uint salt_len = parse_and_store_salt (salt_buf_ptr, cry_salt_buf_pos, cry_salt_buf_len, hashconfig); + const u32 salt_len = parse_and_store_salt (salt_buf_ptr, cry_salt_buf_pos, cry_salt_buf_len, hashconfig); salt->salt_len = salt_len; return (PARSER_OK); } -int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int sip_auth_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11400) || (input_len > DISPLAY_LEN_MAX_11400)) return (PARSER_GLOBAL_LENGTH); @@ -10523,7 +10523,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons URI_client_pos[0] = 0; URI_client_pos++; - uint URI_server_len = strlen (URI_server_pos); + u32 URI_server_len = strlen (URI_server_pos); if (URI_server_len > 512) { @@ -10546,7 +10546,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons user_pos[0] = 0; user_pos++; - uint URI_client_len = strlen (URI_client_pos); + u32 URI_client_len = strlen (URI_client_pos); if (URI_client_len > 512) { @@ -10569,7 +10569,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons realm_pos[0] = 0; realm_pos++; - uint user_len = strlen (user_pos); + u32 user_len = strlen (user_pos); if (user_len > 116) { @@ -10592,7 +10592,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons method_pos[0] = 0; method_pos++; - uint realm_len = strlen (realm_pos); + u32 realm_len = strlen (realm_pos); if (realm_len > 116) { @@ -10615,7 +10615,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons URI_prefix_pos[0] = 0; URI_prefix_pos++; - uint method_len = strlen (method_pos); + u32 method_len = strlen (method_pos); if (method_len > 246) { @@ -10638,7 +10638,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons URI_resource_pos[0] = 0; URI_resource_pos++; - uint URI_prefix_len = strlen (URI_prefix_pos); + u32 URI_prefix_len = strlen (URI_prefix_pos); if (URI_prefix_len > 245) { @@ -10661,7 +10661,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons URI_suffix_pos[0] = 0; URI_suffix_pos++; - uint URI_resource_len = strlen (URI_resource_pos); + u32 URI_resource_len = strlen (URI_resource_pos); if (URI_resource_len < 1 || URI_resource_len > 246) { @@ -10684,7 +10684,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons nonce_pos[0] = 0; nonce_pos++; - uint URI_suffix_len = strlen (URI_suffix_pos); + u32 URI_suffix_len = strlen (URI_suffix_pos); if (URI_suffix_len > 245) { @@ -10707,7 +10707,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons nonce_client_pos[0] = 0; nonce_client_pos++; - uint nonce_len = strlen (nonce_pos); + u32 nonce_len = strlen (nonce_pos); if (nonce_len < 1 || nonce_len > 50) { @@ -10730,7 +10730,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons nonce_count_pos[0] = 0; nonce_count_pos++; - uint nonce_client_len = strlen (nonce_client_pos); + u32 nonce_client_len = strlen (nonce_client_pos); if (nonce_client_len > 50) { @@ -10753,7 +10753,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons qop_pos[0] = 0; qop_pos++; - uint nonce_count_len = strlen (nonce_count_pos); + u32 nonce_count_len = strlen (nonce_count_pos); if (nonce_count_len > 50) { @@ -10776,7 +10776,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons directive_pos[0] = 0; directive_pos++; - uint qop_len = strlen (qop_pos); + u32 qop_len = strlen (qop_pos); if (qop_len > 50) { @@ -10799,7 +10799,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons digest_pos[0] = 0; digest_pos++; - uint directive_len = strlen (directive_pos); + u32 directive_len = strlen (directive_pos); if (directive_len != 3) { @@ -10821,13 +10821,13 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons * first (pre-)compute: HA2 = md5 ($method . ":" . $uri) */ - uint md5_len = 0; + u32 md5_len = 0; - uint md5_max_len = 4 * 64; + u32 md5_max_len = 4 * 64; - uint md5_remaining_len = md5_max_len; + u32 md5_remaining_len = md5_max_len; - uint tmp_md5_buf[64] = { 0 }; + u32 tmp_md5_buf[64] = { 0 }; char *tmp_md5_ptr = (char *) tmp_md5_buf; @@ -10862,7 +10862,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons md5_len += 1 + URI_suffix_len; } - uint tmp_digest[4] = { 0 }; + u32 tmp_digest[4] = { 0 }; md5_complete_no_limit (tmp_digest, tmp_md5_buf, md5_len); @@ -10877,9 +10877,9 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons char *esalt_buf_ptr = (char *) sip->esalt_buf; - uint esalt_len = 0; + u32 esalt_len = 0; - uint max_esalt_len = sizeof (sip->esalt_buf); // 151 = (64 + 64 + 55) - 32, where 32 is the hexadecimal MD5 HA1 hash + u32 max_esalt_len = sizeof (sip->esalt_buf); // 151 = (64 + 64 + 55) - 32, where 32 is the hexadecimal MD5 HA1 hash // there are 2 possibilities for the esalt: @@ -10935,9 +10935,9 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons char *sip_salt_ptr = (char *) sip->salt_buf; - uint salt_len = user_len + 1 + realm_len + 1; + u32 salt_len = user_len + 1 + realm_len + 1; - uint max_salt_len = 119; + u32 max_salt_len = 119; if (salt_len > max_salt_len) { @@ -10958,7 +10958,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons max_salt_len = 55; - uint fake_salt_len = salt_len; + u32 fake_salt_len = salt_len; if (fake_salt_len > max_salt_len) { @@ -10988,7 +10988,7 @@ int sip_auth_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int crc32_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11500) || (input_len > DISPLAY_LEN_MAX_11500)) return (PARSER_GLOBAL_LENGTH); @@ -11011,7 +11011,7 @@ int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h char *salt_buf = input_buf + 8 + 1; - uint salt_len = 8; + u32 salt_len = 8; char *salt_buf_ptr = (char *) salt->salt_buf; @@ -11024,7 +11024,7 @@ int crc32_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const h return (PARSER_OK); } -int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int seven_zip_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11600) || (input_len > DISPLAY_LEN_MAX_11600)) return (PARSER_GLOBAL_LENGTH); @@ -11116,13 +11116,13 @@ int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con u32 data_buf_len = input_len - 1 - 2 - 1 - p_buf_len - 1 - NumCyclesPower_len - 1 - salt_len_len - 1 - salt_buf_len - 1 - iv_len_len - 1 - iv_buf_len - 1 - crc_buf_len - 1 - data_len_len - 1 - unpack_size_len - 1; - const uint iter = atoi (NumCyclesPower_pos); - const uint crc = atoi (crc_buf_pos); - const uint p_buf = atoi (p_buf_pos); - const uint salt_len = atoi (salt_len_pos); - const uint iv_len = atoi (iv_len_pos); - const uint unpack_size = atoi (unpack_size_pos); - const uint data_len = atoi (data_len_pos); + const u32 iter = atoi (NumCyclesPower_pos); + const u32 crc = atoi (crc_buf_pos); + const u32 p_buf = atoi (p_buf_pos); + const u32 salt_len = atoi (salt_len_pos); + const u32 iv_len = atoi (iv_len_pos); + const u32 unpack_size = atoi (unpack_size_pos); + const u32 data_len = atoi (data_len_pos); /** * verify some data @@ -11154,7 +11154,7 @@ int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con seven_zip->crc = crc; - for (uint i = 0, j = 0; j < data_buf_len; i += 1, j += 8) + for (u32 i = 0, j = 0; j < data_buf_len; i += 1, j += 8) { seven_zip->data_buf[i] = hex_to_u32 ((const u8 *) &data_buf_pos[j]); @@ -11190,7 +11190,7 @@ int seven_zip_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int gost2012sbog_256_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11700) || (input_len > DISPLAY_LEN_MAX_11700)) return (PARSER_GLOBAL_LENGTH); @@ -11217,7 +11217,7 @@ int gost2012sbog_256_parse_hash (char *input_buf, uint input_len, hash_t *hash_b return (PARSER_OK); } -int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int gost2012sbog_512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11800) || (input_len > DISPLAY_LEN_MAX_11800)) return (PARSER_GLOBAL_LENGTH); @@ -11260,7 +11260,7 @@ int gost2012sbog_512_parse_hash (char *input_buf, uint input_len, hash_t *hash_b return (PARSER_OK); } -int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pbkdf2_md5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_11900) || (input_len > DISPLAY_LEN_MAX_11900)) return (PARSER_GLOBAL_LENGTH); @@ -11342,7 +11342,7 @@ int pbkdf2_md5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, co return (PARSER_OK); } -int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pbkdf2_sha1_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12000) || (input_len > DISPLAY_LEN_MAX_12000)) return (PARSER_GLOBAL_LENGTH); @@ -11429,7 +11429,7 @@ int pbkdf2_sha1_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, c return (PARSER_OK); } -int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int pbkdf2_sha512_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12100) || (input_len > DISPLAY_LEN_MAX_12100)) return (PARSER_GLOBAL_LENGTH); @@ -11520,13 +11520,13 @@ int pbkdf2_sha512_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, return (PARSER_OK); } -int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int ecryptfs_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12200) || (input_len > DISPLAY_LEN_MAX_12200)) return (PARSER_GLOBAL_LENGTH); if (memcmp (SIGNATURE_ECRYPTFS, input_buf, 10)) return (PARSER_SIGNATURE_UNMATCHED); - uint *digest = (uint *) hash_buf->digest; + u32 *digest = (u32 *) hash_buf->digest; salt_t *salt = hash_buf->salt; @@ -11580,7 +11580,7 @@ int ecryptfs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int bsdicrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12400) || (input_len > DISPLAY_LEN_MAX_12400)) return (PARSER_GLOBAL_LENGTH); @@ -11616,7 +11616,7 @@ int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con memcpy (digest, tmp_buf, 8); - uint tt; + u32 tt; IP (digest[0], digest[1], tt); @@ -11628,7 +11628,7 @@ int bsdicrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con return (PARSER_OK); } -int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int rar3hp_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12500) || (input_len > DISPLAY_LEN_MAX_12500)) return (PARSER_GLOBAL_LENGTH); @@ -11697,7 +11697,7 @@ int rar3hp_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int rar5_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13000) || (input_len > DISPLAY_LEN_MAX_13000)) return (PARSER_GLOBAL_LENGTH); @@ -11761,9 +11761,9 @@ int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha char *iv = param3_pos; char *pswcheck = param5_pos; - const uint salt_len = atoi (param0_pos); - const uint iterations = atoi (param2_pos); - const uint pswcheck_len = atoi (param4_pos); + const u32 salt_len = atoi (param0_pos); + const u32 iterations = atoi (param2_pos); + const u32 pswcheck_len = atoi (param4_pos); /** * verify some data @@ -11809,7 +11809,7 @@ int rar5_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int krb5tgs_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13100) || (input_len > DISPLAY_LEN_MAX_13100)) return (PARSER_GLOBAL_LENGTH); @@ -11830,7 +11830,7 @@ int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *data_pos; - uint data_len; + u32 data_len; if (account_pos[0] == '*') { @@ -11843,7 +11843,7 @@ int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (data_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint account_len = data_pos - account_pos + 1; + u32 account_len = data_pos - account_pos + 1; if (account_len >= 512) return (PARSER_SALT_LENGTH); @@ -11868,7 +11868,7 @@ int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const char *checksum_ptr = (char *) krb5tgs->checksum; - for (uint i = 0; i < 16 * 2; i += 2) + for (u32 i = 0; i < 16 * 2; i += 2) { const char p0 = data_pos[i + 0]; const char p1 = data_pos[i + 1]; @@ -11882,7 +11882,7 @@ int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const krb5tgs->edata2_len = (data_len - 32) / 2 ; /* skip '$' */ - for (uint i = 16 * 2 + 1; i < (krb5tgs->edata2_len * 2) + (16 * 2 + 1); i += 2) + for (u32 i = 16 * 2 + 1; i < (krb5tgs->edata2_len * 2) + (16 * 2 + 1); i += 2) { const char p0 = data_pos[i + 0]; const char p1 = data_pos[i + 1]; @@ -11908,7 +11908,7 @@ int krb5tgs_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int axcrypt_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13200) || (input_len > DISPLAY_LEN_MAX_13200)) return (PARSER_GLOBAL_LENGTH); @@ -11937,7 +11937,7 @@ int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (salt_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint wrapping_rounds_len = salt_pos - wrapping_rounds_pos; + u32 wrapping_rounds_len = salt_pos - wrapping_rounds_pos; /* Skip '*' */ salt_pos++; @@ -11948,14 +11948,14 @@ int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const if (wrapped_key_pos == NULL) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = wrapped_key_pos - salt_pos; + u32 salt_len = wrapped_key_pos - salt_pos; if (salt_len != 32) return (PARSER_SALT_LENGTH); /* Skip '*' */ wrapped_key_pos++; - uint wrapped_key_len = input_len - 11 - 1 - wrapping_rounds_len - 1 - salt_len - 1; + u32 wrapped_key_len = input_len - 11 - 1 - wrapping_rounds_len - 1 - salt_len - 1; if (wrapped_key_len != 48) return (PARSER_SALT_LENGTH); @@ -11983,7 +11983,7 @@ int axcrypt_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int keepass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int keepass_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13400) || (input_len > DISPLAY_LEN_MAX_13400)) return (PARSER_GLOBAL_LENGTH); @@ -12285,7 +12285,7 @@ int keepass_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int cf10_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12600) || (input_len > DISPLAY_LEN_MAX_12600)) return (PARSER_GLOBAL_LENGTH); @@ -12304,7 +12304,7 @@ int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha if (input_buf[64] != hashconfig->separator) return (PARSER_SEPARATOR_UNMATCHED); - uint salt_len = input_len - 64 - 1; + u32 salt_len = input_len - 64 - 1; char *salt_buf = input_buf + 64 + 1; @@ -12320,7 +12320,7 @@ int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha * we can precompute the first sha256 transform */ - uint w[16] = { 0 }; + u32 w[16] = { 0 }; w[ 0] = byte_swap_32 (salt->salt_buf[ 0]); w[ 1] = byte_swap_32 (salt->salt_buf[ 1]); @@ -12339,7 +12339,7 @@ int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha w[14] = byte_swap_32 (salt->salt_buf[14]); w[15] = byte_swap_32 (salt->salt_buf[15]); - uint pc256[8] = { SHA256M_A, SHA256M_B, SHA256M_C, SHA256M_D, SHA256M_E, SHA256M_F, SHA256M_G, SHA256M_H }; + u32 pc256[8] = { SHA256M_A, SHA256M_B, SHA256M_C, SHA256M_D, SHA256M_E, SHA256M_F, SHA256M_G, SHA256M_H }; sha256_64 (w, pc256); @@ -12364,7 +12364,7 @@ int cf10_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int mywallet_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12700) || (input_len > DISPLAY_LEN_MAX_12700)) return (PARSER_GLOBAL_LENGTH); @@ -12435,7 +12435,7 @@ int mywallet_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, cons return (PARSER_OK); } -int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int ms_drsr_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12800) || (input_len > DISPLAY_LEN_MAX_12800)) return (PARSER_GLOBAL_LENGTH); @@ -12509,7 +12509,7 @@ int ms_drsr_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const return (PARSER_OK); } -int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int androidfde_samsung_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_12900) || (input_len > DISPLAY_LEN_MAX_12900)) return (PARSER_GLOBAL_LENGTH); @@ -12564,7 +12564,7 @@ int androidfde_samsung_parse_hash (char *input_buf, uint input_len, hash_t *hash return (PARSER_OK); } -int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int zip2_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13600) || (input_len > DISPLAY_LEN_MAX_13600)) return (PARSER_GLOBAL_LENGTH); @@ -12647,15 +12647,15 @@ int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha param8_pos++; - const uint type = atoi (param0_pos); - const uint mode = atoi (param1_pos); - const uint magic = atoi (param2_pos); + const u32 type = atoi (param0_pos); + const u32 mode = atoi (param1_pos); + const u32 magic = atoi (param2_pos); char *salt_buf = param3_pos; - uint verify_bytes; sscanf (param4_pos, "%4x*", &verify_bytes); + u32 verify_bytes; sscanf (param4_pos, "%4x*", &verify_bytes); - const uint compress_length = atoi (param5_pos); + const u32 compress_length = atoi (param5_pos); char *data_buf = param6_pos; char *auth = param7_pos; @@ -12737,7 +12737,7 @@ int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha char *data_buf_ptr = (char *) zip2->data_buf; - for (uint i = 0; i < param6_len; i += 2) + for (u32 i = 0; i < param6_len; i += 2) { const char p0 = data_buf[i + 0]; const char p1 = data_buf[i + 1]; @@ -12752,7 +12752,7 @@ int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha char *auth_ptr = (char *) zip2->auth_buf; - for (uint i = 0; i < param7_len; i += 2) + for (u32 i = 0; i < param7_len; i += 2) { const char p0 = auth[i + 0]; const char p1 = auth[i + 1]; @@ -12792,7 +12792,7 @@ int zip2_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const ha return (PARSER_OK); } -int win8phone_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) +int win8phone_parse_hash (char *input_buf, u32 input_len, hash_t *hash_buf, const hashconfig_t *hashconfig) { if ((input_len < DISPLAY_LEN_MIN_13800) || (input_len > DISPLAY_LEN_MAX_13800)) return (PARSER_GLOBAL_LENGTH); @@ -12840,7 +12840,7 @@ int win8phone_parse_hash (char *input_buf, uint input_len, hash_t *hash_buf, con * output */ -char *stroptitype (const uint opti_type) +char *stroptitype (const u32 opti_type) { switch (opti_type) { @@ -12868,7 +12868,7 @@ char *stroptitype (const uint opti_type) return (NULL); } -char *strhashtype (const uint hash_mode) +char *strhashtype (const u32 hash_mode) { switch (hash_mode) { @@ -13083,7 +13083,7 @@ char *strhashtype (const uint hash_mode) return ((char *) "Unknown"); } -char *strparser (const uint parser_status) +char *strparser (const u32 parser_status) { switch (parser_status) { @@ -13109,7 +13109,7 @@ char *strparser (const uint parser_status) return ((char *) PA_255); } -void to_hccap_t (hccap_t *hccap, const uint salt_pos, const uint digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes) +void to_hccap_t (hccap_t *hccap, const u32 salt_pos, const u32 digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes) { const void *digests_buf = hashes->digests_buf; const salt_t *salts_buf = hashes->salts_buf; @@ -13130,9 +13130,9 @@ void to_hccap_t (hccap_t *hccap, const uint salt_pos, const uint digest_pos, con if (wpa->keyver != 1) { - uint eapol_tmp[64] = { 0 }; + u32 eapol_tmp[64] = { 0 }; - for (uint i = 0; i < 64; i++) + for (u32 i = 0; i < 64; i++) { eapol_tmp[i] = byte_swap_32 (wpa->eapol[i]); } @@ -13151,13 +13151,13 @@ void to_hccap_t (hccap_t *hccap, const uint salt_pos, const uint digest_pos, con char *digests_buf_ptr = (char *) digests_buf; - uint dgst_size = hashconfig->dgst_size; + u32 dgst_size = hashconfig->dgst_size; - uint *digest_ptr = (uint *) (digests_buf_ptr + (salts_buf[salt_pos].digests_offset * dgst_size) + (digest_pos * dgst_size)); + u32 *digest_ptr = (u32 *) (digests_buf_ptr + (salts_buf[salt_pos].digests_offset * dgst_size) + (digest_pos * dgst_size)); if (wpa->keyver != 1) { - uint digest_tmp[4] = { 0 }; + u32 digest_tmp[4] = { 0 }; digest_tmp[0] = byte_swap_32 (digest_ptr[0]); digest_tmp[1] = byte_swap_32 (digest_ptr[1]); @@ -13172,7 +13172,7 @@ void to_hccap_t (hccap_t *hccap, const uint salt_pos, const uint digest_pos, con } } -void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes) +void ascii_digest (char *out_buf, const u32 salt_pos, const u32 digest_pos, const hashconfig_t *hashconfig, const hashes_t *hashes) { void *digests_buf = hashes->digests_buf; salt_t *salts_buf = hashes->salts_buf; @@ -13180,14 +13180,14 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co hashinfo_t **hash_info = hashes->hash_info; char *hashfile = hashes->hashfile; - const uint hash_type = hashconfig->hash_type; - const uint hash_mode = hashconfig->hash_mode; - const uint salt_type = hashconfig->salt_type; - const uint opts_type = hashconfig->opts_type; - const uint opti_type = hashconfig->opti_type; - const uint dgst_size = hashconfig->dgst_size; + const u32 hash_type = hashconfig->hash_type; + const u32 hash_mode = hashconfig->hash_mode; + const u32 salt_type = hashconfig->salt_type; + const u32 opts_type = hashconfig->opts_type; + const u32 opti_type = hashconfig->opti_type; + const u32 dgst_size = hashconfig->dgst_size; - uint len = 4096; + u32 len = 4096; u8 datax[256] = { 0 }; @@ -13200,7 +13200,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co if (opti_type & OPTI_TYPE_PRECOMPUTE_PERMUT) { - uint tt; + u32 tt; switch (hash_type) { @@ -13354,7 +13354,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } } - uint isSalted = ((hashconfig->salt_type == SALT_TYPE_INTERN) + u32 isSalted = ((hashconfig->salt_type == SALT_TYPE_INTERN) | (hashconfig->salt_type == SALT_TYPE_EXTERN) | (hashconfig->salt_type == SALT_TYPE_EMBEDDED)); @@ -13368,11 +13368,11 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char *ptr = (char *) salt.salt_buf; - uint len = salt.salt_len; + u32 len = salt.salt_len; if (opti_type & OPTI_TYPE_PRECOMPUTE_PERMUT) { - uint tt; + u32 tt; switch (hash_type) { @@ -13389,7 +13389,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co if (opts_type & OPTS_TYPE_ST_UNICODE) { - for (uint i = 0, j = 0; i < len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < len; i += 1, j += 2) { ptr[i] = ptr[j]; } @@ -13399,11 +13399,11 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co if (opts_type & OPTS_TYPE_ST_GENERATE_LE) { - uint max = salt.salt_len / 4; + u32 max = salt.salt_len / 4; if (len % 4) max++; - for (uint i = 0; i < max; i++) + for (u32 i = 0; i < max; i++) { salt.salt_buf[i] = byte_swap_32 (salt.salt_buf[i]); } @@ -13413,7 +13413,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co { char tmp[64] = { 0 }; - for (uint i = 0, j = 0; i < len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < len; i += 1, j += 2) { sprintf (tmp + j, "%02x", (unsigned char) ptr[i]); } @@ -13423,7 +13423,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co memcpy (ptr, tmp, len); } - uint memset_size = ((48 - (int) len) > 0) ? (48 - len) : 0; + u32 memset_size = ((48 - (int) len) > 0) ? (48 - len) : 0; memset (ptr + len, 0, memset_size); @@ -13434,8 +13434,8 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // some modes require special encoding // - uint out_buf_plain[256] = { 0 }; - uint out_buf_salt[256] = { 0 }; + u32 out_buf_plain[256] = { 0 }; + u32 out_buf_salt[256] = { 0 }; char tmp_buf[1024] = { 0 }; @@ -13651,7 +13651,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 501) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -13770,7 +13770,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 1722) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; snprintf (out_buf, len-1, "%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", (unsigned char *) salt.salt_buf, @@ -13785,7 +13785,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 1731) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; snprintf (out_buf, len-1, "0x0200%s%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", (unsigned char *) salt.salt_buf, @@ -13824,20 +13824,20 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 2100) { - uint pos = 0; + u32 pos = 0; snprintf (out_buf + pos, len-1, "%s%i#", SIGNATURE_DCC2, salt.salt_iter + 1); - uint signature_len = strlen (out_buf); + u32 signature_len = strlen (out_buf); pos += signature_len; len -= signature_len; char *salt_ptr = (char *) salt.salt_buf; - for (uint i = 0; i < salt.salt_len; i++, pos++, len--) snprintf (out_buf + pos, len-1, "%c", salt_ptr[i]); + for (u32 i = 0; i < salt.salt_len; i++, pos++, len--) snprintf (out_buf + pos, len-1, "%c", salt_ptr[i]); snprintf (out_buf + pos, len-1, "#%08x%08x%08x%08x", byte_swap_32 (digest_buf[0]), @@ -13960,9 +13960,9 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // msg_buf - uint ikepsk_msg_len = ikepsk->msg_len / 4; + u32 ikepsk_msg_len = ikepsk->msg_len / 4; - for (uint i = 0; i < ikepsk_msg_len; i++) + for (u32 i = 0; i < ikepsk_msg_len; i++) { if ((i == 32) || (i == 64) || (i == 66) || (i == 68) || (i == 108)) { @@ -13980,9 +13980,9 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // nr_buf - uint ikepsk_nr_len = ikepsk->nr_len / 4; + u32 ikepsk_nr_len = ikepsk->nr_len / 4; - for (uint i = 0; i < ikepsk_nr_len; i++) + for (u32 i = 0; i < ikepsk_nr_len; i++) { if ((i == 0) || (i == 5)) { @@ -14000,7 +14000,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // digest_buf - for (uint i = 0; i < 4; i++) + for (u32 i = 0; i < 4; i++) { if (i == 0) { @@ -14026,9 +14026,9 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // msg_buf - uint ikepsk_msg_len = ikepsk->msg_len / 4; + u32 ikepsk_msg_len = ikepsk->msg_len / 4; - for (uint i = 0; i < ikepsk_msg_len; i++) + for (u32 i = 0; i < ikepsk_msg_len; i++) { if ((i == 32) || (i == 64) || (i == 66) || (i == 68) || (i == 108)) { @@ -14046,9 +14046,9 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // nr_buf - uint ikepsk_nr_len = ikepsk->nr_len / 4; + u32 ikepsk_nr_len = ikepsk->nr_len / 4; - for (uint i = 0; i < ikepsk_nr_len; i++) + for (u32 i = 0; i < ikepsk_nr_len; i++) { if ((i == 0) || (i == 5)) { @@ -14066,7 +14066,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // digest_buf - for (uint i = 0; i < 5; i++) + for (u32 i = 0; i < 5; i++) { if (i == 0) { @@ -14093,28 +14093,28 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char srvchall_buf[1024] = { 0 }; char clichall_buf[1024] = { 0 }; - for (uint i = 0, j = 0; j < netntlm->user_len; i += 1, j += 2) + for (u32 i = 0, j = 0; j < netntlm->user_len; i += 1, j += 2) { char *ptr = (char *) netntlm->userdomain_buf; user_buf[i] = ptr[j]; } - for (uint i = 0, j = 0; j < netntlm->domain_len; i += 1, j += 2) + for (u32 i = 0, j = 0; j < netntlm->domain_len; i += 1, j += 2) { char *ptr = (char *) netntlm->userdomain_buf; domain_buf[i] = ptr[netntlm->user_len + j]; } - for (uint i = 0, j = 0; i < netntlm->srvchall_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < netntlm->srvchall_len; i += 1, j += 2) { u8 *ptr = (u8 *) netntlm->chall_buf; sprintf (srvchall_buf + j, "%02x", ptr[i]); } - for (uint i = 0, j = 0; i < netntlm->clichall_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < netntlm->clichall_len; i += 1, j += 2) { u8 *ptr = (u8 *) netntlm->chall_buf; @@ -14144,28 +14144,28 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char srvchall_buf[1024] = { 0 }; char clichall_buf[1024] = { 0 }; - for (uint i = 0, j = 0; j < netntlm->user_len; i += 1, j += 2) + for (u32 i = 0, j = 0; j < netntlm->user_len; i += 1, j += 2) { char *ptr = (char *) netntlm->userdomain_buf; user_buf[i] = ptr[j]; } - for (uint i = 0, j = 0; j < netntlm->domain_len; i += 1, j += 2) + for (u32 i = 0, j = 0; j < netntlm->domain_len; i += 1, j += 2) { char *ptr = (char *) netntlm->userdomain_buf; domain_buf[i] = ptr[netntlm->user_len + j]; } - for (uint i = 0, j = 0; i < netntlm->srvchall_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < netntlm->srvchall_len; i += 1, j += 2) { u8 *ptr = (u8 *) netntlm->chall_buf; sprintf (srvchall_buf + j, "%02x", ptr[i]); } - for (uint i = 0, j = 0; i < netntlm->clichall_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < netntlm->clichall_len; i += 1, j += 2) { u8 *ptr = (u8 *) netntlm->chall_buf; @@ -14256,12 +14256,12 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co salt.salt_buf[0] = byte_swap_32 (salt.salt_buf[0]); salt.salt_buf[1] = byte_swap_32 (salt.salt_buf[1]); - uint buf_len = len - 1; + u32 buf_len = len - 1; - uint off = snprintf (out_buf, buf_len, "%d:%08x%08x:", salt.salt_iter + 1, salt.salt_buf[0], salt.salt_buf[1]); + u32 off = snprintf (out_buf, buf_len, "%d:%08x%08x:", salt.salt_iter + 1, salt.salt_buf[0], salt.salt_buf[1]); buf_len -= 22; - for (uint i = 0, j = off; i < 1040; i++, j += 2) + for (u32 i = 0, j = off; i < 1040; i++, j += 2) { snprintf (out_buf + j, buf_len, "%02x", agilekey->cipher[i]); @@ -14280,13 +14280,13 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 7100) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; pbkdf2_sha512_t *pbkdf2_sha512s = (pbkdf2_sha512_t *) esalts_buf; pbkdf2_sha512_t *pbkdf2_sha512 = &pbkdf2_sha512s[salt_pos]; - uint esalt[8] = { 0 }; + u32 esalt[8] = { 0 }; esalt[0] = byte_swap_32 (pbkdf2_sha512->salt_buf[0]); esalt[1] = byte_swap_32 (pbkdf2_sha512->salt_buf[1]); @@ -14315,13 +14315,13 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 7200) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; pbkdf2_sha512_t *pbkdf2_sha512s = (pbkdf2_sha512_t *) esalts_buf; pbkdf2_sha512_t *pbkdf2_sha512 = &pbkdf2_sha512s[salt_pos]; - uint len_used = 0; + u32 len_used = 0; snprintf (out_buf + len_used, len - len_used - 1, "%s%i.", SIGNATURE_SHA512GRUB, salt.salt_iter + 1); @@ -14329,7 +14329,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co unsigned char *salt_buf_ptr = (unsigned char *) pbkdf2_sha512->salt_buf; - for (uint i = 0; i < salt.salt_len; i++, len_used += 2) + for (u32 i = 0; i < salt.salt_len; i++, len_used += 2) { snprintf (out_buf + len_used, len - len_used - 1, "%02x", salt_buf_ptr[i]); } @@ -14350,7 +14350,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co rakp_t *rakp = &rakps[salt_pos]; - for (uint i = 0, j = 0; (i * 4) < rakp->salt_len; i += 1, j += 8) + for (u32 i = 0, j = 0; (i * 4) < rakp->salt_len; i += 1, j += 8) { sprintf (out_buf + j, "%08x", rakp->salt_buf[i]); } @@ -14399,12 +14399,12 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char *ptr_data = data; - for (uint i = 0; i < 36; i++, ptr_data += 2) + for (u32 i = 0; i < 36; i++, ptr_data += 2) { sprintf (ptr_data, "%02x", ptr_timestamp[i]); } - for (uint i = 0; i < 16; i++, ptr_data += 2) + for (u32 i = 0; i < 16; i++, ptr_data += 2) { sprintf (ptr_data, "%02x", ptr_checksum[i]); } @@ -14538,13 +14538,13 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co // domain - const uint salt_pc_len = salt.salt_buf_pc[7]; // what a hack + const u32 salt_pc_len = salt.salt_buf_pc[7]; // what a hack char domain_buf_c[33] = { 0 }; memcpy (domain_buf_c, (char *) salt.salt_buf_pc, salt_pc_len); - for (uint i = 0; i < salt_pc_len; i++) + for (u32 i = 0; i < salt_pc_len; i++) { const char next = domain_buf_c[i]; @@ -14595,7 +14595,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char tmp[3073] = { 0 }; - for (uint i = 0, j = 0; i < 384; i += 1, j += 8) + for (u32 i = 0, j = 0; i < 384; i += 1, j += 8) { sprintf (tmp + j, "%08x", androidfde->data[i]); } @@ -14616,9 +14616,9 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 8900) { - uint N = salt.scrypt_N; - uint r = salt.scrypt_r; - uint p = salt.scrypt_p; + u32 N = salt.scrypt_N; + u32 r = salt.scrypt_r; + u32 p = salt.scrypt_p; char base64_salt[32] = { 0 }; @@ -14979,7 +14979,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char tmp_buf[100] = { 0 }; - uint tmp_len = snprintf (tmp_buf, 100, "%s %08x%08x%08x%08x", + u32 tmp_len = snprintf (tmp_buf, 100, "%s %08x%08x%08x%08x", (char *) cram_md5->user, digest_buf[0], digest_buf[1], @@ -14999,7 +14999,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co memcpy (tmp_buf + 0, digest_buf, 20); memcpy (tmp_buf + 20, salt.salt_buf, salt.salt_len); - uint tmp_len = 20 + salt.salt_len; + u32 tmp_len = 20 + salt.salt_len; // base64 encode it @@ -15211,7 +15211,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 10600) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15220,7 +15220,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 10700) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15229,7 +15229,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 10900) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15270,29 +15270,29 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co bitcoin_wallet_t *bitcoin_wallet = &bitcoin_wallets[salt_pos]; - const uint cry_master_len = bitcoin_wallet->cry_master_len; - const uint ckey_len = bitcoin_wallet->ckey_len; - const uint public_key_len = bitcoin_wallet->public_key_len; + const u32 cry_master_len = bitcoin_wallet->cry_master_len; + const u32 ckey_len = bitcoin_wallet->ckey_len; + const u32 public_key_len = bitcoin_wallet->public_key_len; char *cry_master_buf = (char *) mymalloc ((cry_master_len * 2) + 1); char *ckey_buf = (char *) mymalloc ((ckey_len * 2) + 1); char *public_key_buf = (char *) mymalloc ((public_key_len * 2) + 1); - for (uint i = 0, j = 0; i < cry_master_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < cry_master_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) bitcoin_wallet->cry_master_buf; sprintf (cry_master_buf + j, "%02x", ptr[i]); } - for (uint i = 0, j = 0; i < ckey_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < ckey_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) bitcoin_wallet->ckey_buf; sprintf (ckey_buf + j, "%02x", ptr[i]); } - for (uint i = 0, j = 0; i < public_key_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < public_key_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) bitcoin_wallet->public_key_buf; @@ -15318,7 +15318,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 11400) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15331,11 +15331,11 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co seven_zip_t *seven_zip = &seven_zips[salt_pos]; - const uint data_len = seven_zip->data_len; + const u32 data_len = seven_zip->data_len; char *data_buf = (char *) mymalloc ((data_len * 2) + 1); - for (uint i = 0, j = 0; i < data_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < data_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) seven_zip->data_buf; @@ -15394,7 +15394,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 11900) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15403,7 +15403,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 12000) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15412,7 +15412,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 12100) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15421,8 +15421,8 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 12200) { - uint *ptr_digest = digest_buf; - uint *ptr_salt = salt.salt_buf; + u32 *ptr_digest = digest_buf; + u32 *ptr_salt = salt.salt_buf; snprintf (out_buf, len-1, "%s0$1$%08x%08x$%08x%08x", SIGNATURE_ECRYPTFS, @@ -15433,8 +15433,8 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 12300) { - uint *ptr_digest = digest_buf; - uint *ptr_salt = salt.salt_buf; + u32 *ptr_digest = digest_buf; + u32 *ptr_salt = salt.salt_buf; snprintf (out_buf, len-1, "%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X%08X", ptr_digest[ 0], ptr_digest[ 1], @@ -15512,7 +15512,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_mode == 12700) { - uint digest_idx = salt.digests_offset + digest_pos; + u32 digest_idx = salt.digests_offset + digest_pos; hashinfo_t **hashinfo_ptr = hash_info; char *hash_buf = hashinfo_ptr[digest_idx]->orighash; @@ -15604,13 +15604,13 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char *ptr_data = data; - for (uint i = 0; i < 16; i++, ptr_data += 2) + for (u32 i = 0; i < 16; i++, ptr_data += 2) sprintf (ptr_data, "%02x", ptr_checksum[i]); /* skip '$' */ ptr_data++; - for (uint i = 0; i < krb5tgs->edata2_len; i++, ptr_data += 2) + for (u32 i = 0; i < krb5tgs->edata2_len; i++, ptr_data += 2) sprintf (ptr_data, "%02x", ptr_edata2[i]); snprintf (out_buf, len-1, "%s$%s$%s$%s", @@ -15695,19 +15695,19 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co *ptr_data = '*'; ptr_data++; - for (uint i = 0; i < final_random_seed_len; i++, ptr_data += 8) + for (u32 i = 0; i < final_random_seed_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_final_random_seed[i]); *ptr_data = '*'; ptr_data++; - for (uint i = 0; i < transf_random_seed_len; i++, ptr_data += 8) + for (u32 i = 0; i < transf_random_seed_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_transf_random_seed[i]); *ptr_data = '*'; ptr_data++; - for (uint i = 0; i < enc_iv_len; i++, ptr_data += 8) + for (u32 i = 0; i < enc_iv_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_enc_iv[i]); *ptr_data = '*'; @@ -15718,7 +15718,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co contents_len = (u32) keepass->contents_len; ptr_contents = (u32 *) keepass->contents; - for (uint i = 0; i < contents_hash_len; i++, ptr_data += 8) + for (u32 i = 0; i < contents_hash_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_contents_hash[i]); *ptr_data = '*'; @@ -15742,7 +15742,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co *ptr_data = '*'; ptr_data++; - for (uint i = 0; i < contents_len / 4; i++, ptr_data += 8) + for (u32 i = 0; i < contents_len / 4; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_contents[i]); } else if (version == 2) @@ -15750,13 +15750,13 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co expected_bytes_len = 8; ptr_expected_bytes = (u32 *) keepass->expected_bytes ; - for (uint i = 0; i < expected_bytes_len; i++, ptr_data += 8) + for (u32 i = 0; i < expected_bytes_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_expected_bytes[i]); *ptr_data = '*'; ptr_data++; - for (uint i = 0; i < contents_hash_len; i++, ptr_data += 8) + for (u32 i = 0; i < contents_hash_len; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_contents_hash[i]); } if (keyfile_len) @@ -15778,7 +15778,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co *ptr_data = '*'; ptr_data++; - for (uint i = 0; i < 8; i++, ptr_data += 8) + for (u32 i = 0; i < 8; i++, ptr_data += 8) sprintf (ptr_data, "%08x", ptr_keyfile[i]); } } @@ -15792,7 +15792,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char pstoken_tmp[1024 + 1] = { 0 }; - for (uint i = 0, j = 0; i < salt_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < salt_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) pstoken->salt_buf; @@ -15817,7 +15817,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char salt_tmp[32 + 1] = { 0 }; - for (uint i = 0, j = 0; i < salt_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < salt_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) zip2->salt_buf; @@ -15828,7 +15828,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char data_tmp[8192 + 1] = { 0 }; - for (uint i = 0, j = 0; i < data_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < data_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) zip2->data_buf; @@ -15839,7 +15839,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co char auth_tmp[20 + 1] = { 0 }; - for (uint i = 0, j = 0; i < auth_len; i += 1, j += 2) + for (u32 i = 0, j = 0; i < auth_len; i += 1, j += 2) { const u8 *ptr = (const u8 *) zip2->auth_buf; @@ -15935,7 +15935,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_type == HASH_TYPE_SHA384) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; snprintf (out_buf, len-1, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", ptr[ 1], ptr[ 0], @@ -15947,7 +15947,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_type == HASH_TYPE_SHA512) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; snprintf (out_buf, len-1, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", ptr[ 1], ptr[ 0], @@ -15982,7 +15982,7 @@ void ascii_digest (char *out_buf, const uint salt_pos, const uint digest_pos, co } else if (hash_type == HASH_TYPE_KECCAK) { - uint *ptr = digest_buf; + u32 *ptr = digest_buf; snprintf (out_buf, len-1, "%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x%08x", ptr[ 1], ptr[ 0], @@ -19829,7 +19829,7 @@ int hashconfig_init (hashconfig_t *hashconfig, const user_options_t *user_option } } - const uint is_salted = ((hashconfig->salt_type == SALT_TYPE_INTERN) + const u32 is_salted = ((hashconfig->salt_type == SALT_TYPE_INTERN) | (hashconfig->salt_type == SALT_TYPE_EXTERN) | (hashconfig->salt_type == SALT_TYPE_EMBEDDED) | (hashconfig->salt_type == SALT_TYPE_VIRTUAL)); @@ -20190,7 +20190,7 @@ void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, co * special modification not set from parser */ - for (uint salts_pos = 0; salts_pos < hashes->salts_cnt; salts_pos++) + for (u32 salts_pos = 0; salts_pos < hashes->salts_cnt; salts_pos++) { switch (hashconfig->hash_mode) { @@ -20236,7 +20236,7 @@ void hashconfig_general_defaults (hashconfig_t *hashconfig, hashes_t *hashes, co { char *tcvc_keyfiles = (char *) optional_param1; - uint *keyfile_buf = ((tc_t *) esalts_buf)->keyfile_buf; + u32 *keyfile_buf = ((tc_t *) esalts_buf)->keyfile_buf; char *keyfiles = mystrdup (tcvc_keyfiles); diff --git a/src/mpsp.c b/src/mpsp.c index 8e6c6f7cc..d27e7bae9 100644 --- a/src/mpsp.c +++ b/src/mpsp.c @@ -20,7 +20,7 @@ static const char DEF_MASK[] = "?1?2?2?2?2?2?2?3?3?3?3?d?d?d?d"; #define MAX_MFS 5 // 4*charset, 1*mask -void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHARSIZ]) +void mp_css_to_uniq_tbl (u32 css_cnt, cs_t *css, u32 uniq_tbls[SP_PW_MAX][CHARSIZ]) { /* generates a lookup table where key is the char itself for fastest possible lookup performance */ @@ -31,44 +31,44 @@ void mp_css_to_uniq_tbl (uint css_cnt, cs_t *css, uint uniq_tbls[SP_PW_MAX][CHAR exit (-1); } - for (uint css_pos = 0; css_pos < css_cnt; css_pos++) + for (u32 css_pos = 0; css_pos < css_cnt; css_pos++) { - uint *uniq_tbl = uniq_tbls[css_pos]; + u32 *uniq_tbl = uniq_tbls[css_pos]; - uint *cs_buf = css[css_pos].cs_buf; - uint cs_len = css[css_pos].cs_len; + u32 *cs_buf = css[css_pos].cs_buf; + u32 cs_len = css[css_pos].cs_len; - for (uint cs_pos = 0; cs_pos < cs_len; cs_pos++) + for (u32 cs_pos = 0; cs_pos < cs_len; cs_pos++) { - uint c = cs_buf[cs_pos] & 0xff; + u32 c = cs_buf[cs_pos] & 0xff; uniq_tbl[c] = 1; } } } -static void mp_add_cs_buf (uint *in_buf, size_t in_len, cs_t *css, uint css_cnt, const hashconfig_t *hashconfig) +static void mp_add_cs_buf (u32 *in_buf, size_t in_len, cs_t *css, u32 css_cnt, const hashconfig_t *hashconfig) { cs_t *cs = &css[css_cnt]; - size_t css_uniq_sz = CHARSIZ * sizeof (uint); + size_t css_uniq_sz = CHARSIZ * sizeof (u32); - uint *css_uniq = (uint *) mymalloc (css_uniq_sz); + u32 *css_uniq = (u32 *) mymalloc (css_uniq_sz); size_t i; for (i = 0; i < cs->cs_len; i++) { - const uint u = cs->cs_buf[i]; + const u32 u = cs->cs_buf[i]; css_uniq[u] = 1; } for (i = 0; i < in_len; i++) { - uint u = in_buf[i] & 0xff; + u32 u = in_buf[i] & 0xff; - if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER) u = (uint) toupper (u); + if (hashconfig->opts_type & OPTS_TYPE_PT_UPPER) u = (u32) toupper (u); if (css_uniq[u] == 1) continue; @@ -82,13 +82,13 @@ static void mp_add_cs_buf (uint *in_buf, size_t in_len, cs_t *css, uint css_cnt, myfree (css_uniq); } -static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, uint mp_usr_offset, int interpret, const hashconfig_t *hashconfig, const user_options_t *user_options) +static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, u32 mp_usr_offset, int interpret, const hashconfig_t *hashconfig, const user_options_t *user_options) { size_t in_pos; for (in_pos = 0; in_pos < in_len; in_pos++) { - uint p0 = in_buf[in_pos] & 0xff; + u32 p0 = in_buf[in_pos] & 0xff; if (interpret == 1 && p0 == '?') { @@ -96,7 +96,7 @@ static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, if (in_pos == in_len) break; - uint p1 = in_buf[in_pos] & 0xff; + u32 p1 = in_buf[in_pos] & 0xff; switch (p1) { @@ -143,7 +143,7 @@ static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, exit (-1); } - uint p1 = in_buf[in_pos] & 0xff; + u32 p1 = in_buf[in_pos] & 0xff; if ((is_valid_hex_char ((u8) p0) == false) || (is_valid_hex_char ((u8) p1) == false)) { @@ -152,16 +152,16 @@ static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, exit (-1); } - uint chr = 0; + u32 chr = 0; - chr = (uint) hex_convert ((u8) p1) << 0; - chr |= (uint) hex_convert ((u8) p0) << 4; + chr = (u32) hex_convert ((u8) p1) << 0; + chr |= (u32) hex_convert ((u8) p0) << 4; mp_add_cs_buf (&chr, 1, mp_usr, mp_usr_offset, hashconfig); } else { - uint chr = p0; + u32 chr = p0; mp_add_cs_buf (&chr, 1, mp_usr, mp_usr_offset, hashconfig); } @@ -169,11 +169,11 @@ static void mp_expand (char *in_buf, size_t in_len, cs_t *mp_sys, cs_t *mp_usr, } } -u64 mp_get_sum (uint css_cnt, cs_t *css) +u64 mp_get_sum (u32 css_cnt, cs_t *css) { u64 sum = 1; - for (uint css_pos = 0; css_pos < css_cnt; css_pos++) + for (u32 css_pos = 0; css_pos < css_cnt; css_pos++) { sum *= css[css_pos].cs_len; } @@ -181,12 +181,12 @@ u64 mp_get_sum (uint css_cnt, cs_t *css) return (sum); } -cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, uint *css_cnt, const hashconfig_t *hashconfig, const user_options_t *user_options) +cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, u32 *css_cnt, const hashconfig_t *hashconfig, const user_options_t *user_options) { cs_t *css = (cs_t *) mycalloc (256, sizeof (cs_t)); - uint mask_pos; - uint css_pos; + u32 mask_pos; + u32 css_pos; for (mask_pos = 0, css_pos = 0; mask_pos < mask_len; mask_pos++, css_pos++) { @@ -200,7 +200,7 @@ cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, u char p1 = mask_buf[mask_pos]; - uint chr = (uint) p1; + u32 chr = (u32) p1; switch (p1) { @@ -260,16 +260,16 @@ cs_t *mp_gen_css (char *mask_buf, size_t mask_len, cs_t *mp_sys, cs_t *mp_usr, u exit (-1); } - uint chr = 0; + u32 chr = 0; - chr |= (uint) hex_convert ((u8) p1) << 0; - chr |= (uint) hex_convert ((u8) p0) << 4; + chr |= (u32) hex_convert ((u8) p1) << 0; + chr |= (u32) hex_convert ((u8) p0) << 4; mp_add_cs_buf (&chr, 1, css, css_pos, hashconfig); } else { - uint chr = (uint) p0; + u32 chr = (u32) p0; mp_add_cs_buf (&chr, 1, css, css_pos, hashconfig); } @@ -300,13 +300,13 @@ void mp_exec (u64 val, char *buf, cs_t *css, int css_cnt) } } -uint mp_get_length (char *mask) +u32 mp_get_length (char *mask) { - uint len = 0; + u32 len = 0; - uint mask_len = strlen (mask); + u32 mask_len = strlen (mask); - for (uint i = 0; i < mask_len; i++) + for (u32 i = 0; i < mask_len; i++) { if (mask[i] == '?') i++; @@ -316,11 +316,11 @@ uint mp_get_length (char *mask) return len; } -void mp_cut_at (char *mask, uint max) +void mp_cut_at (char *mask, u32 max) { - uint i; - uint j; - uint mask_len = strlen (mask); + u32 i; + u32 j; + u32 mask_len = strlen (mask); for (i = 0, j = 0; i < mask_len && j < max; i++, j++) { @@ -332,9 +332,9 @@ void mp_cut_at (char *mask, uint max) void mp_setup_sys (cs_t *mp_sys) { - uint pos; - uint chr; - uint donec[CHARSIZ] = { 0 }; + u32 pos; + u32 chr; + u32 donec[CHARSIZ] = { 0 }; for (pos = 0, chr = 'a'; chr <= 'z'; chr++) { donec[chr] = 1; mp_sys[0].cs_buf[pos++] = chr; @@ -359,7 +359,7 @@ void mp_setup_sys (cs_t *mp_sys) mp_sys[5].cs_len = pos; } } -void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index, const hashconfig_t *hashconfig, const user_options_t *user_options) +void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, u32 index, const hashconfig_t *hashconfig, const user_options_t *user_options) { FILE *fp = fopen (buf, "rb"); @@ -390,20 +390,20 @@ void mp_setup_usr (cs_t *mp_sys, cs_t *mp_usr, char *buf, uint index, const hash } } -void mp_reset_usr (cs_t *mp_usr, uint index) +void mp_reset_usr (cs_t *mp_usr, u32 index) { mp_usr[index].cs_len = 0; memset (mp_usr[index].cs_buf, 0, sizeof (mp_usr[index].cs_buf)); } -static char *mp_get_truncated_mask (const char *mask_buf, const size_t mask_len, const uint len, const user_options_t *user_options) +static char *mp_get_truncated_mask (const char *mask_buf, const size_t mask_len, const u32 len, const user_options_t *user_options) { char *new_mask_buf = (char *) mymalloc (256); - uint mask_pos; + u32 mask_pos; - uint css_pos; + u32 css_pos; for (mask_pos = 0, css_pos = 0; mask_pos < mask_len; mask_pos++, css_pos++) { @@ -457,11 +457,11 @@ static char *mp_get_truncated_mask (const char *mask_buf, const size_t mask_len, return (NULL); } -u64 sp_get_sum (uint start, uint stop, cs_t *root_css_buf) +u64 sp_get_sum (u32 start, u32 stop, cs_t *root_css_buf) { u64 sum = 1; - uint i; + u32 i; for (i = start; i < stop; i++) { @@ -471,13 +471,13 @@ u64 sp_get_sum (uint start, uint stop, cs_t *root_css_buf) return (sum); } -void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint start, uint stop) +void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 start, u32 stop) { u64 v = ctx; cs_t *cs = &root_css_buf[start]; - uint i; + u32 i; for (i = start; i < stop; i++) { @@ -486,7 +486,7 @@ void sp_exec (u64 ctx, char *pw_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u v = d; - const uint k = cs->cs_buf[m]; + const u32 k = cs->cs_buf[m]; pw_buf[i - start] = (char) k; @@ -502,11 +502,11 @@ int sp_comp_val (const void *p1, const void *p2) return b2->val - b1->val; } -void sp_setup_tbl (const char *shared_dir, char *hcstat, uint disable, uint classic, hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf) +void sp_setup_tbl (const char *shared_dir, char *hcstat, u32 disable, u32 classic, hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf) { - uint i; - uint j; - uint k; + u32 i; + u32 j; + u32 k; /** * Initialize hcstats @@ -670,7 +670,7 @@ void sp_setup_tbl (const char *shared_dir, char *hcstat, uint disable, uint clas for (i = 0; i < SP_ROOT_CNT; i++) { - uint key = i % CHARSIZ; + u32 key = i % CHARSIZ; root_table_buf[i].key = key; root_table_buf[i].val = root_stats_buf[i]; @@ -678,7 +678,7 @@ void sp_setup_tbl (const char *shared_dir, char *hcstat, uint disable, uint clas for (i = 0; i < SP_MARKOV_CNT; i++) { - uint key = i % CHARSIZ; + u32 key = i % CHARSIZ; markov_table_buf[i].key = key; markov_table_buf[i].val = markov_stats_buf[i]; @@ -705,7 +705,7 @@ void sp_setup_tbl (const char *shared_dir, char *hcstat, uint disable, uint clas } } -void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, uint threshold, uint uniq_tbls[SP_PW_MAX][CHARSIZ]) +void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table_buf, cs_t *root_css_buf, cs_t *markov_css_buf, u32 threshold, u32 uniq_tbls[SP_PW_MAX][CHARSIZ]) { memset (root_css_buf, 0, SP_PW_MAX * sizeof (cs_t)); memset (markov_css_buf, 0, SP_PW_MAX * CHARSIZ * sizeof (cs_t)); @@ -714,15 +714,15 @@ void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table * Convert tables to css */ - for (uint i = 0; i < SP_ROOT_CNT; i++) + for (u32 i = 0; i < SP_ROOT_CNT; i++) { - uint pw_pos = i / CHARSIZ; + u32 pw_pos = i / CHARSIZ; cs_t *cs = &root_css_buf[pw_pos]; if (cs->cs_len == threshold) continue; - uint key = root_table_buf[i].key; + u32 key = root_table_buf[i].key; if (uniq_tbls[pw_pos][key] == 0) continue; @@ -735,17 +735,17 @@ void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table * Convert table to css */ - for (uint i = 0; i < SP_MARKOV_CNT; i++) + for (u32 i = 0; i < SP_MARKOV_CNT; i++) { - uint c = i / CHARSIZ; + u32 c = i / CHARSIZ; cs_t *cs = &markov_css_buf[c]; if (cs->cs_len == threshold) continue; - uint pw_pos = c / CHARSIZ; + u32 pw_pos = c / CHARSIZ; - uint key = markov_table_buf[i].key; + u32 key = markov_table_buf[i].key; if ((pw_pos + 1) < SP_PW_MAX) if (uniq_tbls[pw_pos + 1][key] == 0) continue; @@ -755,15 +755,15 @@ void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table } /* - for (uint i = 0; i < 8; i++) + for (u32 i = 0; i < 8; i++) { - for (uint j = 0x20; j < 0x80; j++) + for (u32 j = 0x20; j < 0x80; j++) { cs_t *ptr = &markov_css_buf[(i * CHARSIZ) + j]; printf ("pos:%u key:%u len:%u\n", i, j, ptr->cs_len); - for (uint k = 0; k < 10; k++) + for (u32 k = 0; k < 10; k++) { printf (" %u\n", ptr->cs_buf[k]); } @@ -774,7 +774,7 @@ void sp_tbl_to_css (hcstat_table_t *root_table_buf, hcstat_table_t *markov_table void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out) { - for (uint i = 0; i < SP_PW_MAX; i += 2) + for (u32 i = 0; i < SP_PW_MAX; i += 2) { memcpy (out, in, CHARSIZ * sizeof (hcstat_table_t)); @@ -786,7 +786,7 @@ void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out) out++; - for (uint j = 1; j < CHARSIZ; j++) + for (u32 j = 1; j < CHARSIZ; j++) { out->key = j; out->val = 0; @@ -798,21 +798,21 @@ void sp_stretch_root (hcstat_table_t *in, hcstat_table_t *out) void sp_stretch_markov (hcstat_table_t *in, hcstat_table_t *out) { - for (uint i = 0; i < SP_PW_MAX; i += 2) + for (u32 i = 0; i < SP_PW_MAX; i += 2) { memcpy (out, in, CHARSIZ * CHARSIZ * sizeof (hcstat_table_t)); out += CHARSIZ * CHARSIZ; in += CHARSIZ * CHARSIZ; - for (uint j = 0; j < CHARSIZ; j++) + for (u32 j = 0; j < CHARSIZ; j++) { out->key = 0; out->val = 1; out++; - for (uint k = 1; k < CHARSIZ; k++) + for (u32 k = 1; k < CHARSIZ; k++) { out->key = k; out->val = 0; @@ -841,7 +841,7 @@ static void mask_append (mask_ctx_t *mask_ctx, const user_options_t *user_option { if (user_options->increment == true) { - for (uint mask_len = user_options->increment_min; mask_len <= user_options->increment_max; mask_len++) + for (u32 mask_len = user_options->increment_min; mask_len <= user_options->increment_max; mask_len++) { char *mask_truncated = mp_get_truncated_mask (mask, strlen (mask), mask_len, user_options); diff --git a/src/opencl.c b/src/opencl.c index 4b5aa5331..5f782cab1 100644 --- a/src/opencl.c +++ b/src/opencl.c @@ -31,7 +31,7 @@ static const u32 full80 = 0x80808080; static double TARGET_MS_PROFILE[4] = { 2, 12, 96, 480 }; -static void generate_source_kernel_filename (const uint attack_exec, const uint attack_kern, const uint kern_type, char *shared_dir, char *source_file) +static void generate_source_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, char *shared_dir, char *source_file) { if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL) { @@ -46,7 +46,7 @@ static void generate_source_kernel_filename (const uint attack_exec, const uint snprintf (source_file, 255, "%s/OpenCL/m%05d.cl", shared_dir, (int) kern_type); } -static void generate_cached_kernel_filename (const uint attack_exec, const uint attack_kern, const uint kern_type, char *profile_dir, const char *device_name_chksum, char *cached_file) +static void generate_cached_kernel_filename (const u32 attack_exec, const u32 attack_kern, const u32 kern_type, char *profile_dir, const char *device_name_chksum, char *cached_file) { if (attack_exec == ATTACK_EXEC_INSIDE_KERNEL) { @@ -63,7 +63,7 @@ static void generate_cached_kernel_filename (const uint attack_exec, const uint } } -static void generate_source_kernel_mp_filename (const uint opti_type, const uint opts_type, char *shared_dir, char *source_file) +static void generate_source_kernel_mp_filename (const u32 opti_type, const u32 opts_type, char *shared_dir, char *source_file) { if ((opti_type & OPTI_TYPE_BRUTE_FORCE) && (opts_type & OPTS_TYPE_PT_GENERATE_BE)) { @@ -75,7 +75,7 @@ static void generate_source_kernel_mp_filename (const uint opti_type, const uint } } -static void generate_cached_kernel_mp_filename (const uint opti_type, const uint opts_type, char *profile_dir, const char *device_name_chksum, char *cached_file) +static void generate_cached_kernel_mp_filename (const u32 opti_type, const u32 opts_type, char *profile_dir, const char *device_name_chksum, char *cached_file) { if ((opti_type & OPTI_TYPE_BRUTE_FORCE) && (opts_type & OPTS_TYPE_PT_GENERATE_BE)) { @@ -87,19 +87,19 @@ static void generate_cached_kernel_mp_filename (const uint opti_type, const uint } } -static void generate_source_kernel_amp_filename (const uint attack_kern, char *shared_dir, char *source_file) +static void generate_source_kernel_amp_filename (const u32 attack_kern, char *shared_dir, char *source_file) { snprintf (source_file, 255, "%s/OpenCL/amp_a%d.cl", shared_dir, attack_kern); } -static void generate_cached_kernel_amp_filename (const uint attack_kern, char *profile_dir, const char *device_name_chksum, char *cached_file) +static void generate_cached_kernel_amp_filename (const u32 attack_kern, char *profile_dir, const char *device_name_chksum, char *cached_file) { snprintf (cached_file, 255, "%s/kernels/amp_a%d.%s.kernel", profile_dir, attack_kern, device_name_chksum); } -static uint setup_opencl_platforms_filter (const char *opencl_platforms) +static u32 setup_opencl_platforms_filter (const char *opencl_platforms) { - uint opencl_platforms_filter = 0; + u32 opencl_platforms_filter = 0; if (opencl_platforms) { @@ -277,7 +277,7 @@ int gidd_to_pw_t (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, con return 0; } -int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, hashconfig_t *hashconfig, const hashes_t *hashes, const outfile_ctx_t *outfile_ctx, status_ctx_t *status_ctx, const uint highest_pw_len, const uint pws_cnt, const uint fast_iteration, const uint salt_pos) +int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, hashconfig_t *hashconfig, const hashes_t *hashes, const outfile_ctx_t *outfile_ctx, status_ctx_t *status_ctx, const u32 highest_pw_len, const u32 pws_cnt, const u32 fast_iteration, const u32 salt_pos) { cl_int CL_err = CL_SUCCESS; @@ -294,7 +294,7 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co { if (hashconfig->opts_type & OPTS_TYPE_PT_BITSLICE) { - const uint size_tm = 32 * sizeof (bs_word_t); + const u32 size_tm = 32 * sizeof (bs_word_t); run_kernel_bzero (opencl_ctx, device_param, device_param->d_tm_c, size_tm); @@ -355,13 +355,13 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co } } - uint iter = hashes->salts_buf[salt_pos].salt_iter; + u32 iter = hashes->salts_buf[salt_pos].salt_iter; - uint loop_step = device_param->kernel_loops; + u32 loop_step = device_param->kernel_loops; - for (uint loop_pos = 0, slow_iteration = 0; loop_pos < iter; loop_pos += loop_step, slow_iteration++) + for (u32 loop_pos = 0, slow_iteration = 0; loop_pos < iter; loop_pos += loop_step, slow_iteration++) { - uint loop_left = iter - loop_pos; + u32 loop_left = iter - loop_pos; loop_left = MIN (loop_left, loop_step); @@ -425,15 +425,15 @@ int choose_kernel (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, co return 0; } -int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num, const uint event_update, const uint iteration, hashconfig_t *hashconfig, const user_options_t *user_options, status_ctx_t *status_ctx) +int run_kernel (const u32 kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u32 num, const u32 event_update, const u32 iteration, hashconfig_t *hashconfig, const user_options_t *user_options, status_ctx_t *status_ctx) { cl_int CL_err = CL_SUCCESS; - uint num_elements = num; + u32 num_elements = num; device_param->kernel_params_buf32[34] = num; - uint kernel_threads = device_param->kernel_threads; + u32 kernel_threads = device_param->kernel_threads; while (num_elements % kernel_threads) num_elements++; @@ -572,7 +572,7 @@ int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t if (event_update) { - uint exec_pos = device_param->exec_pos; + u32 exec_pos = device_param->exec_pos; device_param->exec_ms[exec_pos] = exec_us / 1000; @@ -607,11 +607,11 @@ int run_kernel (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t return 0; } -int run_kernel_mp (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num) +int run_kernel_mp (const u32 kern_run, opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u32 num) { cl_int CL_err = CL_SUCCESS; - uint num_elements = num; + u32 num_elements = num; switch (kern_run) { @@ -621,9 +621,9 @@ int run_kernel_mp (const uint kern_run, opencl_ctx_t *opencl_ctx, hc_device_para } // causes problems with special threads like in bcrypt - // const uint kernel_threads = device_param->kernel_threads; + // const u32 kernel_threads = device_param->kernel_threads; - uint kernel_threads = device_param->kernel_threads; + u32 kernel_threads = device_param->kernel_threads; while (num_elements % kernel_threads) num_elements++; @@ -706,9 +706,9 @@ int run_kernel_tm (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param) { cl_int CL_err = CL_SUCCESS; - const uint num_elements = 1024; // fixed + const u32 num_elements = 1024; // fixed - uint kernel_threads = 32; + u32 kernel_threads = 32; cl_kernel kernel = device_param->kernel_tm; @@ -745,18 +745,18 @@ int run_kernel_tm (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param) return 0; } -int run_kernel_amp (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const uint num) +int run_kernel_amp (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const u32 num) { cl_int CL_err = CL_SUCCESS; - uint num_elements = num; + u32 num_elements = num; device_param->kernel_params_amp_buf32[6] = num_elements; // causes problems with special threads like in bcrypt - // const uint kernel_threads = device_param->kernel_threads; + // const u32 kernel_threads = device_param->kernel_threads; - uint kernel_threads = device_param->kernel_threads; + u32 kernel_threads = device_param->kernel_threads; while (num_elements % kernel_threads) num_elements++; @@ -804,7 +804,7 @@ int run_kernel_amp (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, c return 0; } -int run_kernel_memset (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const uint value, const uint num) +int run_kernel_memset (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, cl_mem buf, const u32 value, const u32 num) { cl_int CL_err = CL_SUCCESS; @@ -816,9 +816,9 @@ int run_kernel_memset (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param device_param->kernel_params_memset_buf32[1] = value; device_param->kernel_params_memset_buf32[2] = num16d; - uint kernel_threads = device_param->kernel_threads; + u32 kernel_threads = device_param->kernel_threads; - uint num_elements = num16d; + u32 num_elements = num16d; while (num_elements % kernel_threads) num_elements++; @@ -893,7 +893,7 @@ int run_kernel_bzero (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, return run_kernel_memset (opencl_ctx, device_param, buf, 0, size); } -int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const combinator_ctx_t *combinator_ctx, const uint pws_cnt) +int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashconfig_t *hashconfig, const user_options_t *user_options, const user_options_extra_t *user_options_extra, const combinator_ctx_t *combinator_ctx, const u32 pws_cnt) { cl_int CL_err = CL_SUCCESS; @@ -985,7 +985,7 @@ int run_copy (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, hashcon return 0; } -int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const uint pws_cnt) +int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 pws_cnt) { combinator_ctx_t *combinator_ctx = hashcat_ctx->combinator_ctx; hashconfig_t *hashconfig = hashcat_ctx->hashconfig; @@ -1002,7 +1002,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co // init speed timer - uint speed_pos = device_param->speed_pos; + u32 speed_pos = device_param->speed_pos; #if defined (_POSIX) if (device_param->timer_speed.tv_sec == 0) @@ -1020,7 +1020,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co // find higest password length, this is for optimization stuff - uint highest_pw_len = 0; + u32 highest_pw_len = 0; if (user_options_extra->attack_kern == ATTACK_KERN_STRAIGHT) { @@ -1036,7 +1036,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co // loop start: most outer loop = salt iteration, then innerloops (if multi) - for (uint salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++) + for (u32 salt_pos = 0; salt_pos < hashes->salts_cnt; salt_pos++) { while (status_ctx->devices_status == STATUS_PAUSED) hc_sleep (1); @@ -1055,8 +1055,8 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co // iteration type - uint innerloop_step = 0; - uint innerloop_cnt = 0; + u32 innerloop_step = 0; + u32 innerloop_cnt = 0; if (hashconfig->attack_exec == ATTACK_EXEC_INSIDE_KERNEL) innerloop_step = device_param->kernel_loops; else innerloop_step = 1; @@ -1067,13 +1067,13 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co // innerloops - for (uint innerloop_pos = 0; innerloop_pos < innerloop_cnt; innerloop_pos += innerloop_step) + for (u32 innerloop_pos = 0; innerloop_pos < innerloop_cnt; innerloop_pos += innerloop_step) { while (status_ctx->devices_status == STATUS_PAUSED) hc_sleep (1); - uint fast_iteration = 0; + u32 fast_iteration = 0; - uint innerloop_left = innerloop_cnt - innerloop_pos; + u32 innerloop_left = innerloop_cnt - innerloop_pos; if (innerloop_left > innerloop_step) { @@ -1106,7 +1106,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co if (user_options->attack_mode == ATTACK_MODE_COMBI) { - uint i = 0; + u32 i = 0; while (i < innerloop_left) { @@ -1169,7 +1169,7 @@ int run_cracker (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, co i++; } - for (uint j = i; j < innerloop_left; j++) + for (u32 j = i; j < innerloop_left; j++) { device_param->combs_buf[j].i[0] = 0; device_param->combs_buf[j].i[1] = 0; @@ -1420,9 +1420,9 @@ int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_option return -1; } - if (opencl_platforms_filter != (uint) -1) + if (opencl_platforms_filter != (u32) -1) { - uint platform_cnt_mask = ~(((uint) -1 >> platforms_cnt) << platforms_cnt); + u32 platform_cnt_mask = ~(((u32) -1 >> platforms_cnt) << platforms_cnt); if (opencl_platforms_filter > platform_cnt_mask) { @@ -1441,7 +1441,7 @@ int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_option cl_device_type device_types_all = 0; - for (uint platform_id = 0; platform_id < platforms_cnt; platform_id++) + for (u32 platform_id = 0; platform_id < platforms_cnt; platform_id++) { if ((opencl_platforms_filter & (1u << platform_id)) == 0) continue; @@ -1460,7 +1460,7 @@ int opencl_ctx_init (opencl_ctx_t *opencl_ctx, const user_options_t *user_option continue; } - for (uint platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++) + for (u32 platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++) { cl_device_id device = platform_devices[platform_devices_id]; @@ -1554,7 +1554,7 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use fprintf (stdout, "OpenCL Info:\n"); } - for (uint platform_id = 0; platform_id < platforms_cnt; platform_id++) + for (u32 platform_id = 0; platform_id < platforms_cnt; platform_id++) { cl_int CL_err = CL_SUCCESS; @@ -1614,7 +1614,7 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use platform_vendor_id = VENDOR_ID_GENERIC; } - uint platform_skipped = ((opencl_ctx->opencl_platforms_filter & (1u << platform_id)) == 0); + u32 platform_skipped = ((opencl_ctx->opencl_platforms_filter & (1u << platform_id)) == 0); CL_err = hc_clGetDeviceIDs (opencl_ctx->ocl, platform, CL_DEVICE_TYPE_ALL, DEVICES_MAX, platform_devices, &platform_devices_cnt); @@ -1686,11 +1686,11 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use hc_device_param_t *devices_param = opencl_ctx->devices_param; - for (uint platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++) + for (u32 platform_devices_id = 0; platform_devices_id < platform_devices_cnt; platform_devices_id++) { size_t param_value_size = 0; - const uint device_id = devices_cnt; + const u32 device_id = devices_cnt; hc_device_param_t *device_param = &devices_param[device_id]; @@ -2133,9 +2133,9 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use snprintf (device_name_chksum, HCBUFSIZ_TINY - 1, "%u-%u-%u-%s-%s-%s-%u", 32, device_param->platform_vendor_id, device_param->vector_width, device_param->device_name, device_param->device_version, device_param->driver_version, comptime); #endif - uint device_name_digest[4] = { 0 }; + u32 device_name_digest[4] = { 0 }; - md5_64 ((uint *) device_name_chksum, device_name_digest); + md5_64 ((u32 *) device_name_chksum, device_name_digest); snprintf (device_name_chksum, HCBUFSIZ_TINY - 1, "%08x", device_name_digest[0]); @@ -2393,9 +2393,9 @@ int opencl_ctx_devices_init (opencl_ctx_t *opencl_ctx, const user_options_t *use // additional check to see if the user has chosen a device that is not within the range of available devices (i.e. larger than devices_cnt) - if (opencl_ctx->devices_filter != (uint) -1) + if (opencl_ctx->devices_filter != (u32) -1) { - const uint devices_cnt_mask = ~(((uint) -1 >> devices_cnt) << devices_cnt); + const u32 devices_cnt_mask = ~(((u32) -1 >> devices_cnt) << devices_cnt); if (opencl_ctx->devices_filter > devices_cnt_mask) { @@ -2422,7 +2422,7 @@ void opencl_ctx_devices_destroy (opencl_ctx_t *opencl_ctx) { if (opencl_ctx->enabled == false) return; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -2449,7 +2449,7 @@ void opencl_ctx_devices_update_power (opencl_ctx_t *opencl_ctx, const user_optio u32 kernel_power_all = 0; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -2485,7 +2485,7 @@ void opencl_ctx_devices_kernel_loops (opencl_ctx_t *opencl_ctx, const user_optio { if (opencl_ctx->enabled == false) return; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -2540,7 +2540,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co u32 hardware_power_all = 0; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { cl_int CL_err = CL_SUCCESS; @@ -2721,7 +2721,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co device_param->size_root_css = size_root_css; device_param->size_markov_css = size_markov_css; - size_t size_results = sizeof (uint); + size_t size_results = sizeof (u32); device_param->size_results = size_results; @@ -2731,7 +2731,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co size_t size_plains = hashes->digests_cnt * sizeof (plain_t); size_t size_salts = hashes->salts_cnt * sizeof (salt_t); size_t size_esalts = hashes->salts_cnt * hashconfig->esalt_size; - size_t size_shown = hashes->digests_cnt * sizeof (uint); + size_t size_shown = hashes->digests_cnt * sizeof (u32); size_t size_digests = hashes->digests_cnt * hashconfig->dgst_size; device_param->size_plains = size_plains; @@ -2758,7 +2758,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co const u32 scrypt_r = hashes->salts_buf[0].scrypt_r; const u32 scrypt_p = hashes->salts_buf[0].scrypt_p; - for (uint i = 1; i < hashes->salts_cnt; i++) + for (u32 i = 1; i < hashes->salts_cnt; i++) { if ((hashes->salts_buf[i].scrypt_N != scrypt_N) || (hashes->salts_buf[i].scrypt_r != scrypt_r) @@ -2774,8 +2774,8 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co hashconfig->tmp_size = scrypt_tmp_size; - uint tmto_start = 0; - uint tmto_stop = 10; + u32 tmto_start = 0; + u32 tmto_stop = 10; if (user_options->scrypt_tmto) { @@ -2813,7 +2813,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co device_param->kernel_accel_min = 1; device_param->kernel_accel_max = 8; - uint tmto; + u32 tmto; for (tmto = tmto_start; tmto < tmto_stop; tmto++) { @@ -2837,7 +2837,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co continue; } - for (uint salts_pos = 0; salts_pos < hashes->salts_cnt; salts_pos++) + for (u32 salts_pos = 0; salts_pos < hashes->salts_cnt; salts_pos++) { scrypt_tmto_final = tmto; } @@ -3692,10 +3692,10 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co if (user_options->benchmark == true) { - ((uint *) hashes->digests_buf)[0] = -1u; - ((uint *) hashes->digests_buf)[1] = -1u; - ((uint *) hashes->digests_buf)[2] = -1u; - ((uint *) hashes->digests_buf)[3] = -1u; + ((u32 *) hashes->digests_buf)[0] = -1u; + ((u32 *) hashes->digests_buf)[1] = -1u; + ((u32 *) hashes->digests_buf)[2] = -1u; + ((u32 *) hashes->digests_buf)[3] = -1u; } /** @@ -4170,7 +4170,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co return -1; } - for (uint i = 0; i <= 23; i++) + for (u32 i = 0; i <= 23; i++) { CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel1, i, sizeof (cl_mem), device_param->kernel_params[i]); CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel2, i, sizeof (cl_mem), device_param->kernel_params[i]); @@ -4187,7 +4187,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co } } - for (uint i = 24; i <= 34; i++) + for (u32 i = 24; i <= 34; i++) { CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel1, i, sizeof (cl_uint), device_param->kernel_params[i]); CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel2, i, sizeof (cl_uint), device_param->kernel_params[i]); @@ -4344,7 +4344,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co } else { - for (uint i = 0; i < 5; i++) + for (u32 i = 0; i < 5; i++) { CL_err = hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_amp, i, sizeof (cl_mem), device_param->kernel_params_amp[i]); @@ -4356,7 +4356,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co } } - for (uint i = 5; i < 7; i++) + for (u32 i = 5; i < 7; i++) { CL_err = hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_amp, i, sizeof (cl_uint), device_param->kernel_params_amp[i]); @@ -4431,7 +4431,7 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co device_param->kernel_params_mp_buf32[7] = 0; } - for (uint i = 0; i < 3; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp, i, sizeof (cl_mem), (void *) device_param->kernel_params_mp[i]); + for (u32 i = 0; i < 3; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp, i, sizeof (cl_mem), (void *) device_param->kernel_params_mp[i]); if (CL_err != CL_SUCCESS) { @@ -4455,8 +4455,8 @@ int opencl_session_begin (opencl_ctx_t *opencl_ctx, hashconfig_t *hashconfig, co if (hashconfig->opts_type & OPTS_TYPE_PT_ADDBITS14) device_param->kernel_params_mp_l_buf32[7] = 1; if (hashconfig->opts_type & OPTS_TYPE_PT_ADDBITS15) device_param->kernel_params_mp_l_buf32[8] = 1; - for (uint i = 0; i < 3; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_l, i, sizeof (cl_mem), (void *) device_param->kernel_params_mp_l[i]); - for (uint i = 0; i < 3; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_r, i, sizeof (cl_mem), (void *) device_param->kernel_params_mp_r[i]); + for (u32 i = 0; i < 3; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_l, i, sizeof (cl_mem), (void *) device_param->kernel_params_mp_l[i]); + for (u32 i = 0; i < 3; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_r, i, sizeof (cl_mem), (void *) device_param->kernel_params_mp_r[i]); if (CL_err != CL_SUCCESS) { @@ -4476,7 +4476,7 @@ void opencl_session_destroy (opencl_ctx_t *opencl_ctx) { if (opencl_ctx->enabled == false) return; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -4603,7 +4603,7 @@ void opencl_session_reset (opencl_ctx_t *opencl_ctx) { if (opencl_ctx->enabled == false) return; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -4641,7 +4641,7 @@ int opencl_session_update_combinator (opencl_ctx_t *opencl_ctx, const hashconfig { if (opencl_ctx->enabled == false) return 0; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -4691,7 +4691,7 @@ int opencl_session_update_mp (opencl_ctx_t *opencl_ctx, const mask_ctx_t *mask_c { if (opencl_ctx->enabled == false) return 0; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -4702,8 +4702,8 @@ int opencl_session_update_mp (opencl_ctx_t *opencl_ctx, const mask_ctx_t *mask_c cl_int CL_err = CL_SUCCESS; - for (uint i = 3; i < 4; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp, i, sizeof (cl_ulong), (void *) device_param->kernel_params_mp[i]); - for (uint i = 4; i < 8; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp, i, sizeof (cl_uint), (void *) device_param->kernel_params_mp[i]); + for (u32 i = 3; i < 4; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp, i, sizeof (cl_ulong), (void *) device_param->kernel_params_mp[i]); + for (u32 i = 4; i < 8; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp, i, sizeof (cl_uint), (void *) device_param->kernel_params_mp[i]); if (CL_err != CL_SUCCESS) { @@ -4730,7 +4730,7 @@ int opencl_session_update_mp_rl (opencl_ctx_t *opencl_ctx, const mask_ctx_t *mas { if (opencl_ctx->enabled == false) return 0; - for (uint device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) + for (u32 device_id = 0; device_id < opencl_ctx->devices_cnt; device_id++) { hc_device_param_t *device_param = &opencl_ctx->devices_param[device_id]; @@ -4745,11 +4745,11 @@ int opencl_session_update_mp_rl (opencl_ctx_t *opencl_ctx, const mask_ctx_t *mas cl_int CL_err = CL_SUCCESS; - for (uint i = 3; i < 4; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_l, i, sizeof (cl_ulong), (void *) device_param->kernel_params_mp_l[i]); - for (uint i = 4; i < 9; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_l, i, sizeof (cl_uint), (void *) device_param->kernel_params_mp_l[i]); + for (u32 i = 3; i < 4; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_l, i, sizeof (cl_ulong), (void *) device_param->kernel_params_mp_l[i]); + for (u32 i = 4; i < 9; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_l, i, sizeof (cl_uint), (void *) device_param->kernel_params_mp_l[i]); - for (uint i = 3; i < 4; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_r, i, sizeof (cl_ulong), (void *) device_param->kernel_params_mp_r[i]); - for (uint i = 4; i < 8; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_r, i, sizeof (cl_uint), (void *) device_param->kernel_params_mp_r[i]); + for (u32 i = 3; i < 4; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_r, i, sizeof (cl_ulong), (void *) device_param->kernel_params_mp_r[i]); + for (u32 i = 4; i < 8; i++) CL_err |= hc_clSetKernelArg (opencl_ctx->ocl, device_param->kernel_mp_r, i, sizeof (cl_uint), (void *) device_param->kernel_params_mp_r[i]); if (CL_err != CL_SUCCESS) { diff --git a/src/outfile.c b/src/outfile.c index dadda5bc0..e47147d58 100644 --- a/src/outfile.c +++ b/src/outfile.c @@ -33,13 +33,13 @@ void outfile_destroy (outfile_ctx_t *outfile_ctx) memset (outfile_ctx, 0, sizeof (outfile_ctx_t)); } -void outfile_format_plain (outfile_ctx_t *outfile_ctx, const unsigned char *plain_ptr, const uint plain_len) +void outfile_format_plain (outfile_ctx_t *outfile_ctx, const unsigned char *plain_ptr, const u32 plain_len) { bool needs_hexify = false; if (outfile_ctx->outfile_autohex == true) { - for (uint i = 0; i < plain_len; i++) + for (u32 i = 0; i < plain_len; i++) { if (plain_ptr[i] < 0x20) { @@ -61,7 +61,7 @@ void outfile_format_plain (outfile_ctx_t *outfile_ctx, const unsigned char *plai { fprintf (outfile_ctx->fp, "$HEX["); - for (uint i = 0; i < plain_len; i++) + for (u32 i = 0; i < plain_len; i++) { fprintf (outfile_ctx->fp, "%02x", plain_ptr[i]); } @@ -96,7 +96,7 @@ void outfile_write_close (outfile_ctx_t *outfile_ctx) fclose (outfile_ctx->fp); } -void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsigned char *plain_ptr, const uint plain_len, const u64 crackpos, const unsigned char *username, const uint user_len, const hashconfig_t *hashconfig) +void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsigned char *plain_ptr, const u32 plain_len, const u64 crackpos, const unsigned char *username, const u32 user_len, const hashconfig_t *hashconfig) { if (outfile_ctx->outfile_format & OUTFILE_FMT_HASH) { @@ -111,7 +111,7 @@ void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsig { if (username != NULL) { - for (uint i = 0; i < user_len; i++) + for (u32 i = 0; i < user_len; i++) { fprintf (outfile_ctx->fp, "%c", username[i]); } @@ -135,7 +135,7 @@ void outfile_write (outfile_ctx_t *outfile_ctx, const char *out_buf, const unsig if (outfile_ctx->outfile_format & OUTFILE_FMT_HEXPLAIN) { - for (uint i = 0; i < plain_len; i++) + for (u32 i = 0; i < plain_len; i++) { fprintf (outfile_ctx->fp, "%02x", plain_ptr[i]); } diff --git a/src/potfile.c b/src/potfile.c index bd6f12b00..361d79604 100644 --- a/src/potfile.c +++ b/src/potfile.c @@ -50,7 +50,7 @@ int sort_by_salt_buf (const void *v1, const void *v2, void *v3) const salt_t *s1 = h1->salt; const salt_t *s2 = h2->salt; - uint n = 16; + u32 n = 16; while (n--) { @@ -70,7 +70,7 @@ int sort_by_hash_t_salt (const void *v1, const void *v2) const salt_t *s2 = h2->salt; // testphase: this should work - uint n = 16; + u32 n = 16; while (n--) { @@ -79,11 +79,11 @@ int sort_by_hash_t_salt (const void *v1, const void *v2) } /* original code, seems buggy since salt_len can be very big (had a case with 131 len) - also it thinks salt_buf[x] is a char but its a uint so salt_len should be / 4 + also it thinks salt_buf[x] is a char but its a u32 so salt_len should be / 4 if (s1->salt_len > s2->salt_len) return ( 1); if (s1->salt_len < s2->salt_len) return -1; - uint n = s1->salt_len; + u32 n = s1->salt_len; while (n--) { @@ -105,7 +105,7 @@ int sort_by_hash_t_salt_hccap (const void *v1, const void *v2) // last 2: salt_buf[10] and salt_buf[11] contain the digest (skip them) - uint n = 9; // 9 * 4 = 36 bytes (max length of ESSID) + u32 n = 9; // 9 * 4 = 36 bytes (max length of ESSID) while (n--) { @@ -186,13 +186,13 @@ void potfile_destroy (potfile_ctx_t *potfile_ctx) memset (potfile_ctx, 0, sizeof (potfile_ctx_t)); } -void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plain_ptr, const uint plain_len) +void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plain_ptr, const u32 plain_len) { if (potfile_ctx->enabled == false) return; bool needs_hexify = false; - for (uint i = 0; i < plain_len; i++) + for (u32 i = 0; i < plain_len; i++) { if (plain_ptr[i] < 0x20) { @@ -213,7 +213,7 @@ void potfile_format_plain (potfile_ctx_t *potfile_ctx, const unsigned char *plai { fprintf (potfile_ctx->fp, "$HEX["); - for (uint i = 0; i < plain_len; i++) + for (u32 i = 0; i < plain_len; i++) { fprintf (potfile_ctx->fp, "%02x", plain_ptr[i]); } @@ -256,7 +256,7 @@ void potfile_read_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashcon char *line_buf = (char *) mymalloc (HCBUFSIZ_LARGE); - for (uint line_num = 0; line_num < potfile_ctx->pot_avail; line_num++) + for (u32 line_num = 0; line_num < potfile_ctx->pot_avail; line_num++) { int line_len = fgetl (potfile_ctx->fp, line_buf); @@ -396,11 +396,11 @@ void potfile_write_append (potfile_ctx_t *potfile_ctx, const char *out_buf, u8 * fflush (fp); } -void potfile_hash_alloc (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const uint num) +void potfile_hash_alloc (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconfig, const u32 num) { if (potfile_ctx->enabled == false) return; - uint pos = 0; + u32 pos = 0; for (pos = 0; pos < num; pos++) { @@ -430,7 +430,7 @@ void potfile_hash_free (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashconf { if (potfile_ctx->enabled == false) return; - for (uint i = 0; i < potfile_ctx->pot_cnt; i++) + for (u32 i = 0; i < potfile_ctx->pot_cnt; i++) { pot_t *pot_ptr = &potfile_ctx->pot[i]; @@ -471,7 +471,7 @@ void potfile_show_request (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashc // user unsigned char *username = NULL; - uint user_len = 0; + u32 user_len = 0; if (hashes_buf->hash_info) { @@ -526,7 +526,7 @@ void potfile_show_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *ha // right - uint weak_hash_found = 0; + u32 weak_hash_found = 0; pot_t pot_right_key; @@ -568,7 +568,7 @@ void potfile_show_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *ha // user unsigned char *username = NULL; - uint user_len = 0; + u32 user_len = 0; if (hash_left->hash_info) { @@ -584,10 +584,10 @@ void potfile_show_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *ha // mask the part which was not found - uint left_part_masked = 0; - uint right_part_masked = 0; + u32 left_part_masked = 0; + u32 right_part_masked = 0; - uint mask_plain_len = strlen (LM_MASKED_PLAIN); + u32 mask_plain_len = strlen (LM_MASKED_PLAIN); if (pot_left_ptr == NULL) { @@ -653,7 +653,7 @@ void potfile_left_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *ha pot_t *pot_right_ptr = (pot_t *) hc_bsearch_r (&pot_right_key, potfile_ctx->pot, potfile_ctx->pot_cnt, sizeof (pot_t), sort_by_pot, (void *) hashconfig); - uint weak_hash_found = 0; + u32 weak_hash_found = 0; if (pot_right_ptr == NULL) { @@ -684,7 +684,7 @@ void potfile_left_request_lm (potfile_ctx_t *potfile_ctx, const hashconfig_t *ha // only show the hash part which is still not cracked - uint user_len = (uint)input_len - 32u; + u32 user_len = (u32)input_len - 32u; char *hash_output = (char *) mymalloc (33); @@ -720,7 +720,7 @@ int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashco if (potfile_ctx->enabled == false) return 0; hash_t *hashes_buf = hashes->hashes_buf; - uint hashes_cnt = hashes->hashes_cnt; + u32 hashes_cnt = hashes->hashes_cnt; // no solution for these special hash types (for instane because they use hashfile in output etc) @@ -798,7 +798,7 @@ int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashco if (hashconfig->hash_mode == 6800) { - if (i < 64) // 64 = 16 * uint in salt_buf[] + if (i < 64) // 64 = 16 * u32 in salt_buf[] { // manipulate salt_buf memcpy (hash_buf.salt->salt_buf, line_buf, i); @@ -810,7 +810,7 @@ int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashco } else if (hashconfig->hash_mode == 2500) { - if (i < 64) // 64 = 16 * uint in salt_buf[] + if (i < 64) // 64 = 16 * u32 in salt_buf[] { // here we have in line_buf: ESSID:MAC1:MAC2 (without the plain) // manipulate salt_buf @@ -836,7 +836,7 @@ int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashco if (strlen (mac1_pos) != 12) continue; - uint essid_length = mac1_pos - line_buf_cpy - 1; + u32 essid_length = mac1_pos - line_buf_cpy - 1; // here we need the ESSID memcpy (hash_buf.salt->salt_buf, line_buf_cpy, essid_length); @@ -851,7 +851,7 @@ int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashco // compare hex string(s) vs binary MAC address(es) - for (uint i = 0, j = 0; i < 6; i++, j += 2) + for (u32 i = 0, j = 0; i < 6; i++, j += 2) { if (wpa->orig_mac1[i] != hex_to_u8 ((const u8 *) &mac1_pos[j])) { @@ -864,7 +864,7 @@ int potfile_remove_parse (potfile_ctx_t *potfile_ctx, const hashconfig_t *hashco // early skip ;) if (!found) continue; - for (uint i = 0, j = 0; i < 6; i++, j += 2) + for (u32 i = 0, j = 0; i < 6; i++, j += 2) { if (wpa->orig_mac2[i] != hex_to_u8 ((const u8 *) &mac2_pos[j])) { diff --git a/src/rp.c b/src/rp.c index 15f533656..ca537823b 100644 --- a/src/rp.c +++ b/src/rp.c @@ -262,10 +262,10 @@ int generate_random_rule (char rule_buf[RP_RULE_BUFSIZ], const u32 rp_gen_func_m #define GET_P0_CONV(rule) INCR_POS; rule_buf[rule_pos] = conv_itoc (((rule)->cmds[rule_cnt] >> 8) & 0xff) #define GET_P1_CONV(rule) INCR_POS; rule_buf[rule_pos] = conv_itoc (((rule)->cmds[rule_cnt] >> 16) & 0xff) -int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule) +int cpu_rule_to_kernel_rule (char *rule_buf, u32 rule_len, kernel_rule_t *rule) { - uint rule_pos; - uint rule_cnt; + u32 rule_pos; + u32 rule_cnt; for (rule_pos = 0, rule_cnt = 0; rule_pos < rule_len && rule_cnt < MAX_KERNEL_RULES; rule_pos++, rule_cnt++) { @@ -479,9 +479,9 @@ int cpu_rule_to_kernel_rule (char *rule_buf, uint rule_len, kernel_rule_t *rule) int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule) { - uint rule_cnt; - uint rule_pos; - uint rule_len = HCBUFSIZ_LARGE - 1; // maximum possible len + u32 rule_cnt; + u32 rule_pos; + u32 rule_len = HCBUFSIZ_LARGE - 1; // maximum possible len char rule_cmd; @@ -703,7 +703,7 @@ int kernel_rule_to_cpu_rule (char *rule_buf, kernel_rule_t *rule) bool kernel_rules_has_noop (const kernel_rule_t *kernel_rules_buf, const u32 kernel_rules_cnt) { - for (uint kernel_rules_pos = 0; kernel_rules_pos < kernel_rules_cnt; kernel_rules_pos++) + for (u32 kernel_rules_pos = 0; kernel_rules_pos < kernel_rules_cnt; kernel_rules_pos++) { if (kernel_rules_buf[kernel_rules_pos].cmds[0] != RULE_OP_MANGLE_NOOP) continue; if (kernel_rules_buf[kernel_rules_pos].cmds[1] != 0) continue; @@ -720,13 +720,13 @@ int kernel_rules_load (kernel_rule_t **out_buf, u32 *out_cnt, const user_options * load rules */ - uint *all_kernel_rules_cnt = NULL; + u32 *all_kernel_rules_cnt = NULL; kernel_rule_t **all_kernel_rules_buf = NULL; if (user_options->rp_files_cnt) { - all_kernel_rules_cnt = (uint *) mycalloc (user_options->rp_files_cnt, sizeof (uint)); + all_kernel_rules_cnt = (u32 *) mycalloc (user_options->rp_files_cnt, sizeof (u32)); all_kernel_rules_buf = (kernel_rule_t **) mycalloc (user_options->rp_files_cnt, sizeof (kernel_rule_t *)); } @@ -735,11 +735,11 @@ int kernel_rules_load (kernel_rule_t **out_buf, u32 *out_cnt, const user_options int rule_len = 0; - for (uint i = 0; i < user_options->rp_files_cnt; i++) + for (u32 i = 0; i < user_options->rp_files_cnt; i++) { - uint kernel_rules_avail = 0; + u32 kernel_rules_avail = 0; - uint kernel_rules_cnt = 0; + u32 kernel_rules_cnt = 0; kernel_rule_t *kernel_rules_buf = NULL; @@ -750,7 +750,7 @@ int kernel_rules_load (kernel_rule_t **out_buf, u32 *out_cnt, const user_options FILE *fp = NULL; - uint rule_line = 0; + u32 rule_line = 0; if ((fp = fopen (rp_file, "rb")) == NULL) { @@ -812,13 +812,13 @@ int kernel_rules_load (kernel_rule_t **out_buf, u32 *out_cnt, const user_options * merge rules */ - uint kernel_rules_cnt = 1; + u32 kernel_rules_cnt = 1; - uint *repeats = (uint *) mycalloc (user_options->rp_files_cnt + 1, sizeof (uint)); + u32 *repeats = (u32 *) mycalloc (user_options->rp_files_cnt + 1, sizeof (u32)); repeats[0] = kernel_rules_cnt; - for (uint i = 0; i < user_options->rp_files_cnt; i++) + for (u32 i = 0; i < user_options->rp_files_cnt; i++) { kernel_rules_cnt *= all_kernel_rules_cnt[i]; @@ -827,16 +827,16 @@ int kernel_rules_load (kernel_rule_t **out_buf, u32 *out_cnt, const user_options kernel_rule_t *kernel_rules_buf = (kernel_rule_t *) mycalloc (kernel_rules_cnt, sizeof (kernel_rule_t)); - for (uint i = 0; i < kernel_rules_cnt; i++) + for (u32 i = 0; i < kernel_rules_cnt; i++) { - uint out_pos = 0; + u32 out_pos = 0; kernel_rule_t *out = &kernel_rules_buf[i]; - for (uint j = 0; j < user_options->rp_files_cnt; j++) + for (u32 j = 0; j < user_options->rp_files_cnt; j++) { - uint in_off = (i / repeats[j]) % all_kernel_rules_cnt[j]; - uint in_pos; + u32 in_off = (i / repeats[j]) % all_kernel_rules_cnt[j]; + u32 in_pos; kernel_rule_t *in = &all_kernel_rules_buf[j][in_off]; diff --git a/src/stdout.c b/src/stdout.c index c4e1bc774..29decb218 100644 --- a/src/stdout.c +++ b/src/stdout.c @@ -35,7 +35,7 @@ static void out_push (out_t *out, const u8 *pw_buf, const int pw_len) } } -void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const hashconfig_t *hashconfig, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, const outfile_ctx_t *outfile_ctx, const uint pws_cnt) +void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, const user_options_t *user_options, const hashconfig_t *hashconfig, const straight_ctx_t *straight_ctx, const combinator_ctx_t *combinator_ctx, const mask_ctx_t *mask_ctx, const outfile_ctx_t *outfile_ctx, const u32 pws_cnt) { out_t out; @@ -61,25 +61,25 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, out.len = 0; - uint plain_buf[16] = { 0 }; + u32 plain_buf[16] = { 0 }; u8 *plain_ptr = (u8 *) plain_buf; - uint plain_len = 0; + u32 plain_len = 0; - const uint il_cnt = device_param->kernel_params_buf32[30]; // ugly, i know + const u32 il_cnt = device_param->kernel_params_buf32[30]; // ugly, i know if (user_options->attack_mode == ATTACK_MODE_STRAIGHT) { pw_t pw; - for (uint gidvid = 0; gidvid < pws_cnt; gidvid++) + for (u32 gidvid = 0; gidvid < pws_cnt; gidvid++) { gidd_to_pw_t (opencl_ctx, device_param, gidvid, &pw); - const uint pos = device_param->innerloop_pos; + const u32 pos = device_param->innerloop_pos; - for (uint il_pos = 0; il_pos < il_cnt; il_pos++) + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) { for (int i = 0; i < 8; i++) { @@ -100,11 +100,11 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, { pw_t pw; - for (uint gidvid = 0; gidvid < pws_cnt; gidvid++) + for (u32 gidvid = 0; gidvid < pws_cnt; gidvid++) { gidd_to_pw_t (opencl_ctx, device_param, gidvid, &pw); - for (uint il_pos = 0; il_pos < il_cnt; il_pos++) + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) { for (int i = 0; i < 8; i++) { @@ -114,7 +114,7 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, plain_len = pw.pw_len; char *comb_buf = (char *) device_param->combs_buf[il_pos].i; - uint comb_len = device_param->combs_buf[il_pos].pw_len; + u32 comb_len = device_param->combs_buf[il_pos].pw_len; if (combinator_ctx->combs_mode == COMBINATOR_MODE_BASE_LEFT) { @@ -140,18 +140,18 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, } else if (user_options->attack_mode == ATTACK_MODE_BF) { - for (uint gidvid = 0; gidvid < pws_cnt; gidvid++) + for (u32 gidvid = 0; gidvid < pws_cnt; gidvid++) { - for (uint il_pos = 0; il_pos < il_cnt; il_pos++) + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) { u64 l_off = device_param->kernel_params_mp_l_buf64[3] + gidvid; u64 r_off = device_param->kernel_params_mp_r_buf64[3] + il_pos; - uint l_start = device_param->kernel_params_mp_l_buf32[5]; - uint r_start = device_param->kernel_params_mp_r_buf32[5]; + u32 l_start = device_param->kernel_params_mp_l_buf32[5]; + u32 r_start = device_param->kernel_params_mp_r_buf32[5]; - uint l_stop = device_param->kernel_params_mp_l_buf32[4]; - uint r_stop = device_param->kernel_params_mp_r_buf32[4]; + u32 l_stop = device_param->kernel_params_mp_l_buf32[4]; + u32 r_stop = device_param->kernel_params_mp_r_buf32[4]; sp_exec (l_off, (char *) plain_ptr + l_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, l_start, l_start + l_stop); sp_exec (r_off, (char *) plain_ptr + r_start, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, r_start, r_start + r_stop); @@ -166,11 +166,11 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, { pw_t pw; - for (uint gidvid = 0; gidvid < pws_cnt; gidvid++) + for (u32 gidvid = 0; gidvid < pws_cnt; gidvid++) { gidd_to_pw_t (opencl_ctx, device_param, gidvid, &pw); - for (uint il_pos = 0; il_pos < il_cnt; il_pos++) + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) { for (int i = 0; i < 8; i++) { @@ -181,8 +181,8 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, u64 off = device_param->kernel_params_mp_buf64[3] + il_pos; - uint start = 0; - uint stop = device_param->kernel_params_mp_buf32[4]; + u32 start = 0; + u32 stop = device_param->kernel_params_mp_buf32[4]; sp_exec (off, (char *) plain_ptr + plain_len, mask_ctx->root_css_buf, mask_ctx->markov_css_buf, start, start + stop); @@ -196,11 +196,11 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, { pw_t pw; - for (uint gidvid = 0; gidvid < pws_cnt; gidvid++) + for (u32 gidvid = 0; gidvid < pws_cnt; gidvid++) { gidd_to_pw_t (opencl_ctx, device_param, gidvid, &pw); - for (uint il_pos = 0; il_pos < il_cnt; il_pos++) + for (u32 il_pos = 0; il_pos < il_cnt; il_pos++) { for (int i = 0; i < 8; i++) { @@ -211,8 +211,8 @@ void process_stdout (opencl_ctx_t *opencl_ctx, hc_device_param_t *device_param, u64 off = device_param->kernel_params_mp_buf64[3] + il_pos; - uint start = 0; - uint stop = device_param->kernel_params_mp_buf32[4]; + u32 start = 0; + u32 stop = device_param->kernel_params_mp_buf32[4]; memmove (plain_ptr + stop, plain_ptr, plain_len); diff --git a/src/weak_hash.c b/src/weak_hash.c index 42d639854..7f8b1bf46 100644 --- a/src/weak_hash.c +++ b/src/weak_hash.c @@ -10,7 +10,7 @@ #include "hashes.h" #include "weak_hash.h" -void weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const uint salt_pos) +void weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, const u32 salt_pos) { hashconfig_t *hashconfig = hashcat_ctx->hashconfig; hashes_t *hashes = hashcat_ctx->hashes; @@ -28,7 +28,7 @@ void weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_para device_param->kernel_params_buf32[33] = 0; device_param->kernel_params_buf32[34] = 1; - uint cmd0_rule_old = straight_ctx->kernel_rules_buf[0].cmds[0]; + u32 cmd0_rule_old = straight_ctx->kernel_rules_buf[0].cmds[0]; straight_ctx->kernel_rules_buf[0].cmds[0] = 0; @@ -44,13 +44,13 @@ void weak_hash_check (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_para { run_kernel (KERN_RUN_1, opencl_ctx, device_param, 1, false, 0, hashconfig, user_options, status_ctx); - uint loop_step = 16; + u32 loop_step = 16; - const uint iter = salt_buf->salt_iter; + const u32 iter = salt_buf->salt_iter; - for (uint loop_pos = 0; loop_pos < iter; loop_pos += loop_step) + for (u32 loop_pos = 0; loop_pos < iter; loop_pos += loop_step) { - uint loop_left = iter - loop_pos; + u32 loop_left = iter - loop_pos; loop_left = MIN (loop_left, loop_step); diff --git a/src/wordlist.c b/src/wordlist.c index 81e719005..b4e9efe9f 100644 --- a/src/wordlist.c +++ b/src/wordlist.c @@ -13,14 +13,14 @@ #include "rp_cpu.h" #include "wordlist.h" -uint convert_from_hex (char *line_buf, const uint line_len, const user_options_t *user_options) +u32 convert_from_hex (char *line_buf, const u32 line_len, const user_options_t *user_options) { if (line_len & 1) return (line_len); // not in hex if (user_options->hex_wordlist == true) { - uint i; - uint j; + u32 i; + u32 j; for (i = 0, j = 0; j < line_len; i += 1, j += 2) { @@ -40,8 +40,8 @@ uint convert_from_hex (char *line_buf, const uint line_len, const user_options_t if (line_buf[4] != '[') return (line_len); if (line_buf[line_len - 1] != ']') return (line_len); - uint i; - uint j; + u32 i; + u32 j; for (i = 0, j = 5; j < line_len - 1; i += 1, j += 2) { @@ -177,7 +177,7 @@ void get_next_word_std (char *buf, u64 sz, u64 *len, u64 *off) *len = sz; } -void get_next_word (wl_data_t *wl_data, const user_options_t *user_options, const user_options_extra_t *user_options_extra, FILE *fd, char **out_buf, uint *out_len) +void get_next_word (wl_data_t *wl_data, const user_options_t *user_options, const user_options_extra_t *user_options_extra, FILE *fd, char **out_buf, u32 *out_len) { while (wl_data->pos < wl_data->cnt) {