8#ifndef BOTAN_STATEFUL_KEY_INDEX_REGISTRY_H_
9#define BOTAN_STATEFUL_KEY_INDEX_REGISTRY_H_
11#include <botan/mutex.h>
12#include <botan/types.h>
51 KeyId(std::string_view algo_name,
52 std::span<const uint8_t> algo_params,
54 std::span<const uint8_t> key_material_1,
55 std::span<const uint8_t> key_material_2);
70 std::array<uint8_t, 32> m_val{};
71 uint32_t m_process_id = 0;
72 uint64_t m_max_operations = 0;
112 typedef std::map<KeyId, uint64_t> RegistryMap;
114 RegistryMap::iterator lookup(
const KeyId& key_id);
115 bool fork_detected(
const KeyId& key_id);
120 RegistryMap m_registry;
121 uint32_t m_process_id = 0;
122 bool m_fork_detected =
false;
KeyId(std::string_view algo_name, std::span< const uint8_t > algo_params, uint64_t max_operations, std::span< const uint8_t > key_material_1, std::span< const uint8_t > key_material_2)
uint64_t max_operations() const
friend class Stateful_Key_Index_Registry
bool operator==(const KeyId &other) const
auto operator<=>(const KeyId &other) const
uint64_t current_index(const KeyId &key_id)
Stateful_Key_Index_Registry & operator=(Stateful_Key_Index_Registry &&)=delete
uint64_t remaining_operations(const KeyId &key_id)
std::optional< uint64_t > reserve_next_index(const KeyId &key_id)
Stateful_Key_Index_Registry & operator=(const Stateful_Key_Index_Registry &)=delete
Stateful_Key_Index_Registry(Stateful_Key_Index_Registry &&)=delete
void set_index_lower_bound(const KeyId &key_id, uint64_t min)
static Stateful_Key_Index_Registry & global()
Stateful_Key_Index_Registry(const Stateful_Key_Index_Registry &)=delete
~Stateful_Key_Index_Registry()