]> zoso.dev Git - nano-pow.git/commitdiff
Fix incorrect final digest XOR in threshold comparison to properly use initialized...
authorChris Duncan <chris@zoso.dev>
Thu, 13 Mar 2025 15:29:40 +0000 (08:29 -0700)
committerChris Duncan <chris@zoso.dev>
Thu, 13 Mar 2025 15:29:40 +0000 (08:29 -0700)
src/shaders/compute.wgsl

index d96aca48b7cfca68be1884712795ba94d30600e7..17f0aad23e2b1f7bdf98ff8a5da1897f98c0ec6c 100644 (file)
@@ -1662,7 +1662,7 @@ fn main(id: vec3<u32>) {
        * Set nonce if it passes the threshold and no other thread has set it.
        * Only high bits are needed for comparison since threshold low bits are zero.
        */
-       if ((BLAKE2B_IV[0u].y ^ v01.y ^ v89.y) >= ubo.threshold && atomicLoad(&work.found) == 0u) {
+       if ((BLAKE2B_INIT[0u].y ^ v01.y ^ v89.y) >= ubo.threshold && atomicLoad(&work.found) == 0u) {
                atomicStore(&work.found, 1u);
                work.nonce = m0;
                work.result = (BLAKE2B_INIT[0u] ^ v01.xy ^ v89.xy);