summaryrefslogtreecommitdiff
path: root/Libraries/LibCrypto
AgeCommit message (Collapse)Author
2021-01-12Libraries: Move to Userland/Libraries/Andreas Kling
2021-01-12LibCrypto: Reduce use of ByteBuffer in AES codeAndreas Kling
Use Bytes/ReadonlyBytes more where possible.
2021-01-11Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-11Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect. The modifications in this commit were automatically made using the following command: find . -name '*.h' -exec sed -i -E 's/dbg\(\) << ("[^"{]*");/dbgln\(\1\);/' {} \;
2021-01-11Everywhere: Replace a bundle of dbg with dbgln.asynts
These changes are arbitrarily divided into multiple commits to make it easier to find potentially introduced bugs with git bisect.
2021-01-09Everywhere: Replace a bundle of dbg with dbgln.asynts
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-07LibCrypto+LibJS: Fix broken subtraction of two negative signed bigintsAndreas Kling
Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=29326
2020-12-19LibTLS+LibCrypto: Remove all remaining uses of ByteBuffer::wrap()Andreas Kling
2020-12-19LibCrypto: Yet more ByteBuffer::wrap() removal. Not much left now!Andreas Kling
2020-12-19LibTLS+LibCrypto: More ByteBuffer -> Span conversionAndreas Kling
2020-12-19LibTLS+LibCrypto: Replace a whole bunch of ByteBuffers with SpansAndreas Kling
2020-11-29LibCrypto: Require intent parameter in CTR constructorLuke
This was preventing clang from building.
2020-11-14LibCrypto: Implement GCM modeAnotherTest
2020-11-14LibCrypto: Move out 'VerificationConsistency' into its own header fileAnotherTest
2020-11-14LibCrypto: Templatise CTR<T> on the increment functionAnotherTest
2020-10-30LibCrypto: Remove spammy ModPow debug logAnotherTest
2020-10-20Everywhere: Redundant inline specifier on constexpr functions (#3807)Lenny Maiorani
Problem: - `constexpr` functions are decorated with the `inline` specifier keyword. This is redundant because `constexpr` functions are implicitly `inline`. - [dcl.constexpr], ยง7.1.5/2 in the C++11 standard): "constexpr functions and constexpr constructors are implicitly inline (7.1.2)". Solution: - Remove the redundant `inline` keyword.
2020-09-25Meta+LibC through LibHTTP: Make clang-format-10 cleanBen Wiederhake
Why break at LibHTTP? Because "Meta+Libraries" would be insanely large, and breaking between LibHTTP and LibJS makes the commits roughly evenly large.
2020-08-28LibCrypto: Do not silently ignore key size mismatchBen Wiederhake
Before, when the actually passed key was too long, the extra bytes were silently ignored. This can lead to all sorts of trouble, so ... don't do that. The original intention was maybe to support non-integer amounts of key bytes. But that doesn't happen anyway with AES.
2020-08-25AK: Add Endian.h header to replace NetworkOrdered.h.asynts
2020-08-23LibCrypto: Don't cause errors when function unusedBen Wiederhake
Any (future) program that includes this header would fail to compile, because the private symbol 'kind_name' is defined, along with a bunch of code, but unused. A good way to see this is by #include'ing LibCrypto/ASN1/ASN1.h in an unrelated .cpp-file, for example Userland/md.cpp. No other headers seem to have this problem.
2020-08-17LibCrypto: Don't include <Libraries/...>Andreas Kling
2020-08-17LibCrypto: Call bytes() explicitly instead of implicitly.asynts
This was a careless mistake. https://github.com/SerenityOS/serenity/pull/3166#discussion_r471131732
2020-08-16LibCrypto: Fix MB => MiB build issueAndreas Kling
2020-08-16LibCrypto: Move large functions to cpp fileBen Wiederhake
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-16LibCrypto: Fix random generation and primality testsBen Wiederhake
It was quite silly that LibCrypto thought that 30! is a prime number! :P
2020-08-16LibCrypto: Document word order (endianness) of bigintBen Wiederhake
2020-08-16LibCrypto: Fix random number generationBen Wiederhake
2020-08-15Refactor: Use ReadonlyBytes instead of const ReadonlyBytes&.asynts
2020-08-15AK: Rename span() to bytes() when appropriate.asynts
I originally defined the bytes() method for the String class, because it made it obvious that it's a span of bytes instead of span of characters. This commit makes this more consistent by defining a bytes() method when the type of the span is known to be u8. Additionaly, the cast operator to Bytes is overloaded for ByteBuffer and such.
2020-08-11LibCrypto+LibTLS+Kernel: Switch the Cipher::Mode interface to use SpanAnotherTest
This shaves 2.5 more runtime seconds off 'disasm /bin/id', and makes the Mode<T> interface a lot more allocation-friendly.
2020-08-11Crypto: Make AES call malloc much less oftenNico Weber
ByteBuffer::slice_view() allocates a new ByteBuffer object, which as a RefPtr and everything. Nowadays it should probably return a Bytes / Span<u8>, but AES was only using slice_view() to extract the pointer again. So just add ady a range check at the top, and do pointer arithmetic to do the same thing faster. Reduces time to run `disasm /bin/id` by a bit under 40%, from ~8.3s to ~5s (min-of-3 runs).
2020-08-05LibTLS + LibCrypto: Suppress unobserved Optoinal<T> return values.Brian Gianforcaro
2020-08-02LibCrypto: Format the comments in ASN1/PEM.h correctlyAnotherTest
2020-07-31LibCrypto: Do not trim leading zeros in export_data by defaultAnotherTest
This fixes the issue with the exported data having a leading zero, causing RSA::encrypt to trim the block down, and ruining the encryption. Fixes #2691 :^)
2020-07-30LibCrypto: Add some checksum algorithmsstelar7
Namely CRC32 and Adler32
2020-07-28LibCrypto: Implement and test CTR decryptionBen Wiederhake
2020-07-28LibCrypto: Fix broken CTR mode, implement RFC 3686 Test VectorsBen Wiederhake
2020-07-28LibCrypto: Document CTR weirdness in depthBen Wiederhake
2020-07-28LibCrypto: Already using strong cryptoBen Wiederhake
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-27LibCrypto: Change the signatures of RSA::import_[XXX]_key to use Span.asynts
2020-07-27LibCrypto: Change the signature of decode_pem to use Span.asynts
2020-07-27LibCrypto: Change the signature of RSA::parse_rsa_key to use Span.asynts
2020-07-27LibCrypto: Change [XXX]BigInteger::export_data() to use Span.asynts
2020-07-27LibCrypto: This method wrote to a const pointer.asynts
2020-07-25LibCrypto: Optimize UnsignedBigInteger import_data/export_dataTom
No need to do complicated math to import or export numbers, just convert the byte stream to words and vice versa.
2020-06-25LibCrypto: Add CTR cipher modePeter Elliott
Kernel: Changed fortuna implementation to use CTR mode instead of manually implementing a counter.
2020-06-25LibCrypto: Add missing <AK/StringView.h> includePeter Elliott
2020-06-07LibCrypto: Add bitwise operations (and/or/xor)AnotherTest
2020-06-07LibCrypto: Make ModularFunctions.h compile as part of LagomLinus Groh
Compiler was complaining about two ambiguous overloads. Also make some functions "inline" to fix warnings about unused functions.