summaryrefslogtreecommitdiff
path: root/Userland/test-crypto.cpp
AgeCommit message (Collapse)Author
2020-08-12Test: Mark compilation-unit-only functions as staticBen Wiederhake
This enables a nice warning in case a function becomes dead code. Also, in the case of test-crypto.cpp, I took the liberty to add the prefix 'g_' to the global event loop.
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-06Refactor: Expose const_cast by removing ByteBuffer::warp(const void*, size_t)asynts
This function did a const_cast internally which made the call side look "safe". This method is removed completely and call sites are replaced with ByteBuffer::wrap(const_cast<void*>(data), size) which makes the behaviour obvious.
2020-08-05LibTLS + LibCrypto: Suppress unobserved Optoinal<T> return values.Brian Gianforcaro
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-27LibCrypto: Change [XXX]BigInteger::export_data() to use Span.asynts
2020-06-07Meta: Run Crypto tests in CIAnotherTest
We skip the tests that are not self-contained (TLS) to avoid adding extra variables to the tests.
2020-06-07test-crypto: Return 1 if any test failedAnotherTest
2020-06-07LibCrypto: Add bitwise operations (and/or/xor)AnotherTest
2020-06-05LibCrypto: Add a simple SignedBigIntegerAnotherTest
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-04test-crypto: Add a test for #2488AnotherTest
2020-05-29LibCrypto: Fix some issues preventing compilation w/ clang 10AnotherTest
2020-05-27test-crypto: Tweaks to make this build properly in LagomAndreas Kling
2020-05-27LibLine: Use Core::EventLoop for outer read loopAnotherTest
This commit changes LibLine's internal structure to work in an event loop, and as a result, also switches it to being a Core::Object.
2020-05-25LibLine: Change get_line to return a Result<String, Error>AnotherTest
This fixes a bunch of FIXME's in LibLine. Also handles the case where read() would read zero bytes in vt_dsr() and effectively block forever by erroring out. Fixes #2370
2020-05-20Revert "Build: Include headers from LibC, LibM, and LibPthread with -isystem"Andreas Kling
This reverts commit c1eb744ff0a82cf6c8e3470ac10e2f417c7d9de2.
2020-05-20Build: Include headers from LibC, LibM, and LibPthread with -isystemAndrew Kaster
Make sure that userspace is always referencing "system" headers in a way that would build on target :). This means removing the explicit include_directories of Libraries/LibC in favor of having it export its headers as SYSTEM. Also remove a redundant include_directories of Libraries in the 'serenity build' part of the build script. It's already set at the top. This causes issues for the Kernel, and for crt0.o. These special cases are handled individually.
2020-05-18test-crypto: Don't put TLSv12 in an OwnPtr as it's ref-counted :)Andreas Kling
2020-05-09Userland: Add missing copyright header to test-crypto.cppLinus Groh
2020-05-03LibCrypto: Small fixes in BigInteger & test-cryptoDexesTTP
2020-05-03test-crypto: Display execution time for passing testsDexesTTP
2020-05-02Userland: Tweak the tests in test-cryptoAnotherTest
- Clarify the purpose of "AES | Specialised Encrypt" - Decouple the TLS test from the host machine - Add a "test" mode to run all available tests
2020-05-02LibCrypto: Rename UnsignedBigInteger APIs to match their actionsAnotherTest
2020-05-02Userland test-crypto: Add interactive mode for the tls 'mode'AnotherTest
For all your raw TLS testing needs :^)
2020-05-02LibTLS: Switch to Hash::Manager for hashing and add SHA1AnotherTest
Now we can talk to google.com
2020-05-02LibCrypto: Implement SHA1 Hash FunctionAnotherTest
2020-05-02Userland: Adapt test-crypto to the new AK::Result APIAnotherTest
2020-05-02LibTLS: Implement a preliminary version of the TLS protocolAnotherTest
TLS::TLSv12 is a Core::Socket, however, I think splitting that into a TLS::Socket would probably be beneficial
2020-05-02LibCrypto: Fix issues in the Crypto stackAnotherTest
This commit fixes up the following: - HMAC should not reuse a single hasher when successively updating - AES Key should not assume its user key is valid signed char* - Mode should have a virtual destructor And adds a RFC5246 padding mode, which is required for TLS
2020-05-02LibCrypto: Implement RSA in terms of UnsignedBigIntegerAnotherTest
This commit also adds enough ASN.1/DER to parse RSA keys
2020-05-02LibCrypto: Add ::import_data() and ::export_data() to UnsignedBigIntegerAnotherTest
These functions allow conversion to-and-from big-endian buffers This commit also adds a ""_bigint operator for easy bigint use
2020-05-02LibCrypto: Add base-10 string de/serialization methods for bigintItamar
2020-05-02LibCrypto: Fix bug in big int subtractionItamar
A regression test was added to the suite. This commit also generally simplifies the subtraction method.
2020-05-02LibCrypto: Add UnsignedBigInteger divisionItamar
The division operation returns both the quotient and the remainder.
2020-05-02LibCrypto: Add UnsignedBigInteger multiplicationItamar
Also added documentation for the runtime complexity of some operations.
2020-05-02LibCrypto: Fix a bug in big int additionItamar
There was a bug when dealing with a carry when the addition result for the current word was UINT32_MAX. This commit also adds a regression test for the bug.
2020-05-02LibCrypto: Add UnsignedBigInteger subtraction and comparisonItamar
2020-05-02LibCrypto: Add UnsignedBigInteger and implement additionItamar
UnsignedBigInteger stores an unsigned ainteger of arbitrary length. A big integer is represented as a vector of word. Each word is an unsigned int.
2020-05-02LibCrypto: Add SHA512AnotherTest
There is quite a bit of avoidable duplication, however, I could not get the compiler to be happy about SHA2<Size> (see FIXMEs)
2020-05-02LibCrypto: Add SHA256 hash functionAnotherTest
2020-05-02LibCrypto: Implement HMACAnotherTest
2020-05-02LibCrypto: Move each subsection into its own namespaceAnotherTest
2020-05-02Userland: Add MD5 tests to test-cryptoAnotherTest
This commit also reworks the test program to have a better interface: `test-crypto <mode> [options]` where each mode has its own default suite
2020-05-02LibCrypto: Implement Cipher and AES_CBCAnotherTest
Also adds a test program to userland