Botan
3.0.0
Crypto and TLS for C&
src
lib
base
sym_algo.cpp
Go to the documentation of this file.
1
/*
2
* (C) 2018 Jack Lloyd
3
*
4
* Botan is released under the Simplified BSD License (see license.txt)
5
*/
6
7
#include <botan/sym_algo.h>
8
#include <botan/exceptn.h>
9
10
namespace
Botan
{
11
12
void
SymmetricAlgorithm::throw_key_not_set_error()
const
13
{
14
throw
Key_Not_Set(
name
());
15
}
16
17
void
SymmetricAlgorithm::set_key
(
const
uint8_t key[],
size_t
length)
18
{
19
if
(!
valid_keylength
(length))
20
throw
Invalid_Key_Length
(
name
(), length);
21
key_schedule(key, length);
22
}
23
24
}
Botan::Invalid_Key_Length
Definition:
exceptn.h:157
Botan::SymmetricAlgorithm::valid_keylength
bool valid_keylength(size_t length) const
Definition:
sym_algo.h:141
Botan::SymmetricAlgorithm::set_key
void set_key(const SymmetricKey &key)
Definition:
sym_algo.h:150
Botan::SymmetricAlgorithm::name
virtual std::string name() const =0
Botan
Definition:
alg_id.cpp:12
Generated by
1.9.6