| 13 | #include <util/system.h> |
| 14 | |
| 15 | std::string GetBlindingStatusError(const BlindingStatus& status) |
| 16 | { |
| 17 | switch(status) { |
| 18 | case BlindingStatus::OK: |
| 19 | return "No error"; |
| 20 | case BlindingStatus::NEEDS_UTXOS: |
| 21 | return "Inputs are missing UTXOs (or peg-in data for peg-in inputs)"; |
| 22 | case BlindingStatus::INVALID_ASSET: |
| 23 | return "Provided asset tag is invalid"; |
| 24 | case BlindingStatus::INVALID_ASSET_COMMITMENT: |
| 25 | return "Provided asset commitment is invalid"; |
| 26 | case BlindingStatus::SCALAR_UNABLE: |
| 27 | return "Unable to compute the scalars for the final blinder"; |
| 28 | case BlindingStatus::INVALID_BLINDER: |
| 29 | return "Computed blinding factor is invalid"; |
| 30 | case BlindingStatus::ASP_UNABLE: |
| 31 | return "Unable to create an asset surjection proof"; |
| 32 | case BlindingStatus::NO_BLIND_OUTPUTS: |
| 33 | return "Transaction has blind inputs belonging to this blinder but does not have outputs to blind"; |
| 34 | } |
| 35 | assert(false); |
| 36 | } |
| 37 | |
| 38 | // Create surjection proof |
| 39 | bool CreateAssetSurjectionProof(std::vector<unsigned char>& output_proof, const std::vector<secp256k1_fixed_asset_tag>& fixed_input_tags, const std::vector<secp256k1_generator>& ephemeral_input_tags, const std::vector<uint256>& input_asset_blinders, const uint256& output_asset_blinder, const secp256k1_generator& output_asset_tag, const CAsset& asset, size_t num_targets) |