1
0
Fork 0
forked from lthn/blockchain

fix for PoS verification (block hash is used as a message for sig), zarcanum_test_pos_math shoud now pass

This commit is contained in:
sowle 2022-11-16 23:04:29 +01:00
parent fa0f51a7ed
commit 801f244d46
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC
2 changed files with 3 additions and 8 deletions

View file

@ -3697,12 +3697,7 @@ bool wallet2::prepare_and_sign_pos_block(const mining_context& cxt, currency::bl
// generate sring signature
sig.s.resize(1);
crypto::generate_ring_signature(block_hash,
stake_input.k_image,
keys_ptrs,
secret_x,
0,
&sig.s[0]);
crypto::generate_ring_signature(block_hash, stake_input.k_image, keys_ptrs, secret_x, 0, sig.s.data());
WLT_LOG_L4("GENERATED RING SIGNATURE for PoS block coinbase: block_id " << block_hash
<< "txin.k_image" << stake_input.k_image
@ -3800,7 +3795,7 @@ bool wallet2::prepare_and_sign_pos_block(const mining_context& cxt, currency::bl
}
#endif
crypto::hash tx_hash_for_sig = get_transaction_hash(b.miner_tx); // TODO @#@# change to block hash after the corresponding test is made
crypto::hash tx_hash_for_sig = get_block_hash(b);
uint8_t err = 0;
r = crypto::zarcanum_generate_proof(tx_hash_for_sig, cxt.kernel_hash, ring, cxt.last_pow_block_id_hashed, cxt.sk.kimage,

View file

@ -228,7 +228,7 @@ void pos_block_builder::step5_sign(const currency::tx_source_entry& se, const cu
ring.emplace_back(el.stealth_address, el.amount_commitment, el.concealing_point);
}
crypto::hash tx_hash_for_sig = get_transaction_hash(m_block.miner_tx); // TODO @#@# change to block hash after the corresponding test is made
crypto::hash tx_hash_for_sig = get_block_hash(m_block);
uint8_t err = 0;
r = crypto::zarcanum_generate_proof(tx_hash_for_sig, m_context.kernel_hash, ring, m_context.last_pow_block_id_hashed, m_context.sk.kimage,