Intel® Integrated Performance Primitives
Deliberate problems developing high-performance vision, signal, security, and storage applications.
6798 Discussions

ippsGFpECPrivateKey for std521r1 elliptic curve issue: Error -6.

jlabbe
Beginner
676 Views

Hi Team, 

I'm struggling to use the method ippsGFpECPrivateKey for an elliptic curve configured following this process:

1) Create Gallois Field using:

ippsGFpInitFixed(521, ippsGFpMethod_p521r1(), gf_output);

gf_output size is 1768.

2) Create Elliptic Curve using: 
ippsGFpECInitStd521r1(gf_output_GF, ec_output)
 
Note that ec_output was first reseat with ec_size_output (4064) extracted from 
ippsGFpECGetSize(gf_output_GF, ec_size_output)
 
3) Create BigNum using:
ippsECCPGetSizeStd521r1(secret_key_size_output)
 
convert secret_key_size_output (12808) into secret_key_size_word (401)
ippsBigNumGetSize(secret_key_size_word, bn_size_output)
 
big_num now reseat with bn_size_output (3271)
 
ippsBigNumInit(secret_key_size_word, big_num)
 
4) Now onto using ippsGFpECPrivateKey 
ippsGFpECPrivateKey(secret_key(size=3271), elliptic_curve(size=4064), randfunc, randctx)
 
The error returned is -6.
 
I can see from the documentation that -6 "Indicates an error condition if the parameter pointed to by pPrivate has a memory size that is less than the order n of the elliptic curve base point G."
 
This same process does produce the correct results, for std256r1 and std384r1, would somebody understand what i'm doing wrong for std521r1? 
 
 
 
 
0 Kudos
3 Replies
Ruqiu_C_Intel
Moderator
623 Views

Hello,

Can you tell us your OS, IPP version, and CPU information, as well as a simple reproducer for this problem?

0 Kudos
jlabbe
Beginner
601 Views

Hi Ruqiu, 

 

Thanks for the response. 

I believe my problem is now gone. 

Trying to create a simple reproducer, I realised that the randfunc() was the one sending back the ippStsSizeErr error... 

 

Best Regards,

Jeremie

0 Kudos
Ruqiu_C_Intel
Moderator
549 Views

Hi Jeremie,

Thank you let us know the issue is gone.

And glad to know that you found out the real issue in your code when trying to create a reproducer.

 

Best,

Ruqiu

0 Kudos
Reply