mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #1182] Self-test is different from benchmark (and that is not clear) #739
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#739
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Apr 5, 2015).
Original GitHub issue: https://github.com/openwall/john/issues/1182
Unfortunately, benchmark uses the same plaintexts defined to self-test. It is a bad idea IMHO, since it has to handle the overhead of plaintext size variation.
That said, I think it can be solved. Below, a POC patch.
@magnumripper commented on GitHub (Apr 5, 2015):
Maybe we can combine this struct change with the ideas for testing and benching mask mode?
@ghost commented on GitHub (Apr 5, 2015):
Yes
@magnumripper commented on GitHub (Apr 5, 2015):
Looks good to me but I guess we should consult john-dev first now that Solar is pretty active.
@ghost commented on GitHub (Apr 7, 2015):
An example (emphasis/bold is mine)
$ ../run/john -test=2 -form:raw-sha256-opencl
Device 0: Juniper [AMD Radeon HD 6700 Series]
Benchmarking: Raw-SHA256-opencl (key-length=8) [SHA256 OpenCL]... DONE, GPU util:51%
Raw: 21810K c/s real, 46405K c/s virtual
Original
$ ../run/john -test=5 -form:raw-sha256-opencl
Device 0: Juniper [AMD Radeon HD 6700 Series]
Benchmarking: Raw-SHA256-opencl [SHA256 OpenCL]... DONE, GPU util:50%
Raw: 15309K c/s real, 32027K c/s virtual
@ghost commented on GitHub (Apr 8, 2015):
A few more points (opinions). During --test it is important to test at least:
During benchmark it is expected:
[1] seems to me some formats avoids to do so.
[2] impossible now.
[3] not possible now to produce mask mode performance as a 2nd task. But, there are 2 different expected performance numbers for a real user and they differ a lot.
BTW: a loop that call set_key() with a limited/repeated set of plain texts which primary goal should be test correctness is not a real benchmark. At least, not now that GPU is an important target.
PS: never above means "why are you thinking about doing it? Seems a bad idea, unless it has to be done. Are you really sure?".
@ghost commented on GitHub (Apr 8, 2015):
Despite its title, we are also talking about:
@magnumripper commented on GitHub (Apr 15, 2015):
http://www.openwall.com/lists/john-dev/2015/04/08/6
@magnumripper commented on GitHub (Apr 21, 2015):
Solar suggested we change that int to a flags field, which is obviously a good idea. So maybe this is what we want:
If TST_SKIP_BENCH is set, we use it only for self-test (eg. very long ones). If TST_SKIP_TEST is set, we use it only for benchmarking. Not sure when that would be applicable but it doesn't hurt having it.
@magnumripper commented on GitHub (Apr 21, 2015):
We (may) get separate lines for one/many salts. I guess for mask mode we'll just add another one. Mockup:
Maybe we should start muting the "virtual" figures for OpenCL, they don't make a lot of sense.
@magnumripper commented on GitHub (Apr 21, 2015):
See also #1136
@ghost commented on GitHub (Apr 22, 2015):
All seems good to me.
BTW: I use the virtual figure to see if the format is using CPU time in a significant way. Well, but this is not really important.
@magnumripper commented on GitHub (Apr 22, 2015):
Yes you are right. Some formats get awfully busy on CPU side after GPU delivers a hefty batch of calculated keys.
I started experimenting with implementing this but it has'nt fully settled in my head. For example, what if we have different masks for different test vectors? Should we run several batches of mask mode tests? Even in benchmark? Another problem: We probably want full-size masks like ?l?l?l for benchmarking but that may be too much (ie. too slow) for self-test, on a weak GPU. Maybe the mask we specify is only for self-test while benchmark could use a hard-coded mask.
Also, should we keep using the two first salts/ciphertexts [that hasn't got TST_SKIP_BENCH] for benchmarking, or should we change that while at it?
I'll let it grow in the back of my head for a while more.
@ghost commented on GitHub (Apr 22, 2015):
You will have different masks for different test vectors. So, you have to run batches of mask mode:
But:
Well, in case it is too much trouble, there is an easy, not that bad, solution: 1 mask only.
@ghost commented on GitHub (Apr 22, 2015):
They never should be using the same mask.
@ghost commented on GitHub (Apr 22, 2015):
I can't see a reason to keep it or to change it. So, I guess you have to find a reason to change it.
In GPU mask mode you have to check if a key/solution was found on GPU (inside kernel code). So, for benchmark you should transfer aprox. 10 (or another magic number) different hashes to GPU.
Ok, only two ciphertexts are going to be transferred. Not bad.
@magnumripper commented on GitHub (Apr 23, 2015):
I guess we should just try it out in a topic branch and see where it goes.
@ghost commented on GitHub (Jan 20, 2019):
At this very moment, it is possible to run JtR in a self test mode and in a benchmark only mode.
Unfortunately, JtR core does not change its behavior as it should. Self-test must have keys from different lengths. The benchmark should focus on one or two different sizes.
Self-test mode
"$JtR" -test=5 --format=raw-sha512-opencl -dev=4Benchmark only (all keys need to be of size, for example, 8)
"$JtR" -test=5 --format=raw-sha512-opencl -dev=4 --skip-self-test@magnumripper commented on GitHub (Apr 10, 2019):
This is obsoleted by core changes