Closed YWRtaW4 closed 10 months ago
Hi @YWRtaW4, Thanks for your interest in IPP Crypto! We need some time to investigate your findings, we'll write you back when there are any updates.
Elena
Hi @YWRtaW4,
Thanks for reporting an issue. Unfortunately, we couldn't reproduce your scenario, but we took a look at your example and noticed incorrect memory allocation in some places. Some IPP Crypto structures require the calling special "GetSize" method before memory allocation. You call such method, for example, for IppsGFpState type, but don't call for IppsBigNumState and IppsGFpElement types. Could you please try to use ippsBigNumGetSize() and ippsGFpElementGetSize() methods and allocate memory with the correct sizes?
Hi @opervush,
Thank you for your response. I appreciate your advice, which has successfully resolved my issue.
Hello,
I am relatively new to the ipp-crypto library and I'm currently trying to work on a demo related to SM2. My goal is to implement SM2 signature generation, but I am encountering difficulties during the initialization and point operations.
To provide some context, I have stored the x and y coordinates of the SM2 generator point in
pXbuf
andpYbuf
respectively. Then, I assigned these values topX
andpY
byippsGFpElementInit
. Next, I used theippsGFpECPointInit
function to set the value of pointpP
. However, when I try to extract and print the coordinates ofpP
usingippsGFpECGetPointOctString
, the values I get are not as expected. Also, I test byippsECCPCheckPoint
and thestatus
indicates thatpP
is not a valid ECC point.For more infomation, my demo code are as follows, some initialization operations are executed and then point pP is set by pX and pY, then pP is extracted to oct strings and printed:
By executing the codes, the output is
while I expected it to be
I would greatly appreciate it if the developers could review my code and help me identify any issues or mistakes. Additionally, if there are any suggestions or alternative approaches to achieve SM2 signature generation using the ipp-crypto library, I would be grateful for the guidance.
Thank you for your assistance!