Как я могу прочитать zlib с помощью botan ⇐ C++

Программы на C++. Форум разработчиков
Anonymous
Как я могу прочитать zlib с помощью botan

Сообщение Anonymous »

Я меняю свой код шифрования с crypto++ на botan, у botan есть поддержка zlib
мой код crypto++ работает хорошо, но мне нужно изменить его на botan
У меня есть следующий код Crypto++:

Код: Выделить всё

int readZlib(const uint8_t* src, uint32_t srcLen, uint8_t* bfile, uint32_t* bfileLen) {
try {
CryptoPP::ZlibDecompressor decompressor;
CryptoPP::ArraySource arraySource(src, srcLen, true, new CryptoPP::Redirector(decompressor));

CryptoPP::lword maxRetrievable = decompressor.MaxRetrievable();
if (*bfileLen < static_cast(maxRetrievable)) {
return -1;
}

decompressor.Get(bfile, static_cast(maxRetrievable));
*bfileLen = static_cast(maxRetrievable);
return 0;
}
catch (const CryptoPP::Exception& e) {
std::cerr 

Подробнее здесь: [url]https://stackoverflow.com/questions/79096198/how-can-i-read-zlib-using-botan[/url]

Вернуться в «C++»