2#ifndef _security_details_botan_block_transform_h_
3#define _security_details_botan_block_transform_h_
5#include <security/cryptography/i_crypto_transform.h>
6#include <system/array.h>
10namespace System {
namespace Security {
namespace Cryptography {
namespace Details {
17template<
typename botan_type_traits>
21 typedef typename botan_type_traits::Cipher_Mode Cipher_Mode;
23 typedef typename botan_type_traits::byte byte;
25 template<
typename T>
using secure_vector =
typename botan_type_traits::template secure_vector<T>;
42 secure_vector<byte> buffer(inputCount);
43 botan_type_traits::copy_mem(buffer.data(), &inputBuffer->data()[inputOffset], buffer.size());
45 m_cipher->update(buffer);
47 botan_type_traits::copy_mem(&outputBuffer->data()[outputOffset], buffer.data(), buffer.size());
49 return ASPOSECPP_CHECKED_CAST(
int, buffer.size());
59 secure_vector<byte> buffer(inputCount);
60 botan_type_traits::copy_mem(buffer.data(), &inputBuffer->data()[inputOffset], buffer.size());
62 m_cipher->finish(buffer);
64 ArrayPtr<uint8_t> result = MakeObject<Array<uint8_t>>(ASPOSECPP_CHECKED_CAST(
int, buffer.size()));
65 botan_type_traits::copy_mem(&result->data()[0], buffer.data(), buffer.size());
73 int size = ASPOSECPP_CHECKED_CAST(
int, m_cipher->minimum_final_size());
74 return size ? size : 16;
85 std::unique_ptr<Cipher_Mode> m_cipher;
Pointer class to wrap types being allocated on heap. Use it to manage memory for classes inheriting O...
Definition: smart_ptr.h:180
Definition: db_command.h:9