Botan  2.16.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 25 of file xmss_index_registry.h.

Constructor & Destructor Documentation

◆ XMSS_Index_Registry()

Botan::XMSS_Index_Registry::XMSS_Index_Registry ( const XMSS_Index_Registry )

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.

private_seedPart of the unique identifier for an XMSS_PrivateKey.
prfPart of the unique identifier for an XMSS_PrivateKey.
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));
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 ( )

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

Reference to unique XMSS index registry.

Definition at line 36 of file xmss_index_registry.h.

37  {
38  static XMSS_Index_Registry self;
39  return self;
40  }
XMSS_Index_Registry(const XMSS_Index_Registry &)=delete

◆ operator=()

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

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