You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Compatibility warning: the AES-CTR fix below changes the keystream produced when the cipher is called with sub-block chunks (smaller than 16 bytes) or when a call leaves the stream index mid-block. One-shot AES-CTR encryption was already correct and is unaffected. Ciphertext written by 2.x via the chunked path is non-standard and cannot be decrypted by 3.0.0 — decrypt with the previous release and re-encrypt with 3.0.0 to migrate stored data.
Bugfix: AES-CTR produced an incorrect keystream when called with sub-block chunks (smaller than the 16-byte block size). Ciphertext did not match other AES-CTR implementations; intra-library encrypt/decrypt still round-tripped, which had masked the defect.
Bugfix: Rc4Initialise and Rc4XorWithKey were undefined behaviour when KeySize=0. Both now return int (-1 on invalid key, 0 otherwise). Existing callers that ignored the previous void return continue to compile.
Bugfix: Sha512Calculate (added in 2.3.0) was implemented but never declared in WjCryptLib_Sha512.h. The declaration has been added.
Bugfix: WjCryptLibTest AES-CBC had a stack buffer overflow that corrupted the IV. The CBC algorithm itself was unaffected.
Bugfix: HexToBytes in WjCryptLibTest now takes a MaxDataSize and refuses to overflow the destination buffer.
Digest parameter direction corrected from [in] to [out] on Sha1Finalise, Sha1Calculate, Sha256Calculate, Md5Finalise, Md5Calculate, and Sha512Calculate.
WjCryptLib_Sha1.cTransformFunction workspace is now declared as CHAR64LONG16 directly rather than a uint8_t[64] cast (was UB on strict-alignment targets).
Defensive curlen bounds check in Sha256Update and Sha512Update changed to >= for consistency with the corresponding Finalise.
AES_KEY_SIZE_128 replaced with AES_BLOCK_SIZE for the 16-byte cipher blocks in AesCtrXor.
Removed unused STORE64H macro from WjCryptLib_AesCbc.c.
WjCryptLib_Aes.h documentation now refers to the unified AesInitialise rather than the non-existent AesInitialise128/192/256.
Added a Makefile convenience wrapper around CMake with make build, make test, make clean, and make help (the default target). Works on macOS, Linux, and Windows native with GNU Make.
Registered the test harness with ctest, so make test works regardless of cmake generator (including multi-config generators such as Visual Studio).
Added direct test coverage for the *Calculate one-shot functions, AES-CTR sub-block chunked consistency, RC4 zero-length key rejection, and HexToBytes bounds checking.