- 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 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 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 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 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 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; |
This file contains 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
// ========== ========== | |
// library begin | |
// ========== ========== | |
#include <algorithm> // min | |
#include <array> // array | |
#include <cassert> // assert | |
#include <cstdint> // uint64_t, uint32_t, uint16_t, uint8_t, uintptr_t | |
#include <cstdlib> // abort |
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 1 column, instead of 3 in line 2.
This file contains 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
"Windows 7 64bit (amd64), version 6.1.7601." | |
"apisetschema.dll version 6.1.7601.24499." | |
"MS-Win-Core-Console-L1-1-0","","kernel32.dll" | |
"MS-Win-Core-DateTime-L1-1-0","","kernel32.dll" | |
"MS-Win-Core-Debug-L1-1-0","","kernelbase.dll" | |
"MS-Win-Core-DelayLoad-L1-1-0","","kernel32.dll" | |
"MS-Win-Core-ErrorHandling-L1-1-0","","kernel32.dll" | |
"MS-Win-Core-ErrorHandling-L1-1-0","kernel32.dll","kernelbase.dll" | |
"MS-Win-Core-Fibers-L1-1-0","","kernelbase.dll" |