- Download oldver verison of my tool from GitHub actions artifacts. https://github.com/MarekKnapek/mk_clib/suites/18431986431/artifacts/1068471379
- Download newer version of my tool from https://github.com/MarekKnapek/mk_clib/suites/18473732200/artifacts/1071599132
- Find some large file on your hard disk (>1GB) or create new one.
- You can use the dd tool for Windows from http://www.chrysocome.net/dd to create new file.
dd bs=1M count=1k if=/dev/random of=plaintext.bin --progress
- Encrypt the file with the Serpent cipher using the CTR mode and measure how long it took.
- I'm using the unix time utility from https://github.com/skeeto/w64devkit
- Command to encrypt:
c:\path\to\w64devkit64\bin\time.exe .\mkcc-release-x64.exe /direction encrypt /alg serpent /padding pkcs7 /mode ctr /kdf pbkdf2_sha2_512_256 /password Hunter2 /salt cryptor /cost 1000 /input plaintext.bin /output ciphertext.bin
- Repeat the measurement with newver version of my tool. This version is able to detect an
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stddef.h> /* NULL */ | |
| #include <stdio.h> /* printf fflush */ | |
| #include <stdlib.h> /* abort */ | |
| #include <errno.h> /* errno EINTR */ | |
| #include <poll.h> /* pollfd poll */ | |
| #include <sys/timerfd.h> /* timerfd_create CLOCK_MONOTONIC timerfd_settime */ | |
| #include <time.h> /* itimerspec timespec */ | |
| #include <unistd.h> /* close */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <assert.h> /* assert */ | |
| #include <stdint.h> /* uintptr_t */ | |
| #include <string.h> /* memset memcpy */ | |
| #include <emmintrin.h> /* SSE2 _mm_add_epi32 _mm_load_si128 _mm_set_epi64x _mm_shuffle_epi32 _mm_store_si128 */ | |
| #include <tmmintrin.h> /* SSSE3 _mm_alignr_epi8 _mm_shuffle_epi8 */ | |
| #include <smmintrin.h> /* SSE4.1 _mm_blend_epi16 */ | |
| #include <immintrin.h> /* SHA _mm_sha256msg1_epu32 _mm_sha256msg2_epu32 _mm_sha256rnds2_epu32 */ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| void xxxxxxxxxx() noexcept(true) = delete; | |
| #define my_assert(x) ((!!(x)) ? ((void)(0)) : ((void)(xxxxxxxxxx()))) | |
| typedef decltype(1uz) my_usize_t; | |
| typedef unsigned char my_uint8_t; | |
| typedef unsigned int my_uint32_t; | |
| typedef unsigned long long int my_uint64_t; | |
| struct my_string_view |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdbool.h> /* false */ | |
| #include <stdio.h> /* printf */ | |
| #include <stdlib.h> /* malloc free exit srand rand NULL */ | |
| #include <time.h> /* time_t time */ | |
| #define width 12 | |
| #define height 8 | |
| #define elem_size 3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <string.h> | |
| #define crash(x) do{ if(!(x)){ __debugbreak(); int volatile* volatile ptr; ptr = 0; *ptr = 0; } }while(false) | |
| #define min(a, b) (((b) < (a)) ? (b) : (a)) | |
| void test_1(unsigned char const* const data, size_t const size) noexcept | |
| { | |
| uint8_t state[256]; | |
| struct bcomp_state state_out; | |
| uint16_t bcomp_bits; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define mk_lang_jumbo_want 1 | |
| /* You need my library from https://github.com/marekKnapek/mk_clib for this. */ | |
| #include "mk_sl_uint32.h" | |
| #include "mk_lang_div_roundup.h" | |
| #define mk_sl_cui_t_name big_fib | |
| #define mk_sl_cui_t_base mk_sl_cui_uint32 | |
| #define mk_sl_cui_t_count mk_lang_div_roundup(346, 32) | |
| #include "mk_sl_cui_inl_fileh.h" | |
| #include "mk_sl_cui_inl_filec.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* you need my library from */ | |
| /* https://github.com/MarekKnapek/mk_clib */ | |
| /* https://www.reddit.com/r/C_Programming/comments/17qgg6u/storing_extremely_large_numbers_in_c/ */ | |
| #define mk_lang_jumbo_want 1 | |
| #include "mk_lang_charbit.h" | |
| #include "mk_lang_sizeof.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include "mk_lib_crypto_hash_stream_blake3.h" | |
| #include <array> /* std::array */ | |
| #include <string_view> /* std::string_view */ | |
| constexpr auto blake3_constexpr(std::string_view const& str_a, char const& char_a, std::string_view const& str_b, char const& char_b) | |
| { | |
| mk_lib_crypto_hash_stream_blake3_t hash{}; | |
| std::size_t i{}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define WANT_CONST 1 | |
| #include <cstdio> | |
| class my_type | |
| { | |
| public: | |
| my_type() noexcept; |
NewerOlder