-
Notifications
You must be signed in to change notification settings - Fork 86
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
something wrong with Functions based on SM2 #21
Comments
It seems the only situation where ippsGFpECESGetSize_SM2() returns the ippStsNotSupportedModeErr status is incorrect initialization of the Elliptic Curve (or underlying finite field). If you send a short example illustrating this problem, it helps to understand the source of issue and fix it. |
In your example I did not find the following: |
You sample is not complete. Undefined ipp_extget_BN function. |
when EC created the underlying field is not copied into EC state but instead saved the pointer to GF state only. I recommend to take a look at SM2 encryption/decryption protocol |
i get it,thank u very much! |
i want to use SM2 API.
first, i create IppsGFpState with ippsGFpMethod_p256sm2 & bignum P, and then i know the A, B, X, Y, N of the ECC
second, i create IppsGFpECState and figure out the publicKey & privatekey
third, i want to create IppsECES_StateSM2. At the same time, something wrong, i always get the ippStsNotSupportedModeErr err when calling the
IppStatus ippsGFpECESGetSize_SM2(const IppsGFpECState* pEC, int* pSize);
this is my ECC parameter:
Ipp8u P_str[] = "\xFF\xFF\xFF\xFE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF";
Ipp8u A_str[] = "\xFF\xFF\xFF\xFE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x00\x00\x00\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC";
Ipp8u B_str[] = "\x28\xE9\xFA\x9E\x9D\x9F\x5E\x34\x4D\x5A\x9E\x4B\xCF\x65\x09\xA7\xF3\x97\x89\xF5\x15\xAB\x8F\x92\xDD\xBC\xBD\x41\x4D\x94\x0E\x93";
Ipp8u X_str[] = "\x32\xC4\xAE\x2C\x1F\x19\x81\x19\x5F\x99\x04\x46\x6A\x39\xC9\x94\x8F\xE3\x0B\xBF\xF2\x66\x0B\xE1\x71\x5A\x45\x89\x33\x4C\x74\xC7";
Ipp8u Y_str[] = "\xBC\x37\x36\xA2\xF4\xF6\x77\x9C\x59\xBD\xCE\xE3\x6B\x69\x21\x53\xD0\xA9\x87\x7C\xC6\x2A\x47\x40\x02\xDF\x32\xE5\x21\x39\xF0\xA0";
Ipp8u N_str[] = "\xFF\xFF\xFF\xFE\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x72\x03\xDF\x6B\x21\xC6\x05\x2B\x53\xBB\xF4\x09\x39\xD5\x41\x23";
help me pls!
The text was updated successfully, but these errors were encountered: