Skip to content

Implement EC_GROUP and EC_POINT as sub-modules of ec module (#336)#337

Merged
zhaozg merged 1 commit into
masterfrom
feat/ec
Nov 4, 2025
Merged

Implement EC_GROUP and EC_POINT as sub-modules of ec module (#336)#337
zhaozg merged 1 commit into
masterfrom
feat/ec

Conversation

@zhaozg

@zhaozg zhaozg commented Nov 4, 2025

Copy link
Copy Markdown
Owner
  • Add EC_GROUP and EC_POINT standalone modules with comprehensive tests
  • Added point operations (point_new, point_dup, point_equal, point2oct, oct2point, point2bn, bn2point, point2hex, hex2point, affine_coordinates, generate_key) to EC_GROUP methods in group.c
  • Made helper functions in group.c non-static (openssl_to_group_asn1_flag, openssl_push_group_asn1_flag, openssl_to_point_conversion_form, openssl_push_point_conversion_form)
  • Added unit test: group.lua and point.lua
  • Updated test files to use openssl.ec.group and openssl.ec.point

* Initial plan

* Add EC_GROUP and EC_POINT standalone modules with comprehensive tests

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>

* Complete EC_GROUP and EC_POINT implementation with all tests passing

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>

* Add CodeQL build artifacts to gitignore

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>

* Add point operations to EC_GROUP and fix tostring format

- Added point operations (point_new, point_dup, point_equal, point2oct, oct2point, point2bn, bn2point, point2hex, hex2point, affine_coordinates, generate_key) to EC_GROUP methods in group.c
- Fixed EC_POINT tostring to include "openssl." prefix (changed from "ec_point: %p" to "openssl.ec_point: %p")
- Added group.lua and point.lua to test/test.lua
- All 128 tests now pass (16 group tests + 23 point tests + 89 existing tests)

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>

* Refactor ec.c to reuse code from group.c and point.c

- Made helper functions in group.c non-static (openssl_to_group_asn1_flag, openssl_push_group_asn1_flag, openssl_to_point_conversion_form, openssl_push_point_conversion_form)
- Removed duplicate helper functions from ec.c that now exist in group.c
- Created ec_group_point.h header to export needed functions
- ec.c now reuses functions from group.c and point.c instead of duplicating them
- All 128 tests pass (16 group + 23 point + 89 existing)

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>

* Restructure EC modules: include group.c/point.c in ec.c as sub-modules

- group.c and point.c are now included directly in ec.c (not compiled separately)
- All functions in group.c and point.c are now static
- group and point are registered as ec sub-modules (openssl.ec.group, openssl.ec.point)
- Removed group.o and point.o from Makefile and CMakeLists.txt
- Removed standalone luaopen_group/luaopen_point registrations from openssl.c
- Deleted ec_group_point.h (no longer needed)
- Deleted ec.c.backup cleanup file
- Updated test files to use openssl.ec.group and openssl.ec.point
- All 128 tests passing

Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: zhaozg <542599+zhaozg@users.noreply.github.com>
@zhaozg
zhaozg merged commit a41139b into master Nov 4, 2025
73 of 74 checks passed
@zhaozg
zhaozg deleted the feat/ec branch November 4, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants