Update libtomcrypt and libtommath to latest upstream versions#2510
Draft
PatrickvL wants to merge 10 commits into
Draft
Update libtomcrypt and libtommath to latest upstream versions#2510PatrickvL wants to merge 10 commits into
PatrickvL wants to merge 10 commits into
Conversation
libtomcrypt: 7e7eb69 → 3223b87 (develop branch, +424 commits) libtommath: 08549ad → 652d70a (v1.3.0-351, +603 commits) Required for updated API (crypt_mp_init, mp_unpack/mp_pack) and source file renames (rsa_free→rsa_key, katja removal, etc.).
…A dependency chain
The libtommath submodule uses mp_*.c naming (v1.3.x) but the build file listed old bn_*.c names (v1.1.x), resulting in an empty library. Replace the explicit file list with *.c / *.h globs so it works with any version of the submodule.
- Replace deprecated init_LTM() with crypt_mp_init("ltm")
- Replace removed mp_import() with mp_unpack()
- Replace removed mp_export() with mp_pack()
Reflects upstream renames: pk_get_oid.c→pk_get.c, rsa_free.c→rsa_key.c, ltc_ecc_is_valid_idx.c→ltc_ecc_is_point*.c. Removes deleted files: katja sources, ecc_test.c, subject_public_key_info encoders.
MSVC /Od (Debug) disables all optimization including dead code elimination. s_mp_rand_platform.c has forward declarations for Unix-only random source functions (s_read_arc4random, s_read_getrandom, s_read_urandom) guarded by MP_HAS() which relies on DCE. Enable /O1 for this file in Debug builds.
Strip /RTC1 from Debug flags for libtommath so the per-file /O1 on s_mp_rand_platform.c doesn't conflict. Runtime checks aren't useful for this external math library.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the imported
libtomcryptandlibtommathsubmodules, modernizes build integration for these libraries, and updates cryptographic code to use their latest APIs. The changes improve maintainability, compatibility with upstream, and ensure the project uses the most up-to-date cryptographic primitives and interfaces.Library Updates:
import/libtomcryptandimport/libtommathsubmodules to newer commits, bringing in upstream changes and improvements. [1] [2]Build System Improvements:
libtommathby using glob patterns for headers and sources (*.h,*.c), replacing long explicit file lists.libtomcryptfeatures (LTC_HMAC,LTC_HASH_HELPERS) in MSVC builds for bothcxbxandcxbxr-emu. [1] [2]Cryptographic Source Integration:
libtomcryptstructure: replaced, removed, or renamed several source files to align with upstream changes (e.g., replacedpk_get_oid.cwithpk_get.c, removed Katja and some DER sequence files, updated RSA/ECC files). [1] [2] [3] [4]Code Modernization:
EmuRsa.cppto use newlibtommathAPIs: replaced deprecatedinit_LTM()withcrypt_mp_init("ltm"), and switched frommp_import/mp_exportto the newmp_unpack/mp_packfunctions for big integer handling. [1] [2]