purify
C++ Purify implementation with native circuit and BPP support
Loading...
Searching...
No Matches
purify::bppp::ExperimentalCircuitCache Class Referencefinal

Caller-owned cache for reusable experimental circuit reduction and BPPP backend data. More...

#include <bppp.hpp>

Inheritance diagram for purify::bppp::ExperimentalCircuitCache:
purify::bppp::ExperimentalCircuitBackend

Data Structures

struct  Impl
 

Public Member Functions

 ExperimentalCircuitCache ()
 
 ExperimentalCircuitCache (const ExperimentalCircuitCache &)=delete
 
ExperimentalCircuitCacheoperator= (const ExperimentalCircuitCache &)=delete
 
 ExperimentalCircuitCache (ExperimentalCircuitCache &&other) noexcept
 
ExperimentalCircuitCacheoperator= (ExperimentalCircuitCache &&other) noexcept
 
 ~ExperimentalCircuitCache ()
 
void clear ()
 
std::size_t size () const noexcept
 
Result< ExperimentalCircuitCacheLineclone_line_for_thread (std::span< const PointBytes > generators) const
 Clones one warmed backend-resource line for thread-local use.
 
std::shared_ptr< const void > find_public_data (const std::array< unsigned char, 32 > &key) const
 Looks up opaque cached reduction data by digest key.
 
void insert_public_data (std::array< unsigned char, 32 > key, std::shared_ptr< const void > value)
 Stores opaque cached reduction data by digest key.
 
purify_bppp_backend_resourcesget_or_create_backend_resources (std::span< const PointBytes > generators, purify_secp_context *secp_context)
 Returns cached backend resources for this generator set, creating them on first use.
 
- Public Member Functions inherited from purify::bppp::ExperimentalCircuitBackend
 ExperimentalCircuitBackend (const ExperimentalCircuitBackend &)=delete
 
ExperimentalCircuitBackendoperator= (const ExperimentalCircuitBackend &)=delete
 
 ExperimentalCircuitBackend (ExperimentalCircuitBackend &&) noexcept=default
 
ExperimentalCircuitBackendoperator= (ExperimentalCircuitBackend &&) noexcept=default
 
virtual ~ExperimentalCircuitBackend ()
 

Additional Inherited Members

- Protected Member Functions inherited from purify::bppp::ExperimentalCircuitBackend
 ExperimentalCircuitBackend ()=default
 

Detailed Description

Definition at line 186 of file bppp.hpp.

Constructor & Destructor Documentation

◆ ExperimentalCircuitCache() [1/3]

purify::bppp::ExperimentalCircuitCache::ExperimentalCircuitCache ( )

Definition at line 158 of file bppp.cpp.

◆ ExperimentalCircuitCache() [2/3]

purify::bppp::ExperimentalCircuitCache::ExperimentalCircuitCache ( const ExperimentalCircuitCache )
delete

◆ ExperimentalCircuitCache() [3/3]

purify::bppp::ExperimentalCircuitCache::ExperimentalCircuitCache ( ExperimentalCircuitCache &&  other)
defaultnoexcept

◆ ~ExperimentalCircuitCache()

purify::bppp::ExperimentalCircuitCache::~ExperimentalCircuitCache ( )
default

Member Function Documentation

◆ clear()

void purify::bppp::ExperimentalCircuitCache::clear ( )

Definition at line 169 of file bppp.cpp.

◆ clone_line_for_thread()

Result< ExperimentalCircuitCacheLine > purify::bppp::ExperimentalCircuitCache::clone_line_for_thread ( std::span< const PointBytes generators) const

If a warmed backend entry matching generators exists, it is deep-cloned so the returned line has its own scratch space and mutable generator scratch buffers for that one entry. No public reduction data is copied into the clone. If no warmed entry matches, the returned line is empty.

Returns
A thread-local one-line clone, or a backend/internal error if duplication fails.

Definition at line 182 of file bppp.cpp.

References purify::BackendRejectedInput, purify::bppp::generator_backend_cache_key(), generators, purify_bppp_backend_resources_clone(), and purify::unexpected_error().

◆ find_public_data()

std::shared_ptr< const void > purify::bppp::ExperimentalCircuitCache::find_public_data ( const std::array< unsigned char, 32 > &  key) const

Definition at line 208 of file bppp.cpp.

◆ get_or_create_backend_resources()

purify_bppp_backend_resources * purify::bppp::ExperimentalCircuitCache::get_or_create_backend_resources ( std::span< const PointBytes generators,
purify_secp_context secp_context 
)

Definition at line 220 of file bppp.cpp.

References generators.

◆ insert_public_data()

void purify::bppp::ExperimentalCircuitCache::insert_public_data ( std::array< unsigned char, 32 >  key,
std::shared_ptr< const void >  value 
)

Definition at line 213 of file bppp.cpp.

◆ operator=() [1/2]

ExperimentalCircuitCache & purify::bppp::ExperimentalCircuitCache::operator= ( const ExperimentalCircuitCache )
delete

◆ operator=() [2/2]

ExperimentalCircuitCache & purify::bppp::ExperimentalCircuitCache::operator= ( ExperimentalCircuitCache &&  other)
defaultnoexcept

◆ size()

std::size_t purify::bppp::ExperimentalCircuitCache::size ( ) const
noexcept

Definition at line 176 of file bppp.cpp.


The documentation for this class was generated from the following files: