1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 10:18:15 +09:00
ladybird/Libraries/LibCrypto/NumberTheory/ModularFunctions.cpp
devgianlu 1c3d849b8b LibCrypto: Remove unused big numbers modular functions
Remove `Mod`, `ModularInverse`, `ModularPower` and `LCM` as
they are unused.
2025-04-28 12:05:26 +02:00

28 lines
771 B
C++

/*
* Copyright (c) 2020, Ali Mohammad Pur <mpfard@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <AK/Debug.h>
#include <AK/Random.h>
#include <LibCrypto/BigInt/Algorithms/UnsignedBigIntegerAlgorithms.h>
#include <LibCrypto/NumberTheory/ModularFunctions.h>
#include <LibCrypto/SecureRandom.h>
namespace Crypto::NumberTheory {
UnsignedBigInteger GCD(UnsignedBigInteger const& a, UnsignedBigInteger const& b)
{
UnsignedBigInteger temp_a { a };
UnsignedBigInteger temp_b { b };
UnsignedBigInteger temp_quotient;
UnsignedBigInteger temp_remainder;
UnsignedBigInteger output;
UnsignedBigIntegerAlgorithms::destructive_GCD_without_allocation(temp_a, temp_b, temp_quotient, temp_remainder, output);
return output;
}
}