Defines the sign and value of the context.
IppStatus ippsSet_BN(IppsBigNumSGN sgn, int length, const Ipp32u *data, IppsBigNumState *x);
sgn |
Sign of IppsBigNumState * x. |
length |
Array length of the input data. |
data |
Data array. |
x |
On output, the context IppsBigNumState updated with the input data. |
This function is declared in the ippcp.h file. The function defines the sign and value for IppsBigNumState *x with the specified inputs IppsBigNumSGN sgn and const Ipp32u *data.
ippStsNoErr |
Indicates no error. Any other value indicates an error or warning. |
ippStsNullPtrErr |
Indicates an error condition if any of the specified pointers is NULL. |
ippStsLengthErr |
Indicates an error condition if length is less than or equal to 0. |
ippStsOutOfRangeErr |
Indicates an error condition if length is more than the size of IppsBigNumState *x. |
ippStsBadArgErr |
Indicates an error condition if the big number is set to zero with the negative sign. |
IppsBigNumState* New_BN(int size, const Ipp32u* pData=0){
// get the size of the Big Number context
int ctxSize;
ippsBigNumGetSize(size, &ctxSize);
// allocate the Big Number context
IppsBigNumState* pBN = (IppsBigNumState*) (new Ipp8u [ctxSize] );
// and initialize one
ippsBigNumInit(size, pBN);
// if any data was supplied, then set up the Big Number value
if(pData)
ippsSet_BN(IppsBigNumPOS, size, pData, pBN);
// return pointer to the Big Number context for future use
return pBN;
}
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.