Martin Buchner
Martin Buchner
@mehalter the spinner isn't spinning, because `notif_data.spinner` never gets set to any value and the `update_spinner` therefore never actually does something. I guess, `notif_data.spinner = 1` should happen for the...
There is also a `notif_data.spinner = nil` assignment missing for when the the progress is complete. The `notif_data = {}` assignment doesn't help, because the `update_spinner` function will continue to...
I found [this code](https://wiki.sei.cmu.edu/confluence/display/c/MSC30-C.+Do+not+use+the+rand%28%29+function+for+generating+pseudorandom+numbers) ```c #include #include #include #pragma comment(lib, "Bcrypt") void func(void) { BCRYPT_ALG_HANDLE Prov; int Buffer; if (!BCRYPT_SUCCESS( BCryptOpenAlgorithmProvider(&Prov, BCRYPT_RNG_ALGORITHM, NULL, 0))) { /* handle error */ }...
The [documentation for `BCryptOpenAlgorithmProvider `](https://docs.microsoft.com/en-us/windows/win32/api/bcrypt/nf-bcrypt-bcryptopenalgorithmprovider) states > Because of the number and type of operations that are required to find, load, and initialize an algorithm provider, the BCryptOpenAlgorithmProvider function is...
[This](https://sourceforge.net/p/predef/wiki/Architectures/) website is helpful for finding appropriate preprocessor defines for detecting the CPU architecture.
[Here](https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-160) Microsoft lists their preprocessor defines. `_M_ARM` and `_M_ARM64` look like good candidates for detecting 32-bit and 64-bit ARM.
I've added this block of code to `tomcrypt_cfg.h` ```c /* detect ARM 32-bit */ #if defined(_M_ARM) #define ENDIAN_LITTLE #define ENDIAN_32BITWORD #endif /* detect ARM 64-bit */ #if defined(_M_ARM64) #define ENDIAN_LITTLE...
In various places libtomcrypt tries to use a constant `src`, but it then has to cast away the constness in order to call the `unsigned_read` function. E.g. see this https://github.com/libtom/libtomcrypt/blob/673f5ce29015a9bba3c96792920a10601b5b0718/src/pk/ecc/ecc_verify_hash.c#L78
I've reimplemented the `_rng_win32` function with bcrypt. ```cmake # CMakeLists.txt if(MSVC) target_link_libraries(tomcrypt PRIVATE Bcrypt) endif() ``` ```c /* rng_get_bytes.c */ #include static unsigned long _rng_win32(unsigned char *buf, unsigned long len,...