1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-08-04 12:56:00 +00:00
Commit Graph

10 Commits

Author SHA1 Message Date
Gabriele Gristina
4576e6d446
Updated OpenCL/Metal backends, memory functions, backend and brigde
## OpenCL Backend

- added hc_clCreateBuffer wrapper, hc_clCreateBuffer_pre
- updated HC_OCL_CREATEBUFFER macro
- updated other two hc_clEnqueueWriteBuffer from CL_FALSE to CL_TRUE

## Metal Backend

- added hc_mtlFinish
- updated hc_mtlCreateBuffer

## Memory

- added hc_alloc_aligned and hc_free_aligned
- renamed hcmalloc_aligned and hcfree_aligned to hcmalloc_bridge_aligned and hcfree_bridge_aligned

## Backend & Bridge

- updated references of hcmalloc_aligned and hcfree_aligned to the new memory defined functions
2025-07-27 17:15:44 +02:00
Gabriele Gristina
524b76462a
Update filehandling, Metal and OpenCL backends, test_edge, user options
- solved TODOs in hc_fstat()
- fix memory leaks on Metal Backend
- using HC_OCL_CREATEBUFFER macro for buffer allocation and openclMemoryFlags array to configure the memory flags with OpenCL
- convert lasts CL_FALSE to CL_TRUE in hc_clEnqueueWriteBuffer() calls
- hide pyenv stderr on test_edge.sh
- do not allow --slow-candidates (-S) in benchmark mode
2025-07-24 23:34:55 +02:00
Gabriele Gristina
b8c0cfee07
Metal Backend: improved memory management
Until now, support for Metal has been written using an Apple M1 and a 10-year-old Apple Intel as a basis to verify that the changes were also compatible with very old devices.
Recently, the code has been tested on an Apple M4 Pro, with a performance increase of about 3,7 times compared to the M1.
The code has also been sporadically tested on an Apple device with a discrete AMD GPU, but the performance was very low.

With this patch, I revisited memory management on Metal, initially creating an easily configurable array mapped 1 to 1 with the buffers allocated by hashcat.
The configuration refers to the Storage Mode associated with the buffers, as well as an ad hoc modification that transforms buffers
with a SHARED Storage Mode to MANAGED if the device is a discrete GPU and not an M* (Silicon) or integrated (Intel) one.

The result was excellent, as some very quick tests showed, for example, argon2 going from 10 H/s (1330.58ms) to 465 H/s (57.26ms)!
A 4550% increase in computational power and a 2223% increase in execution timing on the GPU!

In addition to the array for configuring the buffer storage modes, a macro, HC_MTL_CREATEBUFFER, has also been created.
This is used to generate the code that calls hc_mtlCreateBuffer, making the code much more readable than before.

In summary, this patch lays the groundwork for further improvements to the hashcat core, both on Metal itself and also for other runtimes, particularly OpenCL.
2025-07-23 22:13:26 +02:00
Gabriele Gristina
d943489404
Update core
in the following functions I changed the type for the parameter used to specify the target of the operation:

- hc_clReleaseMemObject
- hc_clReleaseKernel
- hc_clReleaseProgram
- hc_cuModuleUnload
- hc_cuMemFree
- hc_cuStreamDestroy
- hc_cuEventDestroy
- hc_hipEventDestroy
- hc_hipMemFree
- hc_hipModuleUnload
- hc_hipStreamDestroy
- hc_mtlReleaseMemObject
- hc_mtlReleaseFunction
- hc_mtlReleaseLibrary

With this change, it was possible to remove several lines of code from backend.c, making it more readable.
2025-07-19 01:03:43 +02:00
Gabriele Gristina
23b750492d
update Metal implementation and fix module 30601 2025-07-18 20:57:40 +02:00
Gabriele Gristina
bcc351068f
Metal Backend:
- added support to 2D/3D Compute
- improved compute workloads calculation
Makefile:
- updated MACOSX_DEPLOYMENT_TARGET to 15.0
Unit tests:
- updated install_modules.sh with Crypt::Argon2

Argon2 start works with Apple Metal
2025-07-03 22:06:32 +02:00
Gabriele Gristina
4d39f881fd
support 2D/3D kernel invocation with Metal 2025-07-03 10:26:51 +02:00
jsteube
6ee2658104 Prefix more macros to avoid collisions in other existing libraries 2023-01-30 14:41:12 +00:00
jsteube
f1ff925b6e Prepare rename macros in header files from _MACRO to MACRO 2023-01-17 19:25:40 +00:00
Gabriele Gristina
490702fcfa Backends: added Metal host-code 2022-02-05 22:48:16 +01:00