8#include <botan/symkey.h>
11#include <botan/mem_ops.h>
28 if(!hex_string.empty()) {
29 m_data.resize(1 + hex_string.length() / 2);
30 m_data.resize(
hex_decode(m_data.data(), hex_string));
38 m_data.assign(in, in + n);
43uint8_t odd_parity_of(uint8_t x) {
49 return (x & 0xFE) ^ (f & 0x01);
58 for(
size_t j = 0; j != m_data.size(); ++j) {
59 m_data[j] = odd_parity_of(m_data[j]);
67 return hex_encode(m_data.data(), m_data.size());
secure_vector< uint8_t > bits_of() const
OctetString & operator^=(const OctetString &other)
OctetString(std::string_view str="")
const uint8_t * begin() const
std::string to_string() const
void random_vec(std::span< uint8_t > v)
void zeroise(std::vector< T, Alloc > &vec)
OctetString operator^(const OctetString &k1, const OctetString &k2)
OctetString operator+(const OctetString &k1, const OctetString &k2)
bool operator!=(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
void hex_encode(char output[], const uint8_t input[], size_t input_length, bool uppercase)
constexpr void xor_buf(ranges::contiguous_output_range< uint8_t > auto &&out, ranges::contiguous_range< uint8_t > auto &&in)
size_t hex_decode(uint8_t output[], const char input[], size_t input_length, size_t &input_consumed, bool ignore_ws)
std::vector< T, secure_allocator< T > > secure_vector
constexpr void copy_mem(T *out, const T *in, size_t n)