yes
Original source, looking at time spent in momentum_pow_test:
User time (seconds): 5.24
Maximum resident set size (kbytes): 1050652
43.84% momentum_pow_te libcrypto.so.1.0.0 [.] 0x000000000006c729
With patch 1 for algorithmic changes:
User time (seconds): 4.38
Maximum resident set size (kbytes): 528452
71.51% momentum_pow_te libcrypto.so.1.0.0 [.] 0x000000000006d29f
The reason it's not quite as much faster is that it's spending a little more time in allocation in the sha512 routine, which is being used differently from the one in PTS. I'll clean that up as part of the sha512 optimizations in chunk-of-work #2. That part is straightforward engineering.
Probably the biggest benefit to the current version is that, as shown above, it uses half the memory and is about 20% faster with no changes to the crypto or any other libraries.
Sending pull request now.
When I pulled this change in it stopped finding matches...
Whoops - thanks, I'd misunderstood test_momentum_pow.
I've fixed it in a second pull request. It was a missing enc.reset().
Interestingly, you'll find that my version now finds a few more collisions than the original code did, which should produce a further speed-up. These collisions verify.
Old:
3522368ms th_a momentum_test.cpp:29 main ] [[25908781,36251059],[36251059,25908781],[14409167,49012845],[49012845,14409167],[32190345,58604277],[58604277,32190345],[11166445,59732725],[59732725,11166445],[41830614,64427554],[64427554,41830614]]
User time (seconds): 5.09
New:
/usr/bin/time --verbose ./tests/momentum_pow_test 5959592
98735ms th_a momentum_test.cpp:29 main ] [[29995035,64113291],[64113291,29995035],[41830614,64427554],[64427554,41830614],[32190345,58604277],[58604277,32190345],[11166445,59732725],[59732725,11166445],[14409167,49012845],[49012845,14409167],[25908781,36251059],[36251059,25908781]]
User time (seconds): 3.43
Sorry for the double-try on that one.