1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:17:44 +00:00

LibCrypto: Reduce the UnsignedBigInteger inline size to 32 words

We never really needed the 512 words in the first place, and this does
reduce the stack allocations in montgomery modular power from 32Kb to
a more manageable 2Kb :^)

Note that the 32 words size doesn't provide any performance benefits or
drawbacks compared to other values. All values seem to have equivalent
performances (the tested values were 1, 2, 4, ..., 512). But since the
previous value of 512 was definitely too big, let's reduce it for now!
This commit is contained in:
DexesTTP 2021-05-13 09:37:14 +02:00 committed by Linus Groh
parent ac6bd3a7a4
commit fd80e7a339

View file

@ -15,7 +15,7 @@
namespace Crypto {
struct UnsignedDivisionResult;
constexpr size_t STARTING_WORD_SIZE = 512;
constexpr size_t STARTING_WORD_SIZE = 32;
class UnsignedBigInteger {
public: