diff options
author | DexesTTP <dexes.ttp@gmail.com> | 2021-05-13 09:37:14 +0200 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-13 19:18:07 +0100 |
commit | fd80e7a339ccbaa2154879098b8a042471f48d2d (patch) | |
tree | 8b4d8a70454e9e9c2bc619c1e0c53bd3335bba29 /Userland/Libraries/LibCrypto | |
parent | ac6bd3a7a4644ebf3dd0d35a5d204346572079eb (diff) | |
download | serenity-fd80e7a339ccbaa2154879098b8a042471f48d2d.zip |
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!
Diffstat (limited to 'Userland/Libraries/LibCrypto')
-rw-r--r-- | Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h index 44a13a85fa..489cd5c634 100644 --- a/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h +++ b/Userland/Libraries/LibCrypto/BigInt/UnsignedBigInteger.h @@ -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: |