Decouple gost_omac_acpkm from gost_grasshopper #519
Decouple gost_omac_acpkm from gost_grasshopper #519chipitsine merged 1 commit intogost-engine:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR decouples the CMAC-ACPKM implementation and Grasshopper core implementation from gost-core by moving CMAC-ACPKM into a standalone module and splitting Grasshopper into a separate static library, supporting the broader OpenSSL 4.0 migration work tracked in #496.
Changes:
- Extracted CMAC-ACPKM logic into new
gost_cmac_acpkm.[ch]and updated OMAC-ACPKM to use it. - Refactored Grasshopper build inputs and created a dedicated
gostgrasshopperstatic library. - Updated build system to link
gost_coreagainst the newgostcmacacpkmandgostgrasshopperlibraries.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
gost_omac_acpkm.c |
Switched to using the extracted CMAC-ACPKM module header/API. |
gost_grasshopper.h |
Reduced header coupling by removing an internal cipher include. |
gost_cmac_acpkm.h |
Introduced the new CMAC-ACPKM module public header/API. |
gost_cmac_acpkm.c |
Added extracted CMAC-ACPKM implementation (now shared). |
CMakeLists.txt |
Added gostcmacacpkm/gostgrasshopper targets and linked them into gost_core. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
gost_cmac_acpkm.c
Outdated
| @@ -0,0 +1,295 @@ | |||
| #include "string.h" | |||
There was a problem hiding this comment.
This file includes the standard header as #include "string.h", while the rest of the codebase consistently uses angle brackets for standard headers. Using <string.h> avoids accidental inclusion of a local string.h and matches existing conventions.
| #include "string.h" | |
| #include <string.h> |
There was a problem hiding this comment.
Fixed. I chose not to put this sources in separate file.
After this commit: * there is no direct access to `cipher_gost_grasshopper_ctracpkm` or `cipher_gost_magma_ctracpkm` * `gost_omac_acpkm.c` no longer depends on the `gost_grasshopper*` sources * the `CMAC_ACPKM_CTX_*` function family works with both the ENGINE and the PROVIDER implementations of the CTR-ACPKM ciphers
84635fa to
0721ccd
Compare
|
@chipitsine, I narrowed the scope of this PR. The changes are not strictly necessary, but they make it easier to track subsequent changes. |
This PR extracts the CMAC-ACPKM and grasshopper modules from the gost-core since they do not depend on it. This is part of addressing #496.