Skip to content

Extracting prime field modulus #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
J08nY opened this issue Jan 31, 2025 · 5 comments
Open

Extracting prime field modulus #90

J08nY opened this issue Jan 31, 2025 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@J08nY
Copy link

J08nY commented Jan 31, 2025

Hi there,
as part of our efforts to implement ECTester we are working with the Intel Crypto Primitives library. The recent deprecation and removal of some ECC functions hit hard, and I am now struggling to find a way to implement some functionality we rely on.

Concretely, assuming that I have an IppsGFpECState *curve I want to be able to extract all of its parameters (think of it like I want to serialize them/export them). I found APIs to get the a, b, Gx, Gy, n, h parameters via the ippsGFpECGet and ippsGFpECGetSubgroup calls. However, I am not able to extract the prime modulus in any way that does not go around API restrictions in a really hacky way. The ippsGFpECGet call only gets me the IppsGFpState and I cannot seem to be able to extract the modulus from that.

@rcao8 rcao8 added the help wanted Extra attention is needed label Feb 24, 2025
@rcao8 rcao8 self-assigned this Mar 19, 2025
@rcao8
Copy link

rcao8 commented Mar 19, 2025

You are right, as the deprecation notes, ippsGFpECGetSubgroup is recommended replacement.

@rcao8
Copy link

rcao8 commented Apr 14, 2025

We are closing this ticket, please let us if need further supporting from community.

@rcao8 rcao8 closed this as completed Apr 14, 2025
@J08nY
Copy link
Author

J08nY commented Apr 14, 2025

Well so getting the modulus is not supported then? The replacement function does not allow one to extract the modulus, as I said.

@ElenaTyuleneva
Copy link
Contributor

@J08nY , thank you for reaching out with your question. After a brief review of the mapping between the deprecated and recommended APIs, I can confirm that you are correct.

The suggested replacement for

IppStatus ippsECCPGet(IppsBigNumState* pPrime, IppsBigNumState* pA, IppsBigNumState* pB, IppsBigNumState* pGX,IppsBigNumState* pGY,IppsBigNumState* pOrder, int* cofactor, IppsECCPState* pEC)

is

IppStatus ippsGFpECGet(IppsGFpState** const ppGFp, IppsGFpElement* pA, IppsGFpElement* pB, const IppsGFpECState* pEC)

With the new API, IppsGFpState is responsible for holding all field-related information, including details about the prime. This is the right thing, since with the new API family, we are clearly separating field and curve functionality.

The issue you've identified seems to be an API extension request for GFp functionality - e.g. to introduce an ippsGFpGet* API that can provide all necessary information for field recovery during serialization and deserialization processes (currently available ippsGFpGetInfo does not support such capability).

Could you please let us know the urgency of this request?

@rcao8 rcao8 added the enhancement New feature or request label Apr 17, 2025
@J08nY
Copy link
Author

J08nY commented Apr 17, 2025

I have no input on the priorities. We maintain a tool that interfaces to a bunch of different ECC libraries and we try to keep it up to date. When updating the Intel Crypto interface we noticed we can no longer export curve parameters, hence this issue. I think the fixed API could be rather simple as it would just extract a BN that defines the prime out of the GFp state.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants