8000 Update binding hash function signature by AaronFeickert · Pull Request #1396 · firoorg/firo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Update binding hash function signature #1396

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/libspark/spend_transaction.cpp
C628
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ SpendTransaction::SpendTransaction(
Scalar mu = hash_bind(
hash_bind_inner(
this->cover_set_representations,
this->S1,
this->C1,
this->T,
this->grootle_proofs,
this->balance_proof,
this->range_proof
Expand Down Expand Up @@ -293,9 +295,11 @@ bool SpendTransaction::verify(

// Compute the binding hash
Scalar mu = hash_bind(
tx.hash_bind_inner(
hash_bind_inner(
tx.cover_set_representations,
tx.S1,
tx.C1,
tx.T,
tx.grootle_proofs,
tx.balance_proof,
tx.range_proof
Expand Down Expand Up @@ -405,9 +409,13 @@ bool SpendTransaction::verify(
// Hash function H_bind_inner
// This function pre-hashes auxiliary data that makes things easier for a limited signer who cannot process the data directly
// Its value is then used as part of the binding hash, which a limited signer can verify as part of the signing process
//
// Note that transparent components of the transaction are bound into `cover_set_representation`, so they don't appear separately.
std::vector<unsigned char> SpendTransaction::hash_bind_inner(
const std::unordered_map<uint64_t, std::vector<unsigned char>>& cover_set_representations,
const std::vector<GroupElement>& S1,
const std::vector<GroupElement>& C1,
const std::vector<GroupElement>& T,
const std::vector<GrootleProof>& grootle_proofs,
const SchnorrProof& balance_proof,
const BPPlusProof& range_proof
Expand Down
4 changes: 3 additions & 1 deletion src/libspark/spend_transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,11 @@ class SpendTransaction {
static bool verify(const Params* params, const std::vector<SpendTransaction>& transactions, const std::unordered_map<uint64_t, std::vector<Coin>>& cover_sets);
static bool verify(const SpendTransaction& transaction, const std::unordered_map<uint64_t, std::vector<Coin>>& cover_sets);

std::vector<unsigned char> hash_bind_inner(
static std::vector<unsigned char> hash_bind_inner(
const std::unordered_map<uint64_t, std::vector<unsigned char>>& cover_set_representations,
const std::vector<GroupElement>& S1,
const std::vector<GroupElement>& C1,
const std::vector<GroupElement>& T,
const std::vector<GrootleProof>& grootle_proofs,
const SchnorrProof& balance_proof,
const BPPlusProof& range_proof
Expand Down
0