xenoncat/equihash-xenon

request for blake2b C binding

Closed this issue · 2 comments

tromp commented

dear xenoncat,

first of all, congratulations on your excellent submission,
which encouraged me to enter the contest as well.

as you know, this contest encourages the use of other contestant's ideas in one's code.
it so happens that my solver is spending 45% of runtime computing blake2b_final's, and
I notice yours spends only about 20% of runtime on hashing.

would you be so kind as to provide a C-binding to your superb blake2b implementation
so that I could make use of it in my solver as well? with full attribution, naturally.

kind regards,
-John

Done.
The AVX version performs 2 BLAKE2b in parallel; the AVX2 version performs 4 BLAKE2b in parallel.

For the AVX2 version, call Blake2Run4 with indexctr=0 to get four BLAKE2b runs {0,1,2,3}; with indexctr=4 to get four BLAKE2b runs {4,5,6,7}. Take note of the memcpy in example_avx2.c, each of the four 50-byte output has 14-byte junk in between.

Note for future equihash parameter change: there are 3 commented out lines near the end of macro_blake2b.asm. The 3 lines are not performed because we only need 50 bytes out of 64 bytes. Future parameters may require the 3 lines to be enabled.

tromp commented

dear xenoncat,

wow; that was fast! thanks so much!
i will try to integrate it into my solver later today.

regards,
-John

On Sun, Oct 23, 2016 at 12:52 AM, xenoncat notifications@github.com wrote:

Done.
The AVX version performs 2 BLAKE2b in parallel; the AVX2 version performs
4 BLAKE2b in parallel.

For the AVX2 version, call Blake2Run4 with indexctr=0 to get four BLAKE2b
runs {0,1,2,3}; with indexctr=4 to get four BLAKE2b runs {4,5,6,7}. Take
note of the memcpy in example_avx2.c, each of the four 50-byte output has
14-byte junk in between.

Note for future equihash parameter change: there are 3 commented out lines
near the end of macro_blake2b.asm. The 3 lines are not performed because we
only need 50 bytes out of 64 bytes. Future parameters may require the 3
lines to be enabled.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACPQ28V_OECV1DuoevKQh5XTZayJLn5xks5q2uf9gaJpZM4Kd74N
.