8 #ifndef BOTAN_SYMMETRIC_ALGORITHM_H_ 9 #define BOTAN_SYMMETRIC_ALGORITHM_H_ 11 #include <botan/key_spec.h> 12 #include <botan/exceptn.h> 13 #include <botan/symkey.h> 14 #include <botan/types.h> 29 virtual void clear() = 0;
41 return key_spec().maximum_keylength();
49 return key_spec().minimum_keylength();
59 return key_spec().valid_keylength(length);
71 template<
typename Alloc>
72 void set_key(
const std::vector<uint8_t, Alloc>& key)
74 set_key(key.data(), key.size());
82 void set_key(
const uint8_t key[],
size_t length)
84 if(!valid_keylength(length))
86 key_schedule(key, length);
92 virtual std::string name()
const = 0;
107 virtual void key_schedule(
const uint8_t key[],
size_t length) = 0;
void verify_key_set(bool cond) const
#define BOTAN_PUBLIC_API(maj, min)
void set_key(const uint8_t key[], size_t length)
bool valid_keylength(size_t length) const
size_t maximum_keylength() const
void set_key(const SymmetricKey &key)
void set_key(const std::vector< uint8_t, Alloc > &key)
size_t minimum_keylength() const
const uint8_t * begin() const