*/
#include <encryption-decryption-env.h>
+#include <ckm-common.h>
using namespace CKM;
size_t left,
CKM::RawBuffer& output)
{
+#ifdef TZ_BACKEND
+ ckmc_backend_info_h info;
+ size_t maxSize;
+ // All unexportable keys go to TZ if enabled (and all of them are unexportable)
+ assert_positive(ckmc_get_backend_info, CKMC_BACKEND_TZ, &info);
+ assert_positive(ckmc_backend_get_max_chunk_size, info, &maxSize);
+ const size_t CHUNK_SIZE = 80 < maxSize ? 80 : maxSize;
+#else
const size_t CHUNK_SIZE = 80;
+#endif
ckmc_raw_buffer_s* out = nullptr;
ckmc_raw_buffer_s* in = nullptr;
size_t size = CHUNK_SIZE;