8#ifndef BOTAN_SYMMETRIC_ALGORITHM_H_
9#define BOTAN_SYMMETRIC_ALGORITHM_H_
11#include <botan/symkey.h>
12#include <botan/types.h>
36 m_min_keylen(min_k), m_max_keylen(max_k ? max_k : min_k), m_keylen_mod(k_mod) {}
43 return ((length >= m_min_keylen) && (length <= m_max_keylen) && (length % m_keylen_mod == 0));
71 size_t m_min_keylen, m_max_keylen, m_keylen_mod;
107 bool valid_keylength(
size_t length)
const {
return key_spec().valid_keylength(length); }
119 void set_key(std::span<const uint8_t> key);
126 void set_key(
const uint8_t key[],
size_t length) {
set_key(std::span{key, length}); }
131 virtual std::string
name()
const = 0;
143 throw_key_not_set_error();
148 void throw_key_not_set_error()
const;
154 virtual void key_schedule(std::span<const uint8_t> key) = 0;
Key_Length_Specification(size_t keylen)
Key_Length_Specification(size_t min_k, size_t max_k, size_t k_mod=1)
size_t maximum_keylength() const
bool valid_keylength(size_t length) const
size_t keylength_multiple() const
Key_Length_Specification multiple(size_t n) const
size_t minimum_keylength() const
const uint8_t * begin() const
bool valid_keylength(size_t length) const
void set_key(const SymmetricKey &key)
virtual std::string name() const =0
virtual bool has_keying_material() const =0
size_t maximum_keylength() const
size_t minimum_keylength() const
void set_key(const uint8_t key[], size_t length)
void assert_key_material_set() const
virtual ~SymmetricAlgorithm()=default
virtual Key_Length_Specification key_spec() const =0
void assert_key_material_set(bool predicate) const
int(* final)(unsigned char *, CTX *)
#define BOTAN_PUBLIC_API(maj, min)