/* * Copyright (c) 2020, Ali Mohammad Pur * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include 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; } }