Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Aug 2015 23:31:52 +0200
From: magnum <john.magnum@...hmail.com>
To: john-dev@...ts.openwall.com
Subject: Long duration formats' many-salts figure incorrect in short benchmarks
 (was: 7z's KDF is unsalted)

Solar,

On 2015-08-18 22:59, magnum wrote:
> $ ../run/john -test -form:7z
> Will run 8 OpenMP threads
> Benchmarking: 7z, 7-Zip (512K iterations) [SHA256 AES 32/64]... (8xOMP) DONE
> Speed for cost 1 (iteration count) of 524288
> Many salts: 7876 c/s real, 1085 c/s virtual
> Only one salt:  42.1 c/s real, 5.5 c/s virtual

I did the same change for the OpenCL version:

$ ../run/john -test -form:7z-opencl -dev=2
Will run 8 OpenMP threads
Device 2: GeForce GT 650M
Benchmarking: 7z-opencl, 7-Zip (512K iterations) [SHA256 OPENCL AES]... 
(8xOMP) DONE
Speed for cost 1 (iteration count) of 524288
Many salts:	108 c/s real, 12800 c/s virtual
Only one salt:	108 c/s real, 12800 c/s virtual

So why don't we see *any* boost here? After some digging around I 
realized the benchmark timer ends before we even get to try the second 
salt even once! This example is a toy GPU but it happens even on 
flagship ones.

So running a much longer test does show the boost:

$ ../run/john -test=10 -form:7z-opencl -dev=2
Will run 8 OpenMP threads
Device 2: GeForce GT 650M
Benchmarking: 7z-opencl, 7-Zip (512K iterations) [SHA256 OPENCL AES]... 
(8xOMP) DONE
Speed for cost 1 (iteration count) of 524288
Many salts:	13818 c/s real, 308404 c/s virtual
Only one salt:	108 c/s real, 12800 c/s virtual

Longer runs show better figures (within limits). This problem is with 
"your code", but it never surfaces in non-Jumbo. I'm not sure whether to 
fix this, or how. Should we simply ensure the while loop runs long 
enough for both salts to be tested at least once? Maybe that would end 
up showing a mere 2x boost in this case? Should we ensure the loop does 
all BENCHMARK_MANY virtual salts? But that would likely end up in some 
GPU formats benchmarking for hours...

BTW this also boosts the CPU format figure:

$ ../run/john -test=4 -form:7z
Will run 8 OpenMP threads
Benchmarking: 7z, 7-Zip (512K iterations) [SHA256 AES 32/64]... (8xOMP) DONE
Speed for cost 1 (iteration count) of 524288
Many salts:	9606 c/s real, 1356 c/s virtual
Only one salt:	41.7 c/s real, 5.4 c/s virtual

A four second test yields a 219x boost instead of the original 187x. 
(BTW I see now I recalled incorrectly; BENCHMARK_MANY isn't 500 but 256, 
so the theoretical max boost is < 256x in this situation).

magnum

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.