INNER CODE UNIT · C++

prime1

QuasarApp/Qt-Secret · src/Qt-RSA/qrsaencryption.cpp:170

    prime1 = toPrime(genesisInt(hash.left(hash.size() / 2), _rsa / 2));
    prime2 = toPrime(genesisInt(hash.right(hash.size() / 2), _rsa / 2));

}

QRSAEncryption::INT QRSAEncryption::genesisInt(const QByteArray &genesis, int limitBits) const {
    INT result;
    auto hash = QCryptographicHash::hash(genesis, QCryptographicHash::Sha512);
    result.fromHex(hash.toHex().toStdString());
    int powP1 = std::max(static_cast<int>(std::trunc((limitBits) / result.sizeBits())), 1);
    result.pow(powP1);
    INT limit('1', limitBits, 2);

    return result % limit;

}

QRSAEncryption::QRSAEncryption(Rsa rsa) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…