8#ifndef BOTAN_XMSS_WOTS_H_
9#define BOTAN_XMSS_WOTS_H_
11#include <botan/asn1_obj.h>
12#include <botan/exceptn.h>
13#include <botan/pk_keys.h>
15#include <botan/secmem.h>
16#include <botan/xmss_hash.h>
65 const std::string&
name()
const
95 size_t len()
const {
return m_len; }
97 size_t len_1()
const {
return m_len_1; }
99 size_t len_2()
const {
return m_len_2; }
101 size_t lg_w()
const {
return m_lg_w; }
109 return m_oid == p.m_oid;
113 static const std::map<std::string, ots_algorithm_t> m_oid_name_lut;
116 std::string m_hash_name;
117 size_t m_element_size;
144 : m_ots_sig(ots_sig), m_auth_path(auth_path)
149 : m_ots_sig(
std::move(ots_sig)),
150 m_auth_path(
std::move(auth_path))
274 m_key(pub_key_from_signature(msg,
343 throw Not_Implemented(
"No AlgorithmIdentifier available for XMSS-WOTS.");
373 return !(*
this == key);
688 return m_private_seed;
716 throw Not_Implemented(
"No AlgorithmIdentifier available for XMSS-WOTS.");
747 secure_vector<uint8_t> m_private_seed;
size_t wots_parameter() const
const std::string & hash_function_name() const
size_t element_size() const
XMSS_WOTS_Parameters(const std::string &algo_name)
ots_algorithm_t oid() const
void append_checksum(secure_vector< uint8_t > &data)
secure_vector< uint8_t > base_w(const secure_vector< uint8_t > &msg, size_t out_size) const
size_t estimated_strength() const
const std::string & name() const
static ots_algorithm_t xmss_wots_id_from_string(const std::string ¶m_set)
bool operator==(const XMSS_WOTS_Parameters &p) const
const secure_vector< uint8_t > & private_seed() const
wots_keysig_t generate_private_key(const secure_vector< uint8_t > &priv_seed)
XMSS_WOTS_PrivateKey(XMSS_WOTS_Parameters::ots_algorithm_t oid)
void set_private_seed(secure_vector< uint8_t > &&private_seed)
secure_vector< uint8_t > private_key_bits() const override
XMSS_WOTS_PublicKey generate_public_key(XMSS_Address &adrs)
wots_keysig_t operator[](const XMSS_Address &adrs)
wots_keysig_t sign(const secure_vector< uint8_t > &msg, XMSS_Address &adrs)
XMSS_WOTS_PrivateKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, const secure_vector< uint8_t > &public_seed, const secure_vector< uint8_t > &private_seed)
AlgorithmIdentifier pkcs8_algorithm_identifier() const override
XMSS_WOTS_PrivateKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, RandomNumberGenerator &rng)
void set_private_seed(const secure_vector< uint8_t > &private_seed)
XMSS_WOTS_PrivateKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, const secure_vector< uint8_t > &public_seed)
void generate_public_key(XMSS_WOTS_PublicKey &pub_key, wots_keysig_t &&in_key_data, XMSS_Address &adrs)
wots_keysig_t at(size_t i, XMSS_Hash &hash)
wots_keysig_t operator[](size_t i)
XMSS_WOTS_PrivateKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, const secure_vector< uint8_t > &public_seed, RandomNumberGenerator &rng)
wots_keysig_t & ots_signature()
TreeSignature(wots_keysig_t &&ots_sig, wots_keysig_t &&auth_path)
const wots_keysig_t & ots_signature() const
TreeSignature(const wots_keysig_t &ots_sig, const wots_keysig_t &auth_path)
const wots_keysig_t & authentication_path() const
wots_keysig_t & authentication_path()
XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, secure_vector< uint8_t > &&public_seed, wots_keysig_t &&key)
XMSS_WOTS_Parameters m_wots_params
const secure_vector< uint8_t > & public_seed() const
const wots_keysig_t & key_data() const
const XMSS_WOTS_Parameters & wots_parameters() const
const secure_vector< uint8_t > & operator[](size_t i) const
XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, RandomNumberGenerator &rng)
secure_vector< uint8_t > m_public_seed
size_t key_length() const override
void chain(secure_vector< uint8_t > &x, size_t start_idx, size_t steps, XMSS_Address &adrs, const secure_vector< uint8_t > &public_seed)
XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, const secure_vector< uint8_t > &public_seed, const wots_keysig_t &key)
XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, const secure_vector< uint8_t > &msg, const wots_keysig_t &sig, XMSS_Address &adrs, const secure_vector< uint8_t > &public_seed)
size_t estimated_strength() const override
wots_keysig_t & key_data()
XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid)
bool operator==(const XMSS_WOTS_PublicKey &key)
std::vector< uint8_t > public_key_bits() const override
void set_public_seed(secure_vector< uint8_t > &&public_seed)
XMSS_WOTS_PublicKey(XMSS_WOTS_Parameters::ots_algorithm_t oid, secure_vector< uint8_t > public_seed)
AlgorithmIdentifier algorithm_identifier() const override
bool check_key(RandomNumberGenerator &, bool) const override
void set_public_seed(const secure_vector< uint8_t > &public_seed)
std::string algo_name() const override
bool operator!=(const XMSS_WOTS_PublicKey &key)
secure_vector< uint8_t > & public_seed()
void chain(secure_vector< uint8_t > &x, size_t start_idx, size_t steps, XMSS_Address &adrs, const secure_vector< uint8_t > &public_seed, XMSS_Hash &hash)
void set_key_data(const wots_keysig_t &key_data)
secure_vector< uint8_t > & operator[](size_t i)
void set_key_data(wots_keysig_t &&key_data)
int(* final)(unsigned char *, CTX *)
std::vector< secure_vector< uint8_t > > wots_keysig_t
std::vector< T, secure_allocator< T > > secure_vector