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

Problem with IPP extension fields function

kleboeuf
Beginner
479 Views
Hi everyone,

I've recently started working with the Intel IPP library for a research project at my school involving finite field arithmetic. I was having some problems setting up extension fields, and was wondering if anyone could either tell me what I'm doing wrong, or confirm that what I'm trying to do is not possible.

I'm trying to work in medium-sized binary extension fields that are of interest in the area of cryptography; say GF(2^233). I'm trying to set up an IppsGFPXState, but I cannot get past the GFPXGetSize step, which is used to determine how much memory needs to be allocated for the IppsGFPXState context structure.

I can get GFPXGetSize to work for low-degree extensions; specifically, as long as m in GF(2^m) stays below 10 the function does not return an error. I have looked through the documentation, and was unable to find any mention of a limitation on the degree of the extension.

Shown below is modified code from Andrzej and Jakub Chrzeszczyk's 'Intel IPP Cryptography Guide' to demonstrate the problem that I'm having (also attached; see a.cpp):


[cpp]#include "ippcore.h"
#include "ippcp.h"
#include 

int main(){
using namespace std;
srand(time(0));

Ipp32u degree=9;

Ipp32u bitS=32;
Ipp32u size;
IppStatus w;
const Ipp32u P[] = {0x00000002};
ippsGFPGetSize(bitS,&size);
IppsGFPState* GFP= (IppsGFPState*)(new Ipp8u [size]);
w=ippsGFPInit(GFP,P,bitS);
const Ipp32u *Prime=0;
Ipp32u elemLen;
w=ippsGFPGet(GFP,″,&elemLen);
Ipp32u xsize;

w=ippsGFPXGetSize(GFP,degree,&xsize);
cout <<"XGetSize: "< 
I am compiling the above code on an Intel Q9650 @ 3GHz Linux machine running CentOS 4.8, 64-bit using the following command:
icpc -ipp=crypto a.cpp

I am using version 12.0.2 of the Intel compiler, and version 7.0.2 of the cryptography IPP.

If I change the line "Ipp32u degree=9" to degree=10 or above, the program will still compile fine, but I get the following error when I run the executable: "XGetSize: ippStsSizeErr: Wrong value of data size"

If anyone can shed some light on this issue it would be greatly appreciated!

Karl Leboeuf
#include "ippcore.h"
#include "ippcp.h"
#include

int main(){
using namespace std;
srand(time(0));

Ipp32u bitS=32;
Ipp32u size;
IppStatus w;
const Ipp32u P[] = {0x00000002};
ippsGFPGetSize(bitS,&size);
IppsGFPState* GFP= (IppsGFPState*)(new Ipp8u [size]);
w=ippsGFPInit(GFP,P,bitS);
const Ipp32u *Prime=0;
Ipp32u elemLen;
w=ippsGFPGet(GFP,″,&elemLen);
///////////CANNOT SET DEGREE ABOVE 10////////
Ipp32u degree=9;
/////////////////////////////////////////////
Ipp32u xsize;

w=ippsGFPXGetSize(GFP,degree,&xsize);
cout <<"XGetSize: "<
delete [] (Ipp8u*)GFP;
return 0;
}
0 Kudos
1 Solution
Gennady_F_Intel
Moderator
479 Views
Hi Karl,
Yes, that's happens becasue of there is the restriction in the current implementation. we will add some note about this restriction in to the future version.
--Gennady

View solution in original post

0 Kudos
3 Replies
Gennady_F_Intel
Moderator
480 Views
Hi Karl,
Yes, that's happens becasue of there is the restriction in the current implementation. we will add some note about this restriction in to the future version.
--Gennady
0 Kudos
kleboeuf
Beginner
479 Views
Hi Gennady,

Thank you very much for your reply. I am disappointed that this is the case! Are you aware of any other way I can access binary field multiplication functions for NIST fields? I know that they are in there somewhere, because all of the IPP elliptic curve cryptography functions based on GF(2^m) make use of them (ones with prefix ECCB*).

Either way, a note about the restriction would have been appreciated!

Thank you for your time,

Karl Leboeuf
0 Kudos
Andrzej_Chrzeszczyk
New Contributor I
479 Views
Hello Karl
The IPP Manual, Vol4 (p.522 in my version) states that
in GF(p) (and consequently in GF(p^d))

p is ***ODD*** PRIME.

The case p=2 is considered in different chapters.

You can perform calculations concerning elliptic curves
(including NIST curves)
over GF(2^m) with large m using ECCB functions.

Elements of GF(2^m) are considered there as BigNums
(and not as elements of extension field).

Andrzej Chrzeszczyk
0 Kudos
Reply