tevador/RandomX ? reverse-engineered prompt
Reverse engineered prompt
Build me a C++11 library for RandomX, a proof of work algorithm that runs best on normal CPUs and makes specialized hardware less useful.
I want a static library with a simple C API so another app can hash inputs, verify results, and use either fast mode or light mode with the same output. Please include a small example program, a benchmark, and a test executable so I can check performance and correctness. It should work on Linux and Windows, and if possible use native CPU code generation for x86 64, ARM64, and RISCV64, with a fallback path that still works on other systems.
Make sure the code follows the idea from the docs, using the random instruction virtual machine, memory hard behavior, and a final 256 bit hash result based on Blake2b. If you need to look up current docs or compare against the spec, do that. Keep it clean, portable, and buildable with CMake.
Are you gonna build this?
make sure you review the code using coderabbit