mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibCrypto: Parse and store all RSA private key components
This commit is contained in:
parent
dc1180d6b2
commit
15836cc865
Notes:
sideshowbarker
2024-07-17 10:16:43 +09:00
Author: https://github.com/alimpfard
Commit: 15836cc865
Pull-request: https://github.com/SerenityOS/serenity/pull/23570
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/Hendiadyoin1
5 changed files with 168 additions and 73 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue