8#include <botan/rfc3394.h>
9#include <botan/nist_keywrap.h>
10#include <botan/block_cipher.h>
18 "Invalid KEK length for NIST key wrap");
20 const std::string cipher_name =
"AES-" + std::to_string(8*kek.
size());
24 std::vector<uint8_t> wrapped =
nist_key_wrap(key.data(), key.size(), *aes);
32 "Invalid KEK length for NIST key wrap");
35 "Bad input key size for NIST key unwrap");
37 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(const std::string &algo_spec, const std::string &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)