mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-21 18:00:16 +00:00
LibCrypto: Add the montgomery modular power algorithm
This algorithm allows for much faster computations of modular powers (around a 5x-10x speedup of the Crypto test). However, it is only valid for odd modulo values, and therefore the old algorithm must be kept for computations involving even modulo values.
This commit is contained in:
parent
5071989545
commit
485adb5e29
Notes:
sideshowbarker
2024-07-18 18:13:40 +09:00
Author: https://github.com/Dexesttp
Commit: 485adb5e29
Pull-request: https://github.com/SerenityOS/serenity/pull/7067
Reviewed-by: https://github.com/alimpfard
5 changed files with 264 additions and 2 deletions
|
@ -58,6 +58,7 @@ public:
|
|||
m_cached_trimmed_length = {};
|
||||
}
|
||||
|
||||
bool is_odd() const { return m_words.size() && (m_words[0] & 1); }
|
||||
bool is_invalid() const { return m_is_invalid; }
|
||||
|
||||
size_t length() const { return m_words.size(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue