purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::detail Namespace Reference

Data Structures

class  UInt128
struct  BigUIntCBridge
struct  FieldElementAccess
class  SecureAllocator
 Allocator that clears an allocation immediately before releasing it. More...
struct  SecureUInt512Deleter
class  Secret
class  WipeOnDestruction

Concepts

concept  MutableContiguousRange
concept  SecureErasable
concept  SecretValue

Functions

std::size_t bit_length_u64 (std::uint64_t value)
 PURIFY_DEFINE_BIGUINT_C_BRIDGE (4, 256)
 PURIFY_DEFINE_BIGUINT_C_BRIDGE (5, 320)
 PURIFY_DEFINE_BIGUINT_C_BRIDGE (8, 512)
void secure_clear_bytes (void *data, std::size_t size) noexcept
template<typename T, typename U>
bool operator== (const SecureAllocator< T > &, const SecureAllocator< U > &) noexcept
Bytes copy_bytes (std::span< const unsigned char > input)
Bytes tagged_eval_input (std::string_view tag, std::span< const unsigned char > input)
void append_u32_le (Bytes &out, std::uint32_t value)
std::optional< std::uint32_t > read_u32_le (std::span< const unsigned char > bytes, std::size_t offset)
std::size_t circuit_n_gates (const NativeBulletproofCircuit &circuit)
std::size_t circuit_n_gates (const NativeBulletproofCircuit::PackedWithSlack &circuit)
std::size_t circuit_n_commitments (const NativeBulletproofCircuit &circuit)
std::size_t circuit_n_commitments (const NativeBulletproofCircuit::PackedWithSlack &circuit)
template<typename CircuitLike>
Status validate_proof_cache_circuit (const CircuitLike &circuit, const char *context)
template<typename CacheLike>
Status validate_message_proof_cache (const CacheLike &cache, std::string_view nonce_tag)
template<typename CacheLike>
Status validate_topic_proof_cache (const CacheLike &cache, std::string_view nonce_tag)
template<MutableContiguousRange T>
void secure_erase (T &value) noexcept
template<typename T>
requires (!std::ranges::range<T> && !std::is_const_v<T> && std::is_trivially_destructible_v<T>)
void secure_erase (T &value) noexcept

Function Documentation

◆ append_u32_le()

void purify::detail::append_u32_le ( Bytes & out,
std::uint32_t value )
inline

◆ bit_length_u64()

std::size_t purify::detail::bit_length_u64 ( std::uint64_t value)
inlinenodiscard

Definition at line 133 of file numeric.hpp.

Referenced by purify::BigUInt< 4 >::bit_length().

◆ circuit_n_commitments() [1/2]

std::size_t purify::detail::circuit_n_commitments ( const NativeBulletproofCircuit & circuit)
inline

Definition at line 55 of file common.hpp.

References purify::NativeBulletproofCircuit::n_commitments.

Referenced by validate_proof_cache_circuit().

◆ circuit_n_commitments() [2/2]

std::size_t purify::detail::circuit_n_commitments ( const NativeBulletproofCircuit::PackedWithSlack & circuit)
inline

◆ circuit_n_gates() [1/2]

std::size_t purify::detail::circuit_n_gates ( const NativeBulletproofCircuit & circuit)
inline

Definition at line 47 of file common.hpp.

References purify::NativeBulletproofCircuit::n_gates.

Referenced by validate_proof_cache_circuit().

◆ circuit_n_gates() [2/2]

std::size_t purify::detail::circuit_n_gates ( const NativeBulletproofCircuit::PackedWithSlack & circuit)
inline

◆ copy_bytes()

◆ operator==()

template<typename T, typename U>
bool purify::detail::operator== ( const SecureAllocator< T > & ,
const SecureAllocator< U > &  )
noexcept

Definition at line 70 of file secret.hpp.

◆ PURIFY_DEFINE_BIGUINT_C_BRIDGE() [1/3]

purify::detail::PURIFY_DEFINE_BIGUINT_C_BRIDGE ( 4 ,
256  )

◆ PURIFY_DEFINE_BIGUINT_C_BRIDGE() [2/3]

purify::detail::PURIFY_DEFINE_BIGUINT_C_BRIDGE ( 5 ,
320  )

◆ PURIFY_DEFINE_BIGUINT_C_BRIDGE() [3/3]

purify::detail::PURIFY_DEFINE_BIGUINT_C_BRIDGE ( 8 ,
512  )

◆ read_u32_le()

std::optional< std::uint32_t > purify::detail::read_u32_le ( std::span< const unsigned char > bytes,
std::size_t offset )
inline

◆ secure_clear_bytes()

◆ secure_erase() [1/2]

template<typename T>
requires (!std::ranges::range<T> && !std::is_const_v<T> && std::is_trivially_destructible_v<T>)
void purify::detail::secure_erase ( T & value)
noexcept

Wipe the complete representation of one mutable trivial object.

Definition at line 36 of file secure_cleanup.hpp.

References secure_clear_bytes().

◆ secure_erase() [2/2]

template<MutableContiguousRange T>
void purify::detail::secure_erase ( T & value)
noexcept

Wipe every live element in a mutable contiguous range.

Definition at line 26 of file secure_cleanup.hpp.

References secure_clear_bytes().

Referenced by purify::detail::Secret< T >::~Secret(), and purify::detail::WipeOnDestruction< T >::~WipeOnDestruction().

◆ tagged_eval_input()

◆ validate_message_proof_cache()

template<typename CacheLike>
Status purify::detail::validate_message_proof_cache ( const CacheLike & cache,
std::string_view nonce_tag )
inline

◆ validate_proof_cache_circuit()

template<typename CircuitLike>
Status purify::detail::validate_proof_cache_circuit ( const CircuitLike & circuit,
const char * context )

◆ validate_topic_proof_cache()

template<typename CacheLike>
Status purify::detail::validate_topic_proof_cache ( const CacheLike & cache,
std::string_view nonce_tag )
inline