Converts a positive Big Number into octet String.
IppStatus ippsGetOctString_BN(const Ipp8u* pOctStr, int strLen, const IppsBigNumState* pBN);
pOctStr |
Pointer to the input octet string. |
strLen |
Octet string length in bytes. |
pBN |
Pointer to the context of the input Big Number. |
The function is declared in the ippcp.h file. This function converts a positive Big Number into the octet string.
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. |
ippStsContextMatchErr |
Indicates an error condition if the context parameter does not match the operation. |
ippStsLengthErr |
Indicates an error condition if specified pOctStr is insufficient in length. |
ippStsRangeErr |
Indicates an error condition if Big Number is negative. |
void Type_BN(const char* pMsg, const IppsBigNumState* pBN){
// size of Big Number
int size;
ippsGetSize_BN(pBN, &size);
// extract Big Number value and convert it to the string presentation
Ipp8u* bnValue = new Ipp8u [size*4];
ippsGetOctString_BN(bnValue, size*4, pBN);
// type header
if(pMsg)
cout <<pMsg;
// type value
for(int n=0; n<size*4; n++)
cout<<hex <<(int)bnValue[n];
cout <<endl;
delete [] bnValue;
}
Copyright © 2000 - 2011, Intel Corporation. All rights reserved.