From 81b54c3689c204496a0f97ca368b540bd2842b3f Mon Sep 17 00:00:00 2001 From: Gabriele Gristina Date: Tue, 3 Aug 2021 21:42:42 +0200 Subject: [PATCH] rename to 27300, reduced the amount of memory allocated in gpu for SNMPv3 HMAC-SHA512-384 --- OpenCL/{m27000-pure.cl => m27300-pure.cl} | 16 +++++++++------- docs/changes.txt | 1 - docs/readme.txt | 1 - src/modules/{module_27000.c => module_27300.c} | 3 ++- tools/test_modules/{m27000.pm => m27300.pm} | 0 5 files changed, 11 insertions(+), 10 deletions(-) rename OpenCL/{m27000-pure.cl => m27300-pure.cl} (95%) rename src/modules/{module_27000.c => module_27300.c} (99%) rename tools/test_modules/{m27000.pm => m27300.pm} (100%) diff --git a/OpenCL/m27000-pure.cl b/OpenCL/m27300-pure.cl similarity index 95% rename from OpenCL/m27000-pure.cl rename to OpenCL/m27300-pure.cl index c6a543ebb..308c46483 100644 --- a/OpenCL/m27000-pure.cl +++ b/OpenCL/m27300-pure.cl @@ -30,6 +30,11 @@ #define SNMPV3_MAX_ENGINE_ELEMS 32 // 32 * 4 = 128 > 34, also has to be multiple of SNMPV3_MAX_PW_LENGTH #define SNMPV3_MAX_PNUM_ELEMS 4 // 4 * 4 = 16 > 9 +#define SNMPV3_MAX_PW_LENGTH_OPT 32 +#define SNMPV3_TMP_ELEMS_OPT ((SNMPV3_MAX_PW_LENGTH_OPT * SNMPV3_MAX_PW_LENGTH) / 4) + // (32 * 128) / 4 = 1024 + // for pw length > 32 we use global memory reads + typedef struct hmac_sha512_tmp { u32 tmp[SNMPV3_TMP_ELEMS]; @@ -49,7 +54,7 @@ typedef struct snmpv3 } snmpv3_t; -KERNEL_FQ void m27000_init (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) +KERNEL_FQ void m27300_init (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) { /** * modifier @@ -146,7 +151,7 @@ KERNEL_FQ void m27000_init (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) tmps[gid].h[7] = SHA512M_H; } -KERNEL_FQ void m27000_loop (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) +KERNEL_FQ void m27300_loop (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) { /** * base @@ -171,10 +176,7 @@ KERNEL_FQ void m27000_loop (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) const int pw_len128 = pw_len * 128; - #define SNMPV3_TMP_ELEMS_OPT 8192 // 8192 = (128 max pw length * 64) / sizeof (u32) - // for pw length > 128 we use global memory reads - - if (pw_len < 128) + if (pw_len <= SNMPV3_MAX_PW_LENGTH_OPT) { u32 tmp[SNMPV3_TMP_ELEMS_OPT]; @@ -294,7 +296,7 @@ KERNEL_FQ void m27000_loop (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) tmps[gid].h[7] = h[7]; } -KERNEL_FQ void m27000_comp (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) +KERNEL_FQ void m27300_comp (KERN_ATTR_TMPS_ESALT (hmac_sha512_tmp_t, snmpv3_t)) { /** * modifier diff --git a/docs/changes.txt b/docs/changes.txt index 8479ec55e..cc14c475e 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -42,7 +42,6 @@ - Added hash-mode: SNMPv3 HMAC-SHA1-96 - Added hash-mode: SNMPv3 HMAC-MD5-96 -- Added hash-mode: SNMPv3 HMAC-SHA512-384 * changes v6.2.2 -> v6.2.3 diff --git a/docs/readme.txt b/docs/readme.txt index 6f3f45fd5..cff519531 100644 --- a/docs/readme.txt +++ b/docs/readme.txt @@ -157,7 +157,6 @@ NVIDIA GPUs require "NVIDIA Driver" (440.64 or later) and "CUDA Toolkit" (9.0 or - IKE-PSK SHA1 - SNMPv3 HMAC-MD5-96 - SNMPv3 HMAC-SHA1-96 -- SNMPv3 HMAC-SHA512-384 - WPA-EAPOL-PBKDF2 - WPA-EAPOL-PMK - WPA-PBKDF2-PMKID+EAPOL diff --git a/src/modules/module_27000.c b/src/modules/module_27300.c similarity index 99% rename from src/modules/module_27000.c rename to src/modules/module_27300.c index 806f7d5a5..0143292ac 100644 --- a/src/modules/module_27000.c +++ b/src/modules/module_27300.c @@ -20,7 +20,7 @@ static const u32 DGST_POS3 = 1; static const u32 DGST_SIZE = DGST_SIZE_8_6; static const u32 HASH_CATEGORY = HASH_CATEGORY_NETWORK_PROTOCOL; static const char *HASH_NAME = "SNMPv3 HMAC-SHA512-384"; -static const u64 KERN_TYPE = 27000; +static const u64 KERN_TYPE = 27300; static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE | OPTI_TYPE_USES_BITS_64; static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_BE; @@ -333,6 +333,7 @@ void module_init (module_ctx_t *module_ctx) module_ctx->module_esalt_size = module_esalt_size; module_ctx->module_extra_buffer_size = MODULE_DEFAULT; module_ctx->module_extra_tmp_size = MODULE_DEFAULT; +// module_ctx->module_extra_tuningdb_block = MODULE_DEFAULT; module_ctx->module_forced_outfile_format = MODULE_DEFAULT; module_ctx->module_hash_binary_count = MODULE_DEFAULT; module_ctx->module_hash_binary_parse = MODULE_DEFAULT; diff --git a/tools/test_modules/m27000.pm b/tools/test_modules/m27300.pm similarity index 100% rename from tools/test_modules/m27000.pm rename to tools/test_modules/m27300.pm