// SPDX-FileCopyrightText: 2021 Carl Schwan // // SPDX-License-Identifier: LGPL-2.1-or-later #include "e2ee/qolmutils.h" #include using namespace Quotient; QByteArray Quotient::toKey(const Quotient::PicklingMode &mode) { if (std::holds_alternative(mode)) { return {}; } return std::get(mode).key; } QByteArray Quotient::getRandom(size_t bufferSize) { QByteArray buffer(bufferSize, '0'); QRandomGenerator::system()->generate(buffer.begin(), buffer.end()); return buffer; }