Botan 3.4.0
Crypto and TLS for C&
Public Member Functions | Static Public Member Functions | List of all members
Botan::XMSS_Index_Registry Class Referencefinal

#include <xmss_index_registry.h>

Public Member Functions

std::shared_ptr< Atomic< size_t > > get (const secure_vector< uint8_t > &private_seed, const secure_vector< uint8_t > &prf)
 
XMSS_Index_Registryoperator= (const XMSS_Index_Registry &)=delete
 
 XMSS_Index_Registry (const XMSS_Index_Registry &)=delete
 

Static Public Member Functions

static XMSS_Index_Registryget_instance ()
 

Detailed Description

A registry for XMSS private keys, keeps track of the leaf index for independend copies of the same key.

Definition at line 23 of file xmss_index_registry.h.

Constructor & Destructor Documentation

◆ XMSS_Index_Registry()

Botan::XMSS_Index_Registry::XMSS_Index_Registry ( const XMSS_Index_Registry & )
delete

Member Function Documentation

◆ get()

std::shared_ptr< Atomic< size_t > > Botan::XMSS_Index_Registry::get ( const secure_vector< uint8_t > & private_seed,
const secure_vector< uint8_t > & prf )

Retrieves the last unused leaf index for the private key identified by private_seed and prf. The leaf index will be updated properly across independent copies of private_key.

Parameters
private_seedPart of the unique identifier for an XMSS_PrivateKey.
prfPart of the unique identifier for an XMSS_PrivateKey.
Returns
last unused leaf index for private_key.

Definition at line 35 of file xmss_index_registry.cpp.

36 {
37 size_t pos = get(make_key_id(private_seed, prf));
38
39 if(pos < std::numeric_limits<size_t>::max()) {
40 return m_leaf_indices[pos];
41 } else {
42 return m_leaf_indices[add(make_key_id(private_seed, prf))];
43 }
44}
std::shared_ptr< Atomic< size_t > > get(const secure_vector< uint8_t > &private_seed, const secure_vector< uint8_t > &prf)

References get().

Referenced by get().

◆ get_instance()

static XMSS_Index_Registry & Botan::XMSS_Index_Registry::get_instance ( )
inlinestatic

Retrieves a handle to the process-wide unique XMSS index registry.

Returns
Reference to unique XMSS index registry.

Definition at line 33 of file xmss_index_registry.h.

33 {
34 static XMSS_Index_Registry self;
35 return self;
36 }
XMSS_Index_Registry(const XMSS_Index_Registry &)=delete

◆ operator=()

XMSS_Index_Registry & Botan::XMSS_Index_Registry::operator= ( const XMSS_Index_Registry & )
delete

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