How can we be certain that the hashing is correct?
The problem is that we are mining cryptos rather slowly compared to the ASICs machines. Because of that, how can we be assured that the hashing algorithms works correctly other than watching our wallet getting money (which could take a while).
All the algorithm implementations in cpuminer have been tested.
If one has the time, it would also be quite easy to write a simple getwork server that serves mock low-difficulty jobs and checks that submitted solutions meet the target.
How did you test the algorithm implementations?
The implementations were tested both manually (using known block headers) and by mining. Keep in mind that this was quite a few years ago, when CPU mining was still practically possible.
Could you provide me with some known block headers and their correct hashes? I'm willing to make test cases because I did a few code changes, and now I'm in dilemma if the code (still) works or not.
Also, do you have some documentation regarding algorithm implementation, specifically sha256? I'm finding it hard to track current code with the strange function names and lack of comments.
Could you provide me with some known block headers and their correct hashes?
You should use a block explorer or a coin daemon to fetch this kind of data.
Also, do you have some documentation regarding algorithm implementation, specifically sha256? I'm finding it hard to track current code with the strange function names and lack of comments.
Sorry, I never wrote any documentation about the implementation details.
Sorry, I never wrote any documentation about the implementation details.
Do you have documentation from which you've written those hashing functions?
For SHA-256 there is plenty of documentation available online. When I first started I think I simply used ArtForz's code (see sha256_transform()) as a base, and went from there.
Ok thanks.
I'm going to reopen it because someone might want to write a solution to the problem of validating the hashing algorithm.