Commit graph

18 commits

Author SHA1 Message Date
Pavel Shliak
8d13115d9a LibCrypto: Clean up #include directives
This change aims to improve the speed of incremental builds.
2024-11-21 14:08:33 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Andreas Kling
13d7c09125 Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
asynts
938e5c7719 Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.Everything:

The modifications in this commit were automatically made using the
following command:

    find . -name '*.cpp' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-09 21:11:09 +01:00
AnotherTest
34f8d55100 LibCrypto: Remove spammy ModPow debug log 2020-10-30 23:42:03 +01:00
Andreas Kling
b503f74d25 LibCrypto: Fix MB => MiB build issue 2020-08-16 16:44:09 +02:00
Ben Wiederhake
b7589ff4b6 LibCrypto: Move large functions to cpp file
If they use up so much stack space, contain (sometimes several) loops, and take
a noticable amount of time anyway, then 'inline' is probably going to be ignored
by the compiler anyway.
2020-08-16 16:35:23 +02:00
Ben Wiederhake
bbed5b99fd LibCrypto: Fix random generation and primality tests
It was quite silly that LibCrypto thought that 30! is a prime number! :P
2020-08-16 16:35:23 +02:00
Ben Wiederhake
d33e3b7d8a LibCrypto: Fix random number generation 2020-08-16 16:35:23 +02:00
Ben Wiederhake
708164b0b9 LibCrypto: Already using strong crypto
ModularFunctions::random_number calls into AK::fill_with_random calls (on
Serenity) into arc4random_buf calls into Process::sys calls into
get_good_random_bytes, which is cryptographically secure.
2020-07-28 19:10:10 +02:00
Linus Groh
fbb1d9afe5 LibCrypto: Make ModularFunctions.h compile as part of Lagom
Compiler was complaining about two ambiguous overloads.

Also make some functions "inline" to fix warnings about unused
functions.
2020-06-07 19:29:40 +02:00
AnotherTest
d8208fd37c LibCrypto: Add a simple SignedBigInteger
This patchset adds a simple SignedBigInteger that is entirely defined in
terms of UnsignedBigInteger.

It also adds a NumberTheory::Power function, which is terribly
inefficient, but since the use of exponentiation is very much
discouraged for large inputs, no particular attempts were made
to make it more performant.
2020-06-05 13:29:44 +02:00
Andreas Kling
c1dd67e792 LibCrypto+LibTLS: Use AK/Random.h
This makes it possible to build both of these on Linux.
2020-05-27 12:28:17 +02:00
DexesTTP
8aeccf4f02 LibCrypto: Added BigInteger 'division by u16' operator 2020-05-03 14:31:26 +02:00
DexesTTP
0efd58bf6d LibCrypto: Changed ModularFunctions to use non-allocating operations
This change leads to between 10% and 35% performance improvement when executing
the RSA decryption method.

The main impact is to drastically reduce the number of allocations done in this
method from around 50% of the profile hits to less than 2%.
2020-05-03 14:31:26 +02:00
AnotherTest
adab43987d LibCrypto: Rename UnsignedBigInteger APIs to match their actions 2020-05-02 12:24:10 +02:00
AnotherTest
05e2c7d9cf LibCrypto+LibTLS: Reformat everything
I have no idea how I'll squash _this_ one...
2020-05-02 12:24:10 +02:00
AnotherTest
7adb93ede9 LibCrypto: Implement RSA in terms of UnsignedBigInteger
This commit also adds enough ASN.1/DER to parse RSA keys
2020-05-02 12:24:10 +02:00