Reduce to minimal MobileCoin SDK.
This commit is contained in:
parent
130ac42821
commit
dae1e36cb6
@ -1,380 +1,7 @@
|
||||
|
||||
// Order matters.
|
||||
#import <MobileCoinMinimal/attest.h>
|
||||
#import <MobileCoinMinimal/transaction.h>
|
||||
|
||||
#import <CocoaLumberjack/CocoaLumberjack.h>
|
||||
#ifdef DEBUG
|
||||
static const NSUInteger ddLogLevel = DDLogLevelAll;
|
||||
#else
|
||||
static const NSUInteger ddLogLevel = DDLogLevelInfo;
|
||||
#endif
|
||||
|
||||
bool mc_tx_out_validate_confirmation_number(
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL tx_out_confirmation_number,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
bool* MC_NONNULL out_valid
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_tx_out_get_value(
|
||||
const McTxOutAmount* MC_NONNULL tx_out_amount,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
uint64_t* MC_NONNULL out_value,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_tx_out_get_subaddress_spend_public_key(
|
||||
const McBuffer* MC_NONNULL tx_out_target_key,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_spend_public_key,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_tx_out_matches_subaddress(
|
||||
const McBuffer* MC_NONNULL tx_out_target_key,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL subaddress_spend_private_key,
|
||||
bool* MC_NONNULL out_matches
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_account_key_get_public_address_fog_authority_sig(
|
||||
const McAccountKey* MC_NONNULL account_key,
|
||||
uint64_t subaddress_index,
|
||||
McMutableBuffer* MC_NONNULL out_fog_authority_sig
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_error_free(McError* MC_NULLABLE error)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_tx_out_matches_any_subaddress(
|
||||
const McTxOutAmount* MC_NONNULL tx_out_amount,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
bool* MC_NONNULL out_matches
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
ssize_t mc_printable_wrapper_b58_decode(
|
||||
const char* MC_NONNULL b58_encoded_string,
|
||||
McMutableBuffer* MC_NULLABLE out_printable_wrapper_proto_bytes,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_ristretto_private_validate(
|
||||
const McBuffer* MC_NONNULL ristretto_private,
|
||||
bool* MC_NONNULL out_valid
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
char* MC_NULLABLE mc_printable_wrapper_b58_encode(
|
||||
const McBuffer* MC_NONNULL printable_wrapper_proto_bytes
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_account_key_get_public_address_public_keys(
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL spend_private_key,
|
||||
uint64_t subaddress_index,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_view_public_key,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_spend_public_key
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_ristretto_public_validate(
|
||||
const McBuffer* MC_NONNULL ristretto_public,
|
||||
bool* MC_NONNULL out_valid
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_tx_out_get_key_image(
|
||||
const McBuffer* MC_NONNULL tx_out_target_key,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL subaddress_spend_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_key_image,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_string_free(char* MC_NULLABLE string)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_account_key_get_subaddress_private_keys(
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL spend_private_key,
|
||||
uint64_t subaddress_index,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_view_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_spend_private_key
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
ssize_t mc_bip39_entropy_from_mnemonic(
|
||||
const char* MC_NONNULL mnemonic,
|
||||
McMutableBuffer* MC_NULLABLE out_entropy,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
char* MC_NULLABLE mc_bip39_words_by_prefix(
|
||||
const char* MC_NONNULL prefix
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
char* MC_NULLABLE mc_bip39_mnemonic_from_entropy(
|
||||
const McBuffer* MC_NONNULL entropy
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_transaction_builder_ring_free(
|
||||
McTransactionBuilderRing* MC_NULLABLE transaction_builder_ring
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McTransactionBuilderRing* MC_NULLABLE mc_transaction_builder_ring_create()
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McData* MC_NULLABLE mc_transaction_builder_build(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
McRngCallback* MC_NULLABLE rng_callback,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_transaction_builder_add_input(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL subaddress_spend_private_key,
|
||||
size_t real_index,
|
||||
const McTransactionBuilderRing* MC_NONNULL ring,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_slip10_account_private_keys_from_mnemonic(
|
||||
const char* MC_NONNULL mnemonic,
|
||||
uint32_t account_index,
|
||||
McMutableBuffer* MC_NONNULL out_view_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_spend_private_key,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
ssize_t mc_data_get_bytes(
|
||||
const McData* MC_NONNULL data,
|
||||
McMutableBuffer* MC_NULLABLE out_bytes
|
||||
)
|
||||
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
void mc_transaction_builder_free(
|
||||
McTransactionBuilder* MC_NULLABLE transaction_builder
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_fog_resolver_free(
|
||||
McFogResolver* MC_NULLABLE fog_resolver
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_transaction_builder_ring_add_element(
|
||||
McTransactionBuilderRing* MC_NONNULL transaction_builder_ring,
|
||||
const McBuffer* MC_NONNULL tx_out_proto_bytes,
|
||||
const McBuffer* MC_NONNULL membership_proof_proto_bytes
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_fog_resolver_add_report_response(
|
||||
McFogResolver* MC_NONNULL fog_resolver,
|
||||
const char* MC_NONNULL report_url,
|
||||
const McBuffer* MC_NONNULL report_response,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_mr_signer_verifier_allow_hardening_advisory(
|
||||
McMrSignerVerifier* MC_NONNULL mr_signer_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McTransactionBuilder* MC_NULLABLE mc_transaction_builder_create(
|
||||
uint64_t fee,
|
||||
uint64_t tombstone_block,
|
||||
const McFogResolver* MC_NULLABLE fog_resolver
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_mr_enclave_verifier_free(
|
||||
McMrEnclaveVerifier* MC_NULLABLE mr_enclave_verifier
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_data_free(McData* MC_NULLABLE data)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_verifier_free(
|
||||
McVerifier* MC_NULLABLE verifier
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_mr_signer_verifier_allow_config_advisory(
|
||||
McMrSignerVerifier* MC_NONNULL mr_signer_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
void mc_mr_signer_verifier_free(
|
||||
McMrSignerVerifier* MC_NULLABLE mr_signer_verifier
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McFogResolver* MC_NULLABLE mc_fog_resolver_create(
|
||||
const McVerifier* MC_NONNULL fog_report_verifier
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_mr_enclave_verifier_allow_hardening_advisory(
|
||||
McMrEnclaveVerifier* MC_NONNULL mr_enclave_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_mr_enclave_verifier_allow_config_advisory(
|
||||
McMrEnclaveVerifier* MC_NONNULL mr_enclave_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McMrSignerVerifier* MC_NULLABLE mc_mr_signer_verifier_create(
|
||||
const McBuffer* MC_NONNULL mr_signer,
|
||||
uint16_t expected_product_id,
|
||||
uint16_t minimum_security_version
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McVerifier* MC_NULLABLE mc_verifier_create()
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_verifier_add_mr_signer(
|
||||
McVerifier* MC_NONNULL verifier,
|
||||
const McMrSignerVerifier* MC_NONNULL mr_signer_verifier
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McData* MC_NULLABLE mc_transaction_builder_add_output(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
uint64_t amount,
|
||||
const McPublicAddress* MC_NONNULL recipient_address,
|
||||
McRngCallback* MC_NULLABLE rng_callback,
|
||||
McMutableBuffer* MC_NONNULL out_tx_out_confirmation_number,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
bool mc_verifier_add_mr_enclave(
|
||||
McVerifier* MC_NONNULL verifier,
|
||||
const McMrEnclaveVerifier* MC_NONNULL mr_enclave_verifier
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
McMrEnclaveVerifier* MC_NULLABLE mc_mr_enclave_verifier_create(
|
||||
const McBuffer* MC_NONNULL mr_enclave
|
||||
)
|
||||
{
|
||||
DDLogVerbose(@"Invalid method.");
|
||||
}
|
||||
|
||||
@ -1,243 +0,0 @@
|
||||
// Copyright (c) 2018-2021 The MobileCoin Foundation
|
||||
|
||||
#ifndef ATTEST_H_
|
||||
#define ATTEST_H_
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/* ==================== Attestation ==================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ==== Types ==== */
|
||||
|
||||
/// A `VerifyIasReportData` implementation that will check if the enclave in
|
||||
/// question has the given MrEnclave, and has no other IAS report status issues.
|
||||
typedef struct _McMrEnclaveVerifier McMrEnclaveVerifier;
|
||||
|
||||
/// A `VerifyIasReportData` implementation that will check if the enclave in
|
||||
/// question has the given MrSigner value, and has no other IAS report status
|
||||
/// issues.
|
||||
typedef struct _McMrSignerVerifier McMrSignerVerifier;
|
||||
|
||||
/// A builder structure used to construct a report verifier based on the
|
||||
/// criteria specified.
|
||||
typedef struct _McVerifier McVerifier;
|
||||
|
||||
typedef struct _McAttestAke McAttestAke;
|
||||
|
||||
/* ==== McMrEnclaveVerifier ==== */
|
||||
|
||||
/// Create a new status verifier that will check for the existence of the
|
||||
/// given MrEnclave.
|
||||
///
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `mr_enclave` - must be 32 bytes in length.
|
||||
McMrEnclaveVerifier* MC_NULLABLE mc_mr_enclave_verifier_create(
|
||||
const McBuffer* MC_NONNULL mr_enclave
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
void mc_mr_enclave_verifier_free(
|
||||
McMrEnclaveVerifier* MC_NULLABLE mr_enclave_verifier
|
||||
);
|
||||
|
||||
/// Assume an enclave with the specified measurement does not need
|
||||
/// BIOS configuration changes to address the provided advisory ID.
|
||||
///
|
||||
/// This method should only be used when advised by an enclave author.
|
||||
///
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `advisory_id` - must be a nul-terminated C string containing valid UTF-8.
|
||||
bool mc_mr_enclave_verifier_allow_config_advisory(
|
||||
McMrEnclaveVerifier* MC_NONNULL mr_enclave_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/// Assume the given MrEnclave value has the appropriate software/build-time
|
||||
/// hardening for the given advisory ID.
|
||||
///
|
||||
/// This method should only be used when advised by an enclave author.
|
||||
///
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `advisory_id` - must be a nul-terminated C string containing valid UTF-8.
|
||||
bool mc_mr_enclave_verifier_allow_hardening_advisory(
|
||||
McMrEnclaveVerifier* MC_NONNULL mr_enclave_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/* ==== McMrSignerVerifier ==== */
|
||||
|
||||
/// Create a new status verifier that will check for the existence of the
|
||||
/// given MrSigner.
|
||||
///
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `mr_signer` - must be 32 bytes in length.
|
||||
McMrSignerVerifier* MC_NULLABLE mc_mr_signer_verifier_create(
|
||||
const McBuffer* MC_NONNULL mr_signer,
|
||||
uint16_t expected_product_id,
|
||||
uint16_t minimum_security_version
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
void mc_mr_signer_verifier_free(
|
||||
McMrSignerVerifier* MC_NULLABLE mr_signer_verifier
|
||||
);
|
||||
|
||||
/// Assume an enclave with the specified measurement does not need
|
||||
/// BIOS configuration changes to address the provided advisory ID.
|
||||
///
|
||||
/// This method should only be used when advised by an enclave author.
|
||||
///
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `advisory_id` - must be a nul-terminated C string containing valid UTF-8.
|
||||
bool mc_mr_signer_verifier_allow_config_advisory(
|
||||
McMrSignerVerifier* MC_NONNULL mr_signer_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/// Assume an enclave with the specified measurement has the appropriate
|
||||
/// software/build-time hardening for the given advisory ID.
|
||||
///
|
||||
/// This method should only be used when advised by an enclave author.
|
||||
///
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `advisory_id` - must be a nul-terminated C string containing valid UTF-8.
|
||||
bool mc_mr_signer_verifier_allow_hardening_advisory(
|
||||
McMrSignerVerifier* MC_NONNULL mr_signer_verifier,
|
||||
const char* MC_NONNULL advisory_id
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/* ==== McVerifier ==== */
|
||||
|
||||
/// Construct a new builder using the baked-in IAS root certificates and debug
|
||||
/// settings.
|
||||
McVerifier* MC_NULLABLE mc_verifier_create();
|
||||
|
||||
void mc_verifier_free(
|
||||
McVerifier* MC_NULLABLE verifier
|
||||
);
|
||||
|
||||
/// Verify the given MrEnclave-based status verifier succeeds
|
||||
bool mc_verifier_add_mr_enclave(
|
||||
McVerifier* MC_NONNULL verifier,
|
||||
const McMrEnclaveVerifier* MC_NONNULL mr_enclave_verifier
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/// Verify the given MrSigner-based status verifier succeeds
|
||||
bool mc_verifier_add_mr_signer(
|
||||
McVerifier* MC_NONNULL verifier,
|
||||
const McMrSignerVerifier* MC_NONNULL mr_signer_verifier
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/* ==== McAttestAke ==== */
|
||||
|
||||
McAttestAke* MC_NULLABLE mc_attest_ake_create();
|
||||
|
||||
void mc_attest_ake_free(
|
||||
McAttestAke* MC_NULLABLE attest_ake
|
||||
);
|
||||
|
||||
bool mc_attest_ake_is_attested(
|
||||
const McAttestAke* MC_NONNULL attest_ake,
|
||||
bool* MC_NONNULL out_attested
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `attest_ake` - must be in the attested state.
|
||||
/// * `out_binding` - must be null or else length must be >= `binding.len`.
|
||||
ssize_t mc_attest_ake_get_binding(
|
||||
const McAttestAke* MC_NONNULL attest_ake,
|
||||
McMutableBuffer* MC_NULLABLE out_binding
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* ==== Auth ==== */
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `responder_id` - must be a nul-terminated C string containing a valid responder ID.
|
||||
/// * `out_auth_request` - must be null or else length must be >= auth_request_output.len.
|
||||
ssize_t mc_attest_ake_get_auth_request(
|
||||
McAttestAke* MC_NONNULL attest_ake,
|
||||
const char* MC_NONNULL responder_id,
|
||||
McRngCallback* MC_NULLABLE rng_callback,
|
||||
McMutableBuffer* MC_NULLABLE out_auth_request
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `attest_ake` - must be in the auth pending state.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::AttestationVerificationFailed`
|
||||
/// * `LibMcError::InvalidInput`
|
||||
bool mc_attest_ake_process_auth_response(
|
||||
McAttestAke* MC_NONNULL attest_ake,
|
||||
const McBuffer* MC_NONNULL auth_response_data,
|
||||
const McVerifier* MC_NONNULL verifier,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3);
|
||||
|
||||
/* ==== Message Encryption ==== */
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `attest_ake` - must be in the attested state.
|
||||
/// * `out_ciphertext` - must be null or else length must be >= `ciphertext.len`.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::Aead`
|
||||
/// * `LibMcError::Cipher`
|
||||
ssize_t mc_attest_ake_encrypt(
|
||||
McAttestAke* MC_NONNULL attest_ake,
|
||||
const McBuffer* MC_NONNULL aad,
|
||||
const McBuffer* MC_NONNULL plaintext,
|
||||
McMutableBuffer* MC_NULLABLE out_ciphertext,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `attest_ake` - must be in the attested state.
|
||||
/// * `out_plaintext` - length must be >= `ciphertext.len`.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::Aead`
|
||||
/// * `LibMcError::Cipher`
|
||||
ssize_t mc_attest_ake_decrypt(
|
||||
McAttestAke* MC_NONNULL attest_ake,
|
||||
const McBuffer* MC_NONNULL aad,
|
||||
const McBuffer* MC_NONNULL ciphertext,
|
||||
McMutableBuffer* MC_NONNULL out_plaintext,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !ATTEST_H_ */
|
||||
@ -1,110 +0,0 @@
|
||||
// Copyright (c) 2018-2021 The MobileCoin Foundation
|
||||
|
||||
#ifndef COMMON_H_
|
||||
#define COMMON_H_
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
// Compatibility with non-clang compilers.
|
||||
#ifndef __has_attribute
|
||||
# define __has_attribute(x) 0
|
||||
#endif
|
||||
|
||||
#if __has_attribute(nonnull)
|
||||
# define MC_ATTRIBUTE_NONNULL(...) __attribute__((nonnull(__VA_ARGS__)))
|
||||
#else
|
||||
# define MC_ATTRIBUTE_NONNULL(...)
|
||||
#endif
|
||||
|
||||
#ifdef __llvm__
|
||||
# define MC_NONNULL _Nonnull
|
||||
# define MC_NULLABLE _Nullable
|
||||
#else
|
||||
# define MC_NONNULL
|
||||
# define MC_NULLABLE
|
||||
#endif
|
||||
|
||||
#if __has_attribute(enum_extensibility)
|
||||
# define MC_ATTRIBUTE_ENUM_CLOSED __attribute__((enum_extensibility(closed)))
|
||||
#else
|
||||
# define MC_ATTRIBUTE_ENUM_CLOSED
|
||||
#endif
|
||||
|
||||
/* ==================== Common ==================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ==== Error Codes ==== */
|
||||
|
||||
typedef enum MC_ATTRIBUTE_ENUM_CLOSED {
|
||||
McErrorCodeUnknown = -1,
|
||||
McErrorCodePanic = -2,
|
||||
|
||||
McErrorCodeInvalidInput = 100,
|
||||
McErrorCodeInvalidOutput = 101,
|
||||
|
||||
McErrorCodeAttestationVerificationFailed = 200,
|
||||
|
||||
McErrorCodeAead = 300,
|
||||
McErrorCodeCipher = 301,
|
||||
McErrorCodeUnsupportedCryptoBoxVersion = 302,
|
||||
|
||||
McErrorCodeTransactionCrypto = 400,
|
||||
} McErrorCode;
|
||||
|
||||
/* ==== McError ==== */
|
||||
|
||||
typedef struct {
|
||||
int error_code;
|
||||
const char* MC_NONNULL error_description;
|
||||
} McError;
|
||||
|
||||
void mc_error_free(McError* MC_NULLABLE error);
|
||||
|
||||
/* ==== McString ==== */
|
||||
|
||||
void mc_string_free(char* MC_NULLABLE string);
|
||||
|
||||
/* ==== McBuffer ==== */
|
||||
|
||||
typedef struct {
|
||||
const uint8_t* MC_NONNULL buffer;
|
||||
size_t len;
|
||||
} McBuffer;
|
||||
|
||||
typedef struct {
|
||||
uint8_t* MC_NONNULL buffer;
|
||||
size_t len;
|
||||
} McMutableBuffer;
|
||||
|
||||
/* ==== McData ==== */
|
||||
|
||||
typedef struct _McData McData;
|
||||
|
||||
void mc_data_free(McData* MC_NULLABLE data);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `out_bytes` - must be null or else length must be >= `data.len`.
|
||||
ssize_t mc_data_get_bytes(
|
||||
const McData* MC_NONNULL data,
|
||||
McMutableBuffer* MC_NULLABLE out_bytes
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/* ==== McRngCallback ==== */
|
||||
|
||||
typedef struct {
|
||||
uint64_t (* MC_NONNULL rng)(void* MC_NULLABLE);
|
||||
void* MC_NULLABLE context;
|
||||
} McRngCallback;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !COMMON_H_ */
|
||||
@ -1,124 +0,0 @@
|
||||
// Copyright (c) 2018-2021 The MobileCoin Foundation
|
||||
|
||||
#ifndef FOG_H_
|
||||
#define FOG_H_
|
||||
|
||||
#include "common.h"
|
||||
#include "keys.h"
|
||||
|
||||
/* ==================== Fog ==================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ==== Types ==== */
|
||||
|
||||
typedef struct _McFogResolver McFogResolver;
|
||||
|
||||
typedef struct _McFogRng McFogRng;
|
||||
|
||||
/* ==== McFogResolver ==== */
|
||||
|
||||
McFogResolver* MC_NULLABLE mc_fog_resolver_create(
|
||||
const McVerifier* MC_NONNULL fog_report_verifier
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
void mc_fog_resolver_free(
|
||||
McFogResolver* MC_NULLABLE fog_resolver
|
||||
);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `report_url` - must be a nul-terminated C string containing a valid Fog report uri.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
bool mc_fog_resolver_add_report_response(
|
||||
McFogResolver* MC_NONNULL fog_resolver,
|
||||
const char* MC_NONNULL report_url,
|
||||
const McBuffer* MC_NONNULL report_response,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3);
|
||||
|
||||
/* ==== McFogRng ==== */
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `subaddress_view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
/// * `LibMcError::UnsupportedCryptoBoxVersion`
|
||||
McFogRng* MC_NULLABLE mc_fog_rng_create(
|
||||
const McBuffer* MC_NONNULL subaddress_view_private_key,
|
||||
const McBuffer* MC_NONNULL rng_public_key,
|
||||
uint32_t rng_version,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
void mc_fog_rng_free(
|
||||
McFogRng* MC_NULLABLE fog_rng);
|
||||
|
||||
McFogRng* MC_NULLABLE mc_fog_rng_clone(
|
||||
const McFogRng* MC_NONNULL fog_rng
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `out_fog_rng_proto_bytes` - must be null or else length must be >= `encoded.len`.
|
||||
ssize_t mc_fog_rng_serialize_proto(
|
||||
const McFogRng* MC_NONNULL fog_rng,
|
||||
McMutableBuffer* MC_NULLABLE out_fog_rng_proto_bytes
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
/// * `LibMcError::UnsupportedCryptoBoxVersion`
|
||||
McFogRng* MC_NULLABLE mc_fog_rng_deserialize_proto(
|
||||
const McBuffer* MC_NONNULL fog_rng_proto_bytes,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
int64_t mc_fog_rng_index(
|
||||
const McFogRng* MC_NONNULL fog_rng
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
ssize_t mc_fog_rng_get_output_len(
|
||||
const McFogRng* MC_NONNULL fog_rng
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `out_output` - length must be >= `output.len`.
|
||||
bool mc_fog_rng_peek(
|
||||
const McFogRng* MC_NONNULL fog_rng,
|
||||
McMutableBuffer* MC_NONNULL out_output
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `out_output` - must be null or else length must be >= `output.len`.
|
||||
bool mc_fog_rng_advance(
|
||||
McFogRng* MC_NONNULL fog_rng,
|
||||
McMutableBuffer* MC_NULLABLE out_output
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !FOG_H_ */
|
||||
@ -1,87 +0,0 @@
|
||||
// Copyright (c) 2018-2021 The MobileCoin Foundation
|
||||
|
||||
#ifndef KEYS_H_
|
||||
#define KEYS_H_
|
||||
|
||||
#include "common.h"
|
||||
|
||||
/* ==================== Account Keys ==================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ==== Types ==== */
|
||||
|
||||
typedef struct {
|
||||
const char* MC_NONNULL report_url;
|
||||
const char* MC_NONNULL report_id;
|
||||
const McBuffer* MC_NONNULL authority_fingerprint;
|
||||
} McAccountKeyFogInfo;
|
||||
|
||||
typedef struct {
|
||||
const McBuffer* MC_NONNULL view_private_key;
|
||||
const McBuffer* MC_NONNULL spend_private_key;
|
||||
const McAccountKeyFogInfo* MC_NULLABLE fog_info;
|
||||
} McAccountKey;
|
||||
|
||||
typedef struct {
|
||||
const char* MC_NONNULL report_url;
|
||||
const char* MC_NONNULL report_id;
|
||||
const McBuffer* MC_NONNULL authority_sig;
|
||||
} McPublicAddressFogInfo;
|
||||
|
||||
typedef struct {
|
||||
const McBuffer* MC_NONNULL view_public_key;
|
||||
const McBuffer* MC_NONNULL spend_public_key;
|
||||
const McPublicAddressFogInfo* MC_NULLABLE fog_info;
|
||||
} McPublicAddress;
|
||||
|
||||
/* ==== AccountKey ==== */
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `spend_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `out_subaddress_view_private_key` - length must be >= 32.
|
||||
/// * `out_subaddress_spend_private_key` - length must be >= 32.
|
||||
bool mc_account_key_get_subaddress_private_keys(
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL spend_private_key,
|
||||
uint64_t subaddress_index,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_view_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_spend_private_key
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 4, 5);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `spend_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `out_subaddress_view_public_key` - length must be >= 32.
|
||||
/// * `out_subaddress_spend_public_key` - length must be >= 32.
|
||||
bool mc_account_key_get_public_address_public_keys(
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL spend_private_key,
|
||||
uint64_t subaddress_index,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_view_public_key,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_spend_public_key
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 4, 5);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `account_key` - must be a valid `AccountKey` with `fog_info`.
|
||||
/// * `out_fog_authority_fingerprint_sig` - length must be >= 64.
|
||||
bool mc_account_key_get_public_address_fog_authority_sig(
|
||||
const McAccountKey* MC_NONNULL account_key,
|
||||
uint64_t subaddress_index,
|
||||
McMutableBuffer* MC_NONNULL out_fog_authority_sig
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 3);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !KEYS_H_ */
|
||||
@ -1,230 +0,0 @@
|
||||
// Copyright (c) 2018-2021 The MobileCoin Foundation
|
||||
|
||||
#ifndef TRANSACTION_H_
|
||||
#define TRANSACTION_H_
|
||||
|
||||
#include "common.h"
|
||||
#include "fog.h"
|
||||
#include "keys.h"
|
||||
|
||||
/* ==================== Transaction ==================== */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* ==== Types ==== */
|
||||
|
||||
typedef struct {
|
||||
const McBuffer* MC_NONNULL commitment;
|
||||
uint64_t masked_value;
|
||||
} McTxOutAmount;
|
||||
|
||||
typedef struct _McTransactionBuilderRing McTransactionBuilderRing;
|
||||
typedef struct _McTransactionBuilder McTransactionBuilder;
|
||||
|
||||
/* ==== TxOut ==== */
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
bool mc_tx_out_matches_any_subaddress(
|
||||
const McTxOutAmount* MC_NONNULL tx_out_amount,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
bool* MC_NONNULL out_matches
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `subaddress_spend_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
bool mc_tx_out_matches_subaddress(
|
||||
const McBuffer* MC_NONNULL tx_out_target_key,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL subaddress_spend_private_key,
|
||||
bool* MC_NONNULL out_matches
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4, 5);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `out_subaddress_spend_public_key` - length must be >= 32.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
bool mc_tx_out_get_subaddress_spend_public_key(
|
||||
const McBuffer* MC_NONNULL tx_out_target_key,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_subaddress_spend_public_key,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
/// * `LibMcError::TransactionCrypto`
|
||||
bool mc_tx_out_get_value(
|
||||
const McTxOutAmount* MC_NONNULL tx_out_amount,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
uint64_t* MC_NONNULL out_value,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `subaddress_spend_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `out_key_image` - length must be >= 32.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
/// * `LibMcError::TransactionCrypto`
|
||||
bool mc_tx_out_get_key_image(
|
||||
const McBuffer* MC_NONNULL tx_out_target_key,
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL subaddress_spend_private_key,
|
||||
McMutableBuffer* MC_NONNULL out_key_image,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4, 5);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
bool mc_tx_out_validate_confirmation_number(
|
||||
const McBuffer* MC_NONNULL tx_out_public_key,
|
||||
const McBuffer* MC_NONNULL tx_out_confirmation_number,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
bool* MC_NONNULL out_valid
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 4);
|
||||
|
||||
/* ==== McTransactionBuilderRing ==== */
|
||||
|
||||
McTransactionBuilderRing* MC_NULLABLE mc_transaction_builder_ring_create();
|
||||
|
||||
void mc_transaction_builder_ring_free(
|
||||
McTransactionBuilderRing* MC_NULLABLE transaction_builder_ring
|
||||
);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `tx_out_proto_bytes` - must be a valid binary-serialized `external.TxOut` Protobuf.
|
||||
/// * `membership_proof_proto_bytes` - must be a valid binary-serialized
|
||||
/// `external.TxOutMembershipProof` Protobuf.
|
||||
bool mc_transaction_builder_ring_add_element(
|
||||
McTransactionBuilderRing* MC_NONNULL transaction_builder_ring,
|
||||
const McBuffer* MC_NONNULL tx_out_proto_bytes,
|
||||
const McBuffer* MC_NONNULL membership_proof_proto_bytes
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3);
|
||||
|
||||
/* ==== McTransactionBuilder ==== */
|
||||
|
||||
McTransactionBuilder* MC_NULLABLE mc_transaction_builder_create(
|
||||
uint64_t fee,
|
||||
uint64_t tombstone_block,
|
||||
const McFogResolver* MC_NULLABLE fog_resolver
|
||||
);
|
||||
|
||||
void mc_transaction_builder_free(
|
||||
McTransactionBuilder* MC_NULLABLE transaction_builder
|
||||
);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `transaction_builder` - must not have been previously consumed by a call to `build`.
|
||||
/// * `view_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `subaddress_spend_private_key` - must be a valid 32-byte Ristretto-format scalar.
|
||||
/// * `real_index` - must be within bounds of `ring`.
|
||||
/// * `ring` - `TxOut` at `real_index` must be owned by account keys.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
bool mc_transaction_builder_add_input(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
const McBuffer* MC_NONNULL view_private_key,
|
||||
const McBuffer* MC_NONNULL subaddress_spend_private_key,
|
||||
size_t real_index,
|
||||
const McTransactionBuilderRing* MC_NONNULL ring,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 2, 3, 5);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `transaction_builder` - must not have been previously consumed by a call to `build`.
|
||||
/// * `recipient_address` - must be a valid `PublicAddress`.
|
||||
/// * `out_subaddress_spend_public_key` - length must be >= 32.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::AttestationVerification`
|
||||
/// * `LibMcError::InvalidInput`
|
||||
McData* MC_NULLABLE mc_transaction_builder_add_output(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
uint64_t amount,
|
||||
const McPublicAddress* MC_NONNULL recipient_address,
|
||||
McRngCallback* MC_NULLABLE rng_callback,
|
||||
McMutableBuffer* MC_NONNULL out_tx_out_confirmation_number,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 3, 6);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `transaction_builder` - must not have been previously consumed by a call to `build`.
|
||||
/// * `recipient_address` - must be a valid `PublicAddress`.
|
||||
/// * `fog_hint_address` - must be a valid `PublicAddress` with `fog_info`.
|
||||
/// * `out_tx_out_confirmation_number` - length must be >= 32.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::AttestationVerification`
|
||||
/// * `LibMcError::InvalidInput`
|
||||
McData* MC_NULLABLE mc_transaction_builder_add_output_with_fog_hint_address(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
uint64_t amount,
|
||||
const McPublicAddress* MC_NONNULL recipient_address,
|
||||
const McPublicAddress* MC_NONNULL fog_hint_address,
|
||||
McRngCallback* MC_NULLABLE rng_callback,
|
||||
McMutableBuffer* MC_NONNULL out_tx_out_confirmation_number,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1, 3, 4, 5, 7);
|
||||
|
||||
/// # Preconditions
|
||||
///
|
||||
/// * `transaction_builder` - must not have been previously consumed by a call to `build`.
|
||||
///
|
||||
/// # Errors
|
||||
///
|
||||
/// * `LibMcError::InvalidInput`
|
||||
McData* MC_NULLABLE mc_transaction_builder_build(
|
||||
McTransactionBuilder* MC_NONNULL transaction_builder,
|
||||
McRngCallback* MC_NULLABLE rng_callback,
|
||||
McError* MC_NULLABLE * MC_NULLABLE out_error
|
||||
)
|
||||
MC_ATTRIBUTE_NONNULL(1);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* !TRANSACTION_H_ */
|
||||
@ -110,11 +110,11 @@ if __name__ == "__main__":
|
||||
|
||||
mc_swift_paths = [
|
||||
"Sources/Generated/Proto/external.pb.swift",
|
||||
"Artifacts/include/attest.h",
|
||||
"Artifacts/include/common.h",
|
||||
"Artifacts/include/keys.h",
|
||||
"Artifacts/include/transaction.h",
|
||||
"Artifacts/include/fog.h",
|
||||
# "Artifacts/include/attest.h",
|
||||
# "Artifacts/include/common.h",
|
||||
# "Artifacts/include/keys.h",
|
||||
# "Artifacts/include/transaction.h",
|
||||
# "Artifacts/include/fog.h",
|
||||
]
|
||||
for path in mc_swift_paths:
|
||||
copy_path(path, "libmobilecoin-ios-artifacts", dst_prefix = "LibMobileCoin")
|
||||
|
||||
Loading…
Reference in New Issue
Block a user