|
purify
C++ Purify implementation with native circuit and BPP support
|
Library-level error taxonomy used to classify Purify failures.
#include <compare>#include <cstdint>#include <string_view>#include <utility>#include "purify/expected.hpp"Go to the source code of this file.
Data Structures | |
| struct | purify::Error |
| Compact error object returned by checked APIs. More... | |
Namespaces | |
| namespace | purify |
Macros | |
| #define | PURIFY_DETAIL_CONCAT_IMPL(x, y) |
| #define | PURIFY_DETAIL_CONCAT(x, y) |
| #define | PURIFY_RETURN_IF_ERROR(expr, context) |
| Evaluates an expected-like expression and returns the wrapped error on failure. | |
| #define | PURIFY_ASSIGN_OR_RETURN(lhs, expr, context) |
| Evaluates an expected-like expression, binds the value to lhs, and propagates errors. | |
| #define | PURIFY_DETAIL_RETURN_IF_ERROR_IMPL(status_name, expr, context) |
| #define | PURIFY_DETAIL_ASSIGN_OR_RETURN_IMPL(result_name, lhs, expr, context) |
Typedefs | |
| template<typename T> | |
| using | purify::Result = Expected<T, Error> |
| Expected-returning convenience alias for Purify value-producing APIs. | |
| using | purify::Status = Expected<void, Error> |
| Expected-returning convenience alias for Purify status-only APIs. | |
Functions | |
| constexpr ErrorCategory | purify::error_category (ErrorCode code) noexcept |
| Returns the high-level category for a concrete error code. | |
| constexpr std::string_view | purify::to_string (ErrorCategory category) noexcept |
| Returns a stable programmatic name for an error category. | |
| constexpr std::string_view | purify::to_string (ErrorCode code) noexcept |
| Returns a stable programmatic name for an error code. | |
| constexpr std::string_view | purify::error_message (ErrorCode code) noexcept |
| Returns the human-facing description for an error code. | |
| constexpr Unexpected< Error > | purify::unexpected_error (ErrorCode code, const char *context=nullptr) |
| Constructs an unexpected Error value from a machine-readable code. | |
| constexpr Unexpected< Error > | purify::unexpected_error (Error error, const char *context=nullptr) |
| Re-wraps an existing Error value for propagation through another Result. | |
| #define PURIFY_ASSIGN_OR_RETURN | ( | lhs, | |
| expr, | |||
| context ) |
Example: PURIFY_ASSIGN_OR_RETURN(auto secret, SecretKey::from_hex(hex), "caller:from_hex"); context is forwarded to unexpected_error().
Definition at line 338 of file error.hpp.
Referenced by purify::accountable::aggregate_responses(), purify::puresign_plusplus::MessageProofCache::build(), purify::puresign_plusplus::TopicProofCache::build(), purify::puresign::api_impl::build_message_proof_cache(), purify::puresign::api_impl::build_topic_proof_cache(), purify::bppp::commit_experimental_circuit_witness(), purify::bppp::commit_norm_arg_with_cache(), purify::bppp::commit_output_witness(), purify::derive_key(), purify::puresign::api_impl::derive_public_key(), purify::puresign_plusplus::api_impl::derive_public_key(), purify::capi_detail::derive_public_key_from_secret(), purify::accountable::ScalarSignature::deserialize(), purify::puresign::NonceProof::deserialize(), purify::puresign::ProvenSignature::deserialize(), purify::puresign_plusplus::NonceProof::deserialize(), purify::puresign_plusplus::ProvenSignature::deserialize(), purify::evaluate_verifier_circuit(), purify::evaluate_verifier_circuit(), purify::SecretKey::from_hex(), purify::puresign::KeyPair::from_secret(), purify::puresign::KeyPair::from_secret(), purify::puresign_plusplus::KeyPair::from_secret(), purify::puresign_plusplus::KeyPair::from_secret(), purify::generate_key(), purify::generate_key(), purify::NativeBulletproofCircuitTemplate::integrity_digest(), purify::puresign::api_impl::prepare_message_nonce(), purify::puresign_plusplus::api_impl::prepare_message_nonce(), purify::puresign::api_impl::prepare_message_nonce_with_proof(), purify::puresign::api_impl::prepare_message_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_message_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_message_nonce_with_proof(), purify::puresign::api_impl::prepare_topic_nonce(), purify::puresign_plusplus::api_impl::prepare_topic_nonce(), purify::puresign::api_impl::prepare_topic_nonce_with_proof(), purify::puresign::api_impl::prepare_topic_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_topic_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_topic_nonce_with_proof(), purify::prove_assignment(), purify::prove_assignment_data(), purify::bppp::prove_experimental_circuit_norm_arg(), purify::bppp::prove_experimental_circuit_norm_arg_to_commitment(), purify::bppp::prove_experimental_circuit_zk_norm_arg_impl(), purify::bppp::prove_norm_arg_to_commitment_with_cache(), purify::accountable::reconstruct_nonce(), purify::accountable::recover_same_slot_key(), purify::puresign::NonceProof::serialize(), purify::puresign::ProvenSignature::serialize(), purify::puresign_plusplus::NonceProof::serialize(), purify::puresign_plusplus::ProvenSignature::serialize(), purify::puresign::api_impl::sign_message(), purify::puresign::KeyPair::sign_message(), purify::puresign::PreparedNonceWithProof::sign_message(), purify::puresign_plusplus::api_impl::sign_message(), purify::puresign_plusplus::KeyPair::sign_message(), purify::puresign_plusplus::PreparedNonceWithProof::sign_message(), purify::puresign::api_impl::sign_message_with_prepared(), purify::puresign::KeyPair::sign_message_with_prepared(), purify::puresign_plusplus::api_impl::sign_message_with_prepared(), purify::puresign_plusplus::KeyPair::sign_message_with_prepared(), purify::puresign::api_impl::sign_message_with_proof(), purify::puresign::api_impl::sign_message_with_proof(), purify::puresign::KeyPair::sign_message_with_proof(), purify::puresign::KeyPair::sign_message_with_proof(), purify::puresign_plusplus::api_impl::sign_message_with_proof(), purify::puresign_plusplus::api_impl::sign_message_with_proof(), purify::puresign_plusplus::KeyPair::sign_message_with_proof(), purify::puresign_plusplus::KeyPair::sign_message_with_proof(), purify::puresign::PreparedNonceWithProof::sign_topic_message(), purify::puresign_plusplus::PreparedNonceWithProof::sign_topic_message(), purify::puresign::api_impl::sign_with_prepared_topic(), purify::puresign::KeyPair::sign_with_prepared_topic(), purify::puresign_plusplus::api_impl::sign_with_prepared_topic(), purify::puresign_plusplus::KeyPair::sign_with_prepared_topic(), purify::puresign::api_impl::sign_with_topic(), purify::puresign::KeyPair::sign_with_topic(), purify::puresign_plusplus::api_impl::sign_with_topic(), purify::puresign_plusplus::KeyPair::sign_with_topic(), purify::puresign::api_impl::sign_with_topic_proof(), purify::puresign::api_impl::sign_with_topic_proof(), purify::puresign::KeyPair::sign_with_topic_proof(), purify::puresign::KeyPair::sign_with_topic_proof(), purify::puresign_plusplus::api_impl::sign_with_topic_proof(), purify::puresign_plusplus::api_impl::sign_with_topic_proof(), purify::puresign_plusplus::KeyPair::sign_with_topic_proof(), purify::puresign_plusplus::KeyPair::sign_with_topic_proof(), purify::detail::validate_message_proof_cache(), purify::detail::validate_topic_proof_cache(), purify::verifier(), purify::verifier_circuit(), purify::verifier_circuit_template(), purify::verify_experimental_circuit(), purify::verify_experimental_circuit(), purify::bppp::verify_experimental_circuit_norm_arg(), purify::bppp::verify_experimental_circuit_zk_norm_arg_impl(), purify::puresign::api_impl::verify_message_nonce_proof(), purify::puresign::api_impl::verify_message_nonce_proof(), purify::puresign_plusplus::api_impl::verify_message_nonce_proof(), purify::puresign_plusplus::api_impl::verify_message_nonce_proof(), purify::puresign::api_impl::verify_message_signature_with_proof(), purify::puresign::api_impl::verify_message_signature_with_proof(), purify::puresign_plusplus::api_impl::verify_message_signature_with_proof(), purify::puresign_plusplus::api_impl::verify_message_signature_with_proof(), purify::accountable::verify_partial_response(), purify::puresign::api_impl::verify_topic_nonce_proof(), purify::puresign::api_impl::verify_topic_nonce_proof(), purify::puresign_plusplus::api_impl::verify_topic_nonce_proof(), purify::puresign_plusplus::api_impl::verify_topic_nonce_proof(), purify::puresign::api_impl::verify_topic_signature_with_proof(), purify::puresign::api_impl::verify_topic_signature_with_proof(), purify::puresign_plusplus::api_impl::verify_topic_signature_with_proof(), and purify::puresign_plusplus::api_impl::verify_topic_signature_with_proof().
| #define PURIFY_DETAIL_ASSIGN_OR_RETURN_IMPL | ( | result_name, | |
| lhs, | |||
| expr, | |||
| context ) |
| #define PURIFY_DETAIL_CONCAT | ( | x, | |
| y ) |
| #define PURIFY_DETAIL_RETURN_IF_ERROR_IMPL | ( | status_name, | |
| expr, | |||
| context ) |
| #define PURIFY_RETURN_IF_ERROR | ( | expr, | |
| context ) |
This is intended for Status-style propagation and may also be used with Result<T> when the value is intentionally discarded. context is forwarded to unexpected_error().
Definition at line 329 of file error.hpp.
Referenced by purify::accountable::SigningRoster::aggregate(), purify::accountable::aggregate_responses(), purify::bppp::commit_norm_arg_with_cache(), purify::bppp::create_generators(), purify::puresign::Nonce::deserialize(), purify::puresign::PublicKey::deserialize(), purify::puresign::Signature::deserialize(), purify::puresign_plusplus::Nonce::deserialize(), purify::puresign_plusplus::NonceProof::deserialize(), purify::puresign_plusplus::PublicKey::deserialize(), purify::puresign_plusplus::Signature::deserialize(), purify::SecretKey::from_packed(), purify::NativeBulletproofCircuitTemplate::integrity_digest(), purify::accountable::nonce_evaluation_input(), purify::bppp::pedersen_commit_char(), purify::puresign::api_impl::prepare_message_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_message_nonce_with_proof(), purify::puresign::api_impl::prepare_topic_nonce_with_proof(), purify::puresign_plusplus::api_impl::prepare_topic_nonce_with_proof(), purify::prove_assignment_data(), purify::bppp::prove_experimental_circuit_zk_norm_arg_impl(), purify::bppp::prove_norm_arg_to_commitment_with_cache(), purify::random_below(), purify::puresign::PreparedNonce::sign_message(), purify::puresign_plusplus::PreparedNonce::sign_message(), purify::puresign::PreparedNonce::sign_topic_message(), purify::puresign_plusplus::PreparedNonce::sign_topic_message(), purify::accountable::signature_challenge(), purify::verifier(), purify::verifier_circuit_template(), purify::verify_experimental_circuit(), purify::verify_experimental_circuit(), purify::puresign::api_impl::verify_message_nonce_proof(), purify::puresign_plusplus::api_impl::verify_message_nonce_proof(), purify::puresign::api_impl::verify_signature(), purify::puresign_plusplus::api_impl::verify_signature(), purify::puresign::api_impl::verify_topic_nonce_proof(), and purify::puresign_plusplus::api_impl::verify_topic_nonce_proof().