Botan  2.7.0
Crypto and TLS for C++11
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 21 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 38 of file xmss_index_registry.cpp.

40  {
41  size_t pos = get(make_key_id(private_seed, prf));
42 
43  if(pos < std::numeric_limits<size_t>::max())
44  {
45  return m_leaf_indices[pos];
46  }
47  else
48  {
49  return m_leaf_indices[add(make_key_id(private_seed, prf))];
50  }
51  }

◆ 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 32 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: