Skip to content

Commit 7bc95f4

Browse files
committed
Add issuance surjection proof verification
1 parent ed0521f commit 7bc95f4

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

Diff for: src/blind.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,11 @@ impl Transaction {
883883
// Issuances and reissuances not supported yet
884884
let mut in_commits = vec![];
885885
let mut out_commits = vec![];
886+
let mut domain = vec![];
886887
for (i, inp) in self.input.iter().enumerate() {
888+
let gen = spent_utxos[i].get_asset_gen(secp)
889+
.map_err(|e| VerificationError::SpentTxOutError(i, e))?;
890+
domain.push(gen);
887891
in_commits.push(
888892
spent_utxos[i].get_value_commit(secp)
889893
.map_err(|e| VerificationError::SpentTxOutError(i, e))?
@@ -899,6 +903,7 @@ impl Transaction {
899903
Value::Null => continue,
900904
Value::Explicit(v) => {
901905
let gen = Generator::new_unblinded(secp, asset.into_tag());
906+
domain.push(gen);
902907
let comm = PedersenCommitment::new_unblinded(secp, *v, gen);
903908
in_commits.push(comm)
904909
},
@@ -908,13 +913,6 @@ impl Transaction {
908913
}
909914
}
910915

911-
let domain = spent_utxos
912-
.iter()
913-
.enumerate()
914-
.map(|(i, out)|
915-
out.get_asset_gen(secp).map_err(|e| VerificationError::SpentTxOutError(i, e))
916-
)
917-
.collect::<Result<Vec<_>, _>>()?;
918916
for (i, out) in self.output.iter().enumerate() {
919917

920918
// Compute the value commitments and asset generator

0 commit comments

Comments
 (0)