purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
common.hpp File Reference

Shared includes and foundational aliases for the Purify C++ implementation. More...

#include <algorithm>
#include <array>
#include <cassert>
#include <bit>
#include <cctype>
#include <charconv>
#include <cstdint>
#include <iomanip>
#include <map>
#include <memory>
#include <limits>
#include <optional>
#include <ostream>
#include <span>
#include <sstream>
#include <string>
#include <string_view>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include "purify/error.hpp"
#include "purify/secp_bridge.h"

Go to the source code of this file.

Data Structures

struct  purify::SecpContextDeleter
 
class  purify::SpanAtLeast< MinSize, T >
 Checked span wrapper that guarantees a minimum runtime length. More...
 

Namespaces

namespace  purify
 

Macros

#define PURIFY_USE_LEGACY_FIELD_HASHES   0
 

Typedefs

using purify::SecpContextPtr = std::unique_ptr< purify_secp_context, SecpContextDeleter >
 
using purify::Bytes = std::vector< unsigned char >
 Dynamically sized byte string used for messages, serialized witnesses, and proofs.
 

Functions

SecpContextPtr purify::make_secp_context () noexcept
 
Status purify::require_secp_context (const purify_secp_context *context, const char *error_context)
 
bool purify::checked_add_size (std::size_t lhs, std::size_t rhs, std::size_t &out) noexcept
 
bool purify::checked_mul_size (std::size_t lhs, std::size_t rhs, std::size_t &out) noexcept
 
bool purify::size_fits_u32 (std::size_t value) noexcept
 
bool purify::size_fits_u64 (std::size_t value) noexcept
 
Result< std::uint64_t > purify::narrow_size_to_u64 (std::size_t value, const char *context)
 
bool purify::is_power_of_two_size (std::size_t value) noexcept
 
template<typename T >
void purify::best_effort_reserve_add (std::vector< T > &out, std::size_t lhs, std::size_t rhs)
 Reserve capacity when the size arithmetic fits, otherwise skip the hint.
 
template<typename T >
void purify::best_effort_reserve_mul (std::vector< T > &out, std::size_t lhs, std::size_t rhs)
 

Macro Definition Documentation

◆ PURIFY_USE_LEGACY_FIELD_HASHES

#define PURIFY_USE_LEGACY_FIELD_HASHES   0

Definition at line 39 of file common.hpp.