Coverage Report

Created: 2026-02-07 06:16

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/botan/src/lib/base/sym_algo.cpp
Line
Count
Source
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
9
#include <botan/exceptn.h>
10
#include <botan/symkey.h>
11
12
namespace Botan {
13
14
826
void SymmetricAlgorithm::set_key(const OctetString& key) {
15
826
   set_key(std::span{key.begin(), key.length()});
16
826
}
17
18
0
void SymmetricAlgorithm::throw_key_not_set_error() const {
19
0
   throw Key_Not_Set(name());
20
0
}
21
22
6.39k
void SymmetricAlgorithm::set_key(std::span<const uint8_t> key) {
23
6.39k
   if(!valid_keylength(key.size())) {
24
45
      throw Invalid_Key_Length(name(), key.size());
25
45
   }
26
6.34k
   key_schedule(key);
27
6.34k
}
28
29
}  // namespace Botan