summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCrypto
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-02-14 14:52:18 +0330
committerAndreas Kling <kling@serenityos.org>2021-02-14 13:30:10 +0100
commit48fbf6a88d4822a1e5470cf08f29464511bd72c1 (patch)
tree542afaa21a3d6544d88563215b69b9f533aa657e /Userland/Libraries/LibCrypto
parent3fe7ac0924ada70faaf27636b6e0f40bcde24f77 (diff)
downloadserenity-48fbf6a88d4822a1e5470cf08f29464511bd72c1.zip
LibCrypto: Don't copy the prime test candidates
This was copying a bunch of bigints for no reason.
Diffstat (limited to 'Userland/Libraries/LibCrypto')
-rw-r--r--Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
index 2bc7445701..ecccd2c60e 100644
--- a/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
+++ b/Userland/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
@@ -258,7 +258,7 @@ static bool MR_primality_test(UnsignedBigInteger n, const Vector<UnsignedBigInte
return n == 2;
}
- for (auto a : tests) {
+ for (auto& a : tests) {
// Technically: ASSERT(2 <= a && a <= n - 2)
ASSERT(a < n);
auto x = ModularPower(a, d, n);