diff --git a/src/modules/silentpayments/main_impl.h b/src/modules/silentpayments/main_impl.h index 66344cd620..e12fed8929 100644 --- a/src/modules/silentpayments/main_impl.h +++ b/src/modules/silentpayments/main_impl.h @@ -139,6 +139,15 @@ static int secp256k1_silentpayments_create_output_pubkey(const secp256k1_context return ret; } +static void print_hex(unsigned char* data, size_t size) { + size_t i; + printf("0x"); + for (i = 0; i < size; i++) { + printf("%02x", data[i]); + } + printf("\n"); +} + int secp256k1_silentpayments_test_outputs( const secp256k1_context *ctx, const secp256k1_silentpayments_recipient *recipients, @@ -156,7 +165,9 @@ int secp256k1_silentpayments_test_outputs( unsigned char compressed_scan_pubkey[33]; unsigned char compressed_spend_pubkey[33]; size_t len; - + + printf("index: %ld\n", recipients[i].index); + /* Serialize pubkey1 in a compressed form (33 bytes), should always return 1 */ len = sizeof(compressed_scan_pubkey); ret = secp256k1_ec_pubkey_serialize(ctx, compressed_scan_pubkey, &len, &recipients[i].scan_pubkey, SECP256K1_EC_COMPRESSED); @@ -167,6 +178,13 @@ int secp256k1_silentpayments_test_outputs( ret = secp256k1_ec_pubkey_serialize(ctx, compressed_spend_pubkey, &len, &recipients[i].spend_pubkey, SECP256K1_EC_COMPRESSED); /* Should be the same size as the size of the output, because we passed a 33 byte array. */ VERIFY_CHECK(len == sizeof(compressed_spend_pubkey)); + + printf("scan_pubkey: "); + print_hex(compressed_scan_pubkey, sizeof(compressed_scan_pubkey)); + + printf("spend_pubkey: "); + print_hex(compressed_spend_pubkey, sizeof(compressed_spend_pubkey)); + } return ret;