LibCrypto: Parse and store all RSA private key components

This commit is contained in:
Ali Mohammad Pur 2024-03-13 12:30:59 +01:00 committed by Andrew Kaster
commit 15836cc865
Notes: sideshowbarker 2024-07-17 10:16:43 +09:00
5 changed files with 168 additions and 73 deletions

View file

@ -10,6 +10,14 @@
namespace Crypto::NumberTheory {
UnsignedBigInteger Mod(UnsignedBigInteger const& a, UnsignedBigInteger const& b)
{
UnsignedBigInteger result;
result.set_to(a);
result.set_to(result.divided_by(b).remainder);
return result;
}
UnsignedBigInteger ModularInverse(UnsignedBigInteger const& a_, UnsignedBigInteger const& b)
{
if (b == 1)