ippcpepid.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. /*############################################################################
  2. # Copyright 2016 Intel Corporation
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. ############################################################################*/
  16. /*
  17. // Intel(R) Integrated Performance Primitives
  18. // ippCP Intel(R) EPID functionality
  19. //
  20. //
  21. */
  22. #if !defined( __IPPCPEPID_H__ ) || defined( _OWN_BLDPCS )
  23. #define __IPPCPEPID_H__
  24. #if defined (_WIN32_WCE) && defined (_M_IX86) && defined (__stdcall)
  25. #define _IPP_STDCALL_CDECL
  26. #undef __stdcall
  27. #endif
  28. #ifndef __IPPDEFS_H__
  29. #include "ippdefs.h"
  30. #endif
  31. #ifndef __IPPCPDEFS_H__
  32. #include "ippcpdefs.h"
  33. #endif
  34. #ifdef __cplusplus
  35. extern "C" {
  36. #endif
  37. #if !defined( _IPP_NO_DEFAULT_LIB )
  38. #if defined( _IPP_PARALLEL_DYNAMIC ) || defined( _IPP_SEQUENTIAL_DYNAMIC )
  39. #pragma comment( lib, "ippcpepid" )
  40. #pragma comment( lib, "ippcp" )
  41. #pragma comment( lib, "ippcore" )
  42. #elif defined( _IPP_PARALLEL_STATIC ) || defined( _IPP_SEQUENTIAL_STATIC )
  43. #pragma comment( lib, "ippcpepidmt" )
  44. #pragma comment( lib, "ippcpmt" )
  45. #pragma comment( lib, "ippcoremt" )
  46. #endif
  47. #endif
  48. /* /////////////////////////////////////////////////////////////////////////////
  49. // Name: ippcpepidGetLibVersion
  50. // Purpose: getting of the library version
  51. // Returns: the structure of information about version of ippCP EPID library
  52. // Parameters:
  53. //
  54. // Notes: not necessary to release the returned structure
  55. */
  56. IPPAPI( const IppLibraryVersion*, ippcpepidGetLibVersion, (void) )
  57. /*
  58. // Finite Field Low Level Math
  59. */
  60. #define IPP_MIN_GF_BITSIZE (2) /* min bitsize for GF element */
  61. #define IPP_MAX_GF_BITSIZE (4096) /* max bitsize for GF element */
  62. //#define IPP_IS_EQ IS_ZERO //(0)
  63. //#define IPP_IS_NE (1)
  64. //#define IPP_IS_GT GREATER_THAN_ZERO //(2)
  65. //#define IPP_IS_LT LESS_THAN_ZERO // (3)
  66. //#define IPP_IS_NA (4)
  67. #if !defined( _OWN_BLDPCS )
  68. typedef struct _cpGFp IppsGFpState;
  69. typedef struct _cpElementGFp IppsGFpElement;
  70. typedef struct {
  71. const IppsGFpState* pBasicGF;
  72. const IppsGFpState* pGroundGF;
  73. int basicGFdegree;
  74. int groundGFdegree;
  75. int elementLen;
  76. } IppsGFpInfo;
  77. #endif
  78. #if !defined( _OWN_BLDPCS )
  79. typedef enum {
  80. ippMD5 = 0x00,
  81. ippSHA1 = 0x01,
  82. ippSHA256 = 0x02, ippSHA224 = 0x12,
  83. ippSHA512 = 0x03, ippSHA384 = 0x13
  84. } IppHashID;
  85. #endif /* _OWN_BLDPCS */
  86. IPPAPI(IppStatus, ippsGFpGetSize, (int bitSize, int* pStateSizeInBytes))
  87. IPPAPI(IppStatus, ippsGFpInit, (const Ipp32u* pPime, int bitSize, IppsGFpState* pGFp))
  88. IPPAPI(IppStatus, ippsGFpxGetSize,(const IppsGFpState* pGroundGF, int degree, int* pStateSizeInBytes))
  89. IPPAPI(IppStatus, ippsGFpxInit, (const IppsGFpState* pGroundGF, const Ipp32u* pIrrPolynomial, int degree, IppsGFpState* pGFpx))
  90. IPPAPI(IppStatus, ippsGFpxInitBinomial,(const IppsGFpState* pGroundGF, const IppsGFpElement* pGroundElm, int degree, IppsGFpState* pGFpx))
  91. IPPAPI(IppStatus, ippsGFpGetInfo,(const IppsGFpState* pGFp, IppsGFpInfo* pInfo))
  92. IPPAPI(IppStatus, ippsGFpGetModulus,(const IppsGFpState* pGFp, Ipp32u* pModulus))
  93. IPPAPI(IppStatus, ippsGFpScratchBufferSize,(int nExponents, int ExpBitSize, const IppsGFpState* pGF, int* pBufferSize))
  94. //IPPAPI(IppStatus, ippsBasicGFpRef,(const IppsGFpState* pGFp, IppsGFpState** ppBasicGF))
  95. //IPPAPI(IppStatus, ippsGroundGFpRef,(const IppsGFpState* pGFp, IppsGFpState** ppGroundGF))
  96. //IPPAPI(IppStatus, ippsGFpGetDegree,(const IppsGFpState* pGFp, int* pDegree))
  97. //IPPAPI(IppStatus, ippsGFpGetElementLen,(const IppsGFpState* pGFp, int* pElmLen))
  98. //IPPAPI(IppStatus, ippsGFpCmp, (const IppsGFpState* pGFp1, const IppsGFpState* pGFp2, IppGFpResult* pCmpResult))
  99. IPPAPI(IppStatus, ippsGFpElementGetSize,(const IppsGFpState* pGFp, int* pElementSize))
  100. IPPAPI(IppStatus, ippsGFpElementInit, (const Ipp32u* pA, int lenA, IppsGFpElement* pR, IppsGFpState* pGFp))
  101. IPPAPI(IppStatus, ippsGFpSetElement, (const Ipp32u* pA, int nsA, IppsGFpElement* pR, IppsGFpState* pGFp))
  102. IPPAPI(IppStatus, ippsGFpSetElementOctString,(const Ipp8u* pStr, int strSize, IppsGFpElement* pR, IppsGFpState* pGFp))
  103. IPPAPI(IppStatus, ippsGFpSetElementRandom,(IppBitSupplier rndFunc, void* pRndParam, IppsGFpElement* pR, IppsGFpState* pGFp))
  104. IPPAPI(IppStatus, ippsGFpSetElementHash,(const Ipp8u* pMsg, int msgLen, IppHashID hashID, IppsGFpElement* pElm, IppsGFpState* pGF))
  105. IPPAPI(IppStatus, ippsGFpCpyElement,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp))
  106. IPPAPI(IppStatus, ippsGFpGetElement,(const IppsGFpElement* pA, Ipp32u* pDataA, int nsA, IppsGFpState* pGFp))
  107. IPPAPI(IppStatus, ippsGFpGetElementOctString,(const IppsGFpElement* pA, Ipp8u* pStr, int strSize, IppsGFpState* pGFp))
  108. IPPAPI(IppStatus, ippsGFpCmpElement,(const IppsGFpElement* pA, const IppsGFpElement* pB, int* pResult, const IppsGFpState* pGFp))
  109. IPPAPI(IppStatus, ippsGFpIsZeroElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp))
  110. IPPAPI(IppStatus, ippsGFpIsUnityElement,(const IppsGFpElement* pA, int* pResult, const IppsGFpState* pGFp))
  111. //IPPAPI(IppStatus, ippsGFpSetPolyTerm, (const Ipp32u* pTerm, int nsT, int termDegree, IppsGFpElement* pElm, IppsGFpState* pGF))
  112. //IPPAPI(IppStatus, ippsGFpGetPolyTerm, (const IppsGFpElement* pElm, int termDegree, Ipp32u* pTerm, int nsT, IppsGFpState* pGF))
  113. IPPAPI(IppStatus, ippsGFpConj,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp))
  114. IPPAPI(IppStatus, ippsGFpNeg, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp))
  115. IPPAPI(IppStatus, ippsGFpInv, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp))
  116. IPPAPI(IppStatus, ippsGFpSqrt,(const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp))
  117. IPPAPI(IppStatus, ippsGFpAdd, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp))
  118. IPPAPI(IppStatus, ippsGFpSub, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp))
  119. IPPAPI(IppStatus, ippsGFpMul, (const IppsGFpElement* pA, const IppsGFpElement* pB, IppsGFpElement* pR, IppsGFpState* pGFp))
  120. IPPAPI(IppStatus, ippsGFpSqr, (const IppsGFpElement* pA, IppsGFpElement* pR, IppsGFpState* pGFp))
  121. IPPAPI(IppStatus, ippsGFpExp, (const IppsGFpElement* pA, const IppsBigNumState* pE, IppsGFpElement* pR, IppsGFpState* pGFp, Ipp8u* pScratchBuffer))
  122. IPPAPI(IppStatus, ippsGFpMultiExp,(const IppsGFpElement* const ppElmA[], const IppsBigNumState* const ppE[], int nItems, IppsGFpElement* pElmR, IppsGFpState* pGF, Ipp8u* pScratchBuffer))
  123. IPPAPI(IppStatus, ippsGFpAdd_GFpE,(const IppsGFpElement* pA, const IppsGFpElement* pGroundB, IppsGFpElement* pR, IppsGFpState* pGFp))
  124. IPPAPI(IppStatus, ippsGFpSub_GFpE,(const IppsGFpElement* pA, const IppsGFpElement* pGroundB, IppsGFpElement* pR, IppsGFpState* pGFp))
  125. IPPAPI(IppStatus, ippsGFpMul_GFpE,(const IppsGFpElement* pA, const IppsGFpElement* pGroundB, IppsGFpElement* pR, IppsGFpState* pGFp))
  126. #if !defined( _OWN_BLDPCS )
  127. typedef struct _cpGFpEC IppsGFpECState;
  128. typedef struct _cpGFpECPoint IppsGFpECPoint;
  129. #endif
  130. IPPAPI(IppStatus, ippsGFpECGetSize,(const IppsGFpState* pGF, int* pCtxSizeInBytes))
  131. IPPAPI(IppStatus, ippsGFpECInit, (const IppsGFpElement* pA, const IppsGFpElement* pB,
  132. const IppsGFpElement* pX, const IppsGFpElement* pY,
  133. const Ipp32u* pOrder, int orderLen,
  134. const Ipp32u* pCofactor, int cofactorLen,
  135. IppsGFpState* pGF, IppsGFpECState* pEC))
  136. IPPAPI(IppStatus, ippsGFpECScratchBufferSize,(int nScalars, const IppsGFpECState* pEC, int* pBufferSize))
  137. IPPAPI(IppStatus, ippsGFpECSet,(const IppsGFpElement* pA, const IppsGFpElement* pB,
  138. const IppsGFpElement* pX, const IppsGFpElement* pY,
  139. const Ipp32u* pOrder, int orderLen,
  140. const Ipp32u* pCofactor, int cofactorLen,
  141. IppsGFpECState* pEC))
  142. IPPAPI(IppStatus, ippsGFpECGet,(const IppsGFpECState* pEC,
  143. const IppsGFpState** ppGF,
  144. IppsGFpElement* pA, IppsGFpElement* pB,
  145. IppsGFpElement* pX, IppsGFpElement* pY,
  146. const Ipp32u** ppOrder, int* pOrderLen,
  147. const Ipp32u** ppCofactor, int* pCoFactorLen))
  148. IPPAPI(IppStatus, ippsGFpECVerify,(IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer))
  149. IPPAPI(IppStatus, ippsGFpECPointGetSize,(const IppsGFpECState* pEC, int* pSizeInBytes))
  150. IPPAPI(IppStatus, ippsGFpECPointInit, (const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC))
  151. IPPAPI(IppStatus, ippsGFpECSetPointAtInfinity,(IppsGFpECPoint* pPoint, IppsGFpECState* pEC))
  152. IPPAPI(IppStatus, ippsGFpECSetPoint,(const IppsGFpElement* pX, const IppsGFpElement* pY, IppsGFpECPoint* pPoint, IppsGFpECState* pEC))
  153. IPPAPI(IppStatus, ippsGFpECSetPointRandom,(IppBitSupplier rndFunc, void* pRndParam, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, Ipp8u* pScratchBuffer))
  154. IPPAPI(IppStatus, ippsGFpECMakePoint,(const IppsGFpElement* pX, IppsGFpECPoint* pPoint, IppsGFpECState* pEC))
  155. IPPAPI(IppStatus, ippsGFpECSetPointHash,(Ipp32u hdr, const Ipp8u* pMsg, int msgLen, IppHashID hashID, IppsGFpECPoint* pPoint, IppsGFpECState* pEC, Ipp8u* pScratchBuffer))
  156. IPPAPI(IppStatus, ippsGFpECCpyPoint,(const IppsGFpECPoint* pA, IppsGFpECPoint* pR, IppsGFpECState* pEC))
  157. IPPAPI(IppStatus, ippsGFpECCmpPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppECResult* pResult, IppsGFpECState* pEC))
  158. IPPAPI(IppStatus, ippsGFpECTstPoint,(const IppsGFpECPoint* pP, IppECResult* pResult, IppsGFpECState* pEC, Ipp8u* pScratchBuffer))
  159. IPPAPI(IppStatus, ippsGFpECGetPoint,(const IppsGFpECPoint* pPoint, IppsGFpElement* pX, IppsGFpElement* pY, IppsGFpECState* pEC))
  160. IPPAPI(IppStatus, ippsGFpECNegPoint,(const IppsGFpECPoint* pP, IppsGFpECPoint* pR, IppsGFpECState* pEC))
  161. IPPAPI(IppStatus, ippsGFpECAddPoint,(const IppsGFpECPoint* pP, const IppsGFpECPoint* pQ, IppsGFpECPoint* pR, IppsGFpECState* pEC))
  162. IPPAPI(IppStatus, ippsGFpECMulPoint,(const IppsGFpECPoint* pP, const IppsBigNumState* pN, IppsGFpECPoint* pR, IppsGFpECState* pEC, Ipp8u* pScratchBuffer))
  163. #ifdef __cplusplus
  164. }
  165. #endif
  166. #if defined (_IPP_STDCALL_CDECL)
  167. #undef _IPP_STDCALL_CDECL
  168. #define __stdcall __cdecl
  169. #endif
  170. #endif /* __IPPCPEPID_H__ */