diff --git a/Algo256/bmw.cu b/Algo256/bmw.cu index 100cece..2951482 100644 --- a/Algo256/bmw.cu +++ b/Algo256/bmw.cu @@ -81,7 +81,7 @@ extern "C" int scanhash_bmw(int thr_id, struct work* work, uint32_t max_nonce, u if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { *hashes_done = foundNonce - first_nonce + 1; pdata[19] = swab32_if(foundNonce,!swapnonce); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); return 1; } else { diff --git a/Algo256/keccak256.cu b/Algo256/keccak256.cu index bacacd1..18482a0 100644 --- a/Algo256/keccak256.cu +++ b/Algo256/keccak256.cu @@ -75,7 +75,7 @@ extern "C" int scanhash_keccak256(int thr_id, struct work* work, uint32_t max_no keccak256_hash(vhash64, endiandata); if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[19] = foundNonce; return 1; } diff --git a/JHA/jackpotcoin.cu b/JHA/jackpotcoin.cu index 883706c..674a388 100644 --- a/JHA/jackpotcoin.cu +++ b/JHA/jackpotcoin.cu @@ -221,12 +221,12 @@ extern "C" int scanhash_jackpot(int thr_id, struct work *work, uint32_t max_nonc if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); nist5hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/cuda_nist5.cu b/cuda_nist5.cu index 1ed36b0..c4c390d 100644 --- a/cuda_nist5.cu +++ b/cuda_nist5.cu @@ -133,12 +133,12 @@ extern "C" int scanhash_nist5(int thr_id, struct work *work, uint32_t max_nonce, if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); nist5hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/fuguecoin.cpp b/fuguecoin.cpp index 1c51a50..0b40671 100644 --- a/fuguecoin.cpp +++ b/fuguecoin.cpp @@ -77,7 +77,7 @@ int scanhash_fugue256(int thr_id, struct work* work, uint32_t max_nonce, unsigne if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); pdata[19] = foundNounce; *hashes_done = foundNounce - start_nonce + 1; return 1; diff --git a/groestlcoin.cpp b/groestlcoin.cpp index 5a3957b..1ea54cb 100644 --- a/groestlcoin.cpp +++ b/groestlcoin.cpp @@ -68,7 +68,7 @@ int scanhash_groestlcoin(int thr_id, struct work *work, uint32_t max_nonce, unsi groestlhash(vhash, endiandata); if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); pdata[19] = foundNounce; free(outputHash); return true; diff --git a/heavy/heavy.cu b/heavy/heavy.cu index eeb1aba..605c81f 100644 --- a/heavy/heavy.cu +++ b/heavy/heavy.cu @@ -279,7 +279,7 @@ int scanhash_heavy(int thr_id, struct work *work, uint32_t max_nonce, unsigned l applog(LOG_ERR, "hash for nonce %08x does not validate on CPU!\n", nonce); } else { *hashes_done = pdata[19] - first_nonce; - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); rc = 1; goto exit; } diff --git a/lyra2/lyra2RE.cu b/lyra2/lyra2RE.cu index 3f74484..8475eb4 100644 --- a/lyra2/lyra2RE.cu +++ b/lyra2/lyra2RE.cu @@ -136,7 +136,7 @@ extern "C" int scanhash_lyra2(int thr_id, struct work* work, uint32_t max_nonce, if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = groestl256_getSecNonce(thr_id, 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != UINT32_MAX) { be32enc(&endiandata[19], secNonce); @@ -145,7 +145,7 @@ extern "C" int scanhash_lyra2(int thr_id, struct work* work, uint32_t max_nonce, if (opt_debug) applog(LOG_BLUE, "GPU #%d: found second nonce %08x", device_map[thr_id], secNonce); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/lyra2/lyra2REv2.cu b/lyra2/lyra2REv2.cu index d281967..f327b46 100644 --- a/lyra2/lyra2REv2.cu +++ b/lyra2/lyra2REv2.cu @@ -141,14 +141,14 @@ extern "C" int scanhash_lyra2v2(int thr_id, struct work* work, uint32_t max_nonc if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { int res = 1; - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); // check if there was another one... if (foundNonces[1] != 0) { be32enc(&endiandata[19], foundNonces[1]); lyra2v2_hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = foundNonces[1]; res++; } diff --git a/myriadgroestl.cpp b/myriadgroestl.cpp index c93d872..ab2da64 100644 --- a/myriadgroestl.cpp +++ b/myriadgroestl.cpp @@ -73,7 +73,7 @@ int scanhash_myriad(int thr_id, struct work *work, uint32_t max_nonce, unsigned endiandata[19] = swab32(foundNounce); myriadhash(vhash, endiandata); if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); pdata[19] = foundNounce; free(outputHash); return 1; diff --git a/neoscrypt/neoscrypt.cpp b/neoscrypt/neoscrypt.cpp index 0330248..27551ae 100644 --- a/neoscrypt/neoscrypt.cpp +++ b/neoscrypt/neoscrypt.cpp @@ -67,7 +67,7 @@ int scanhash_neoscrypt(int thr_id, struct work* work, uint32_t max_nonce, unsign neoscrypt((uchar*)vhash64, (uchar*) endiandata, 0x80000620U); if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[19] = foundNonce; return 1; } else { diff --git a/pentablake.cu b/pentablake.cu index 1cd7585..ca909b5 100644 --- a/pentablake.cu +++ b/pentablake.cu @@ -416,13 +416,13 @@ extern "C" int scanhash_pentablake(int thr_id, struct work *work, uint32_t max_n if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { rc = 1; - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); if (extra_results[0] != UINT32_MAX) { // Rare but possible if the throughput is big be32enc(&endiandata[19], extra_results[0]); pentablakehash(vhash, endiandata); if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); applog(LOG_NOTICE, "GPU found more than one result yippee!"); pdata[21] = extra_results[0]; extra_results[0] = UINT32_MAX; diff --git a/quark/quarkcoin.cu b/quark/quarkcoin.cu index 0f06f02..e03b51b 100644 --- a/quark/quarkcoin.cu +++ b/quark/quarkcoin.cu @@ -239,7 +239,7 @@ extern "C" int scanhash_quark(int thr_id, struct work* work, uint32_t max_nonce, quarkhash(vhash64, endiandata); if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[19] = foundNonce; return 1; } else { diff --git a/qubit/deep.cu b/qubit/deep.cu index 26b85d6..dbcd4b3 100644 --- a/qubit/deep.cu +++ b/qubit/deep.cu @@ -104,12 +104,12 @@ extern "C" int scanhash_deep(int thr_id, struct work* work, uint32_t max_nonce, if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); deephash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/qubit/luffa.cu b/qubit/luffa.cu index 84ab868..e04be70 100644 --- a/qubit/luffa.cu +++ b/qubit/luffa.cu @@ -76,7 +76,7 @@ extern "C" int scanhash_luffa(int thr_id, struct work* work, uint32_t max_nonce, luffa_hash(vhash64, endiandata); if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[19] = foundNonce; return 1; } else { diff --git a/qubit/qubit.cu b/qubit/qubit.cu index a5e3a7e..3d40ded 100644 --- a/qubit/qubit.cu +++ b/qubit/qubit.cu @@ -132,12 +132,12 @@ extern "C" int scanhash_qubit(int thr_id, struct work* work, uint32_t max_nonce, if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); qubithash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/skein.cu b/skein.cu index ff4e3e5..cfeef37 100644 --- a/skein.cu +++ b/skein.cu @@ -418,7 +418,7 @@ extern "C" int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_no if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { int res = 1; uint8_t num = res; - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); if (checkSecnonce) { secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], num); } @@ -431,7 +431,7 @@ extern "C" int scanhash_skeincoin(int thr_id, struct work* work, uint32_t max_no endiandata[19] = swab32_if(secNonce, swap); skeincoinhash(vhash, endiandata); if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); pdata[19+res*2] = swab32_if(secNonce, !swap); res++; } diff --git a/skein2.cpp b/skein2.cpp index 08fb5ac..d2974dd 100644 --- a/skein2.cpp +++ b/skein2.cpp @@ -89,7 +89,7 @@ int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { if (!opt_quiet) applog(LOG_BLUE, "GPU #%d: found second nonce %08x !", device_map[thr_id], swab32(secNonce)); @@ -97,7 +97,7 @@ int scanhash_skein2(int thr_id, struct work* work, uint32_t max_nonce, unsigned endiandata[19] = secNonce; skein2hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = swab32(secNonce); res++; } diff --git a/sph/sha2.c b/sph/sha2.c index 4838692..517bdcf 100644 --- a/sph/sha2.c +++ b/sph/sha2.c @@ -508,7 +508,7 @@ static inline int scanhash_sha256d_4way(int thr_id, uint32_t *pdata, pdata[19] = data[4 * 3 + i]; sha256d_80_swap(hash, pdata); if (fulltest(hash, ptarget)) { - bn_store_hash_target_ratio(hash, ptarget, work); + work_set_target_ratio(work, hash); *hashes_done = n - first_nonce + 1; return 1; } diff --git a/x11/c11.cu b/x11/c11.cu index b711d97..c59c594 100644 --- a/x11/c11.cu +++ b/x11/c11.cu @@ -221,12 +221,12 @@ extern "C" int scanhash_c11(int thr_id, struct work* work, uint32_t max_nonce, u int res = 1; // check if there was some other ones... uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); c11hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/x11/fresh.cu b/x11/fresh.cu index af45366..81ecac9 100644 --- a/x11/fresh.cu +++ b/x11/fresh.cu @@ -130,12 +130,12 @@ extern "C" int scanhash_fresh(int thr_id, struct work* work, uint32_t max_nonce, if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); fresh_hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/x11/s3.cu b/x11/s3.cu index e17e8ec..c3fc8d3 100644 --- a/x11/s3.cu +++ b/x11/s3.cu @@ -112,12 +112,12 @@ extern "C" int scanhash_s3(int thr_id, struct work* work, uint32_t max_nonce, un if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); s3hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/x11/x11.cu b/x11/x11.cu index d65a48d..3ac4158 100644 --- a/x11/x11.cu +++ b/x11/x11.cu @@ -218,13 +218,13 @@ extern "C" int scanhash_x11(int thr_id, struct work* work, uint32_t max_nonce, u int res = 1; // check if there was some other ones... uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); *hashes_done = pdata[19] - first_nonce + throughput; if (secNonce != 0) { be32enc(&endiandata[19], secNonce); x11hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/x13/x13.cu b/x13/x13.cu index 4e980a4..a2727c2 100644 --- a/x13/x13.cu +++ b/x13/x13.cu @@ -216,14 +216,14 @@ extern "C" int scanhash_x13(int thr_id, struct work* work, uint32_t max_nonce, u if (vhash[7] <= ptarget[7] && fulltest(vhash, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); pdata[19] = foundNonce; if (secNonce != 0) { be32enc(&endiandata[19], secNonce); x13hash(vhash, endiandata); pdata[21] = secNonce; if (bn_hash_target_ratio(vhash, ptarget) > work->shareratio) { - bn_store_hash_target_ratio(vhash, ptarget, work); + work_set_target_ratio(work, vhash); xchg(pdata[19], pdata[21]); } res++; diff --git a/x15/whirlpoolx.cu b/x15/whirlpoolx.cu index 541d2de..4c54440 100644 --- a/x15/whirlpoolx.cu +++ b/x15/whirlpoolx.cu @@ -80,7 +80,7 @@ extern "C" int scanhash_whirlx(int thr_id, struct work* work, uint32_t max_nonc *hashes_done = pdata[19] - first_nonce + throughput; if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[19] = foundNonce; return 1; } else { diff --git a/x15/x14.cu b/x15/x14.cu index fe09d04..81b6183 100644 --- a/x15/x14.cu +++ b/x15/x14.cu @@ -227,12 +227,12 @@ extern "C" int scanhash_x14(int thr_id, struct work* work, uint32_t max_nonce, if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); x14hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/x15/x15.cu b/x15/x15.cu index 01cf00b..92b6efc 100644 --- a/x15/x15.cu +++ b/x15/x15.cu @@ -239,12 +239,12 @@ extern "C" int scanhash_x15(int thr_id, struct work* work, uint32_t max_nonce, if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); x15hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/x17/x17.cu b/x17/x17.cu index 0bcb028..086b5e8 100644 --- a/x17/x17.cu +++ b/x17/x17.cu @@ -263,12 +263,12 @@ extern "C" int scanhash_x17(int thr_id, struct work* work, uint32_t max_nonce, u if (vhash64[7] <= Htarg && fulltest(vhash64, ptarget)) { int res = 1; uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, pdata[19], d_hash[thr_id], 1); - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); if (secNonce != 0) { be32enc(&endiandata[19], secNonce); x17hash(vhash64, endiandata); if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; res++; } diff --git a/zr5.cu b/zr5.cu index 50cf7d7..5ee62a0 100644 --- a/zr5.cu +++ b/zr5.cu @@ -435,7 +435,7 @@ extern "C" int scanhash_zr5(int thr_id, struct work *work, zr5hash(vhash64, pdata); if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { int res = 1; - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); uint32_t secNonce = cuda_check_hash_suppl(thr_id, throughput, oldp19, d_hash[thr_id], 1); if (secNonce != 0) { offset = secNonce - oldp19; @@ -446,7 +446,7 @@ extern "C" int scanhash_zr5(int thr_id, struct work *work, zr5hash(vhash64, tmpdata); if (vhash64[7] <= ptarget[7] && fulltest(vhash64, ptarget)) { if (bn_hash_target_ratio(vhash64, ptarget) > work->shareratio) - bn_store_hash_target_ratio(vhash64, ptarget, work); + work_set_target_ratio(work, vhash64); pdata[21] = secNonce; pdata[22] = pok; res++;