Add OPTI_TYPE_SLOW_HASH_SIMD_INIT2 and OPTI_TYPE_SLOW_HASH_SIMD_LOOP2

pull/2519/head
Jens Steube 4 years ago
parent aa3f384858
commit a72ba6faab

@ -383,6 +383,8 @@ This configuration item is a bitmask field. There are a few switches which you c
* OPTI_TYPE_SLOW_HASH_SIMD_INIT: This flag tells the hashcat host binary to divide the number of work items with the size of the vector being used. The *_init kernel needs to be written using vector data types. Vector data types have a strong impact on CPU performance, since they will be translated from the OpenCL JiT into SSE2/AVX/AVX2/XOP instructions. Modern GPUs use scalar data types thus there is no benefit from using vector data types. This is not recommended for *_init kernels because it makes the kernel much more complicated while at the same time the _init kernel is called only once per password guess.
* OPTI_TYPE_SLOW_HASH_SIMD_LOOP: see OPTI_TYPE_SLOW_HASH_SIMD_INIT but for *_loop kernels. If it is possible for your *_loop kernel to be written in vector data types, this is highly recommended. You will typically find this option being used if the _loop kernel does not do any data-dependent branching.
* OPTI_TYPE_SLOW_HASH_SIMD_COMP: see OPTI_TYPE_SLOW_HASH_SIMD_INIT but for *_comp kernels.
* OPTI_TYPE_SLOW_HASH_SIMD_INIT2: see OPTI_TYPE_SLOW_HASH_SIMD_INIT but for *_init2 kernels.
* OPTI_TYPE_SLOW_HASH_SIMD_LOOP2: see OPTI_TYPE_SLOW_HASH_SIMD_LOOP but for *_loop2 kernels.
* OPTI_TYPE_USES_BITS_8: This flag is passed to the JiT and helps optimize some of the GPU library functions at compile time. The configuration defines the bitsize of the underlying crypto primitive.
* OPTI_TYPE_USES_BITS_16: see OPTI_TYPE_USES_BITS_8
* OPTI_TYPE_USES_BITS_32: see OPTI_TYPE_USES_BITS_8. This is the default in case no OPTI_TYPE_USES_BITS_* flag is being used. Almost all traditional crypto primitives use 32 bits: MD4, MD5, SHA1, SHA256, RipeMD160, etc.

@ -354,27 +354,29 @@ typedef enum salt_type
typedef enum opti_type
{
OPTI_TYPE_OPTIMIZED_KERNEL = (1 << 0),
OPTI_TYPE_ZERO_BYTE = (1 << 1),
OPTI_TYPE_PRECOMPUTE_INIT = (1 << 2),
OPTI_TYPE_MEET_IN_MIDDLE = (1 << 3),
OPTI_TYPE_EARLY_SKIP = (1 << 4),
OPTI_TYPE_NOT_SALTED = (1 << 5),
OPTI_TYPE_NOT_ITERATED = (1 << 6),
OPTI_TYPE_PREPENDED_SALT = (1 << 7),
OPTI_TYPE_APPENDED_SALT = (1 << 8),
OPTI_TYPE_SINGLE_HASH = (1 << 9),
OPTI_TYPE_SINGLE_SALT = (1 << 10),
OPTI_TYPE_BRUTE_FORCE = (1 << 11),
OPTI_TYPE_RAW_HASH = (1 << 12),
OPTI_TYPE_SLOW_HASH_SIMD_INIT = (1 << 13),
OPTI_TYPE_SLOW_HASH_SIMD_LOOP = (1 << 14),
OPTI_TYPE_SLOW_HASH_SIMD_COMP = (1 << 15),
OPTI_TYPE_USES_BITS_8 = (1 << 16),
OPTI_TYPE_USES_BITS_16 = (1 << 17),
OPTI_TYPE_USES_BITS_32 = (1 << 18),
OPTI_TYPE_USES_BITS_64 = (1 << 19),
OPTI_TYPE_REGISTER_LIMIT = (1 << 20), // We'll limit the register count to 128
OPTI_TYPE_OPTIMIZED_KERNEL = (1 << 0),
OPTI_TYPE_ZERO_BYTE = (1 << 1),
OPTI_TYPE_PRECOMPUTE_INIT = (1 << 2),
OPTI_TYPE_MEET_IN_MIDDLE = (1 << 3),
OPTI_TYPE_EARLY_SKIP = (1 << 4),
OPTI_TYPE_NOT_SALTED = (1 << 5),
OPTI_TYPE_NOT_ITERATED = (1 << 6),
OPTI_TYPE_PREPENDED_SALT = (1 << 7),
OPTI_TYPE_APPENDED_SALT = (1 << 8),
OPTI_TYPE_SINGLE_HASH = (1 << 9),
OPTI_TYPE_SINGLE_SALT = (1 << 10),
OPTI_TYPE_BRUTE_FORCE = (1 << 11),
OPTI_TYPE_RAW_HASH = (1 << 12),
OPTI_TYPE_SLOW_HASH_SIMD_INIT = (1 << 13),
OPTI_TYPE_SLOW_HASH_SIMD_LOOP = (1 << 14),
OPTI_TYPE_SLOW_HASH_SIMD_COMP = (1 << 15),
OPTI_TYPE_USES_BITS_8 = (1 << 16),
OPTI_TYPE_USES_BITS_16 = (1 << 17),
OPTI_TYPE_USES_BITS_32 = (1 << 18),
OPTI_TYPE_USES_BITS_64 = (1 << 19),
OPTI_TYPE_REGISTER_LIMIT = (1 << 20), // We'll limit the register count to 128
OPTI_TYPE_SLOW_HASH_SIMD_INIT2 = (1 << 21),
OPTI_TYPE_SLOW_HASH_SIMD_LOOP2 = (1 << 22),
} opti_type_t;

@ -3596,6 +3596,20 @@ int run_kernel (hashcat_ctx_t *hashcat_ctx, hc_device_param_t *device_param, con
num_elements = CEILDIV (num_elements, device_param->vector_width);
}
}
else if (kern_run == KERN_RUN_INIT2)
{
if (hashconfig->opti_type & OPTI_TYPE_SLOW_HASH_SIMD_INIT2)
{
num_elements = CEILDIV (num_elements, device_param->vector_width);
}
}
else if (kern_run == KERN_RUN_LOOP2)
{
if (hashconfig->opti_type & OPTI_TYPE_SLOW_HASH_SIMD_LOOP2)
{
num_elements = CEILDIV (num_elements, device_param->vector_width);
}
}
if (hc_cuEventRecord (hashcat_ctx, device_param->cuda_event1, device_param->cuda_stream) == -1) return -1;

@ -21,7 +21,8 @@ static const u32 HASH_CATEGORY = HASH_CATEGORY_ARCHIVE;
static const char *HASH_NAME = "iTunes backup >= 10.0";
static const u64 KERN_TYPE = 14800;
static const u32 OPTI_TYPE = OPTI_TYPE_ZERO_BYTE
| OPTI_TYPE_SLOW_HASH_SIMD_LOOP;
| OPTI_TYPE_SLOW_HASH_SIMD_LOOP
| OPTI_TYPE_SLOW_HASH_SIMD_LOOP2;
static const u64 OPTS_TYPE = OPTS_TYPE_PT_GENERATE_LE
| OPTS_TYPE_ST_HEX
| OPTS_TYPE_INIT2

Loading…
Cancel
Save