1
0
Fork 0
forked from lthn/blockchain

is_out_to_acc: handling of non-blinded native assets id added

This commit is contained in:
sowle 2023-02-27 15:36:58 +01:00
parent a532a3e042
commit 7bdb410b5d
No known key found for this signature in database
GPG key ID: C07A24B2D89D49FC

View file

@ -2671,10 +2671,17 @@ namespace currency
if (A_prime != crypto::point_t(zo.amount_commitment).modify_mul8())
return false;
asset_id_blinding_mask = crypto::hash_helper_t::hs(CRYPTO_HDS_OUT_ASSET_BLINDING_MASK, h); // f = Hs(domain_sep, d, i)
crypto::point_t asset_id = blinded_asset_id - asset_id_blinding_mask * crypto::c_point_X; // H = T - s * X
decoded_asset_id = asset_id.to_public_key();
if (blinded_asset_id == currency::native_coin_asset_id_pt)
{
asset_id_blinding_mask = 0;
decoded_asset_id = currency::native_coin_asset_id;
}
else
{
asset_id_blinding_mask = crypto::hash_helper_t::hs(CRYPTO_HDS_OUT_ASSET_BLINDING_MASK, h); // f = Hs(domain_sep, d, i)
crypto::point_t asset_id = blinded_asset_id - asset_id_blinding_mask * crypto::c_point_X; // H = T - s * X
decoded_asset_id = asset_id.to_public_key();
}
return true;
}