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;
100 virtual void key_schedule(
const uint8_t key[],
size_t length) = 0;
size_t minimum_keylength() const
void set_key(const uint8_t key[], size_t length)
bool valid_keylength(size_t length) const
void set_key(const SymmetricKey &key)
void set_key(const std::vector< uint8_t, Alloc > &key)
virtual ~SymmetricAlgorithm()
const uint8_t * begin() const
size_t maximum_keylength() const