8#include <botan/rfc3394.h>
10#include <botan/block_cipher.h>
11#include <botan/nist_keywrap.h>
18 const std::string cipher_name =
"AES-" + std::to_string(8 * kek.
size());
22 std::vector<uint8_t> wrapped =
nist_key_wrap(key.data(), key.size(), *aes);
29 BOTAN_ARG_CHECK(key.size() >= 16 && key.size() % 8 == 0,
"Bad input key size for NIST key unwrap");
31 const std::string cipher_name =
"AES-" + std::to_string(8 * kek.
size());
#define BOTAN_ARG_CHECK(expr, msg)
static std::unique_ptr< BlockCipher > create_or_throw(std::string_view algo_spec, std::string_view provider="")
std::vector< uint8_t > nist_key_wrap(const uint8_t input[], size_t input_len, const BlockCipher &bc)
secure_vector< uint8_t > rfc3394_keywrap(const secure_vector< uint8_t > &key, const SymmetricKey &kek)
secure_vector< uint8_t > rfc3394_keyunwrap(const secure_vector< uint8_t > &key, const SymmetricKey &kek)
std::vector< T, secure_allocator< T > > secure_vector
secure_vector< uint8_t > nist_key_unwrap(const uint8_t input[], size_t input_len, const BlockCipher &bc)