8#include <botan/symkey.h>
29 if(!hex_string.empty())
31 m_data.resize(1 + hex_string.length() / 2);
32 m_data.resize(
hex_decode(m_data.data(), hex_string));
41 m_data.assign(in, in + n);
46uint8_t odd_parity_of(uint8_t x)
53 return (x & 0xFE) ^ (f & 0x01);
63 for(
size_t j = 0; j != m_data.size(); ++j)
64 m_data[j] = odd_parity_of(m_data[j]);
72 return hex_encode(m_data.data(), m_data.size());
80 if(&k ==
this) {
zeroise(m_data);
return (*
this); }
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)
constexpr void copy_mem(T *out, const T *in, size_t n)
bool operator!=(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
bool operator==(const AlgorithmIdentifier &a1, const AlgorithmIdentifier &a2)
void xor_buf(uint8_t out[], const uint8_t in[], size_t length)
void hex_encode(char output[], const uint8_t input[], size_t input_length, bool uppercase)
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