owncpepid.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. // Internal Cryptographic Primitives (Intel(R) EPID v2.0)
  19. //
  20. //
  21. */
  22. #ifndef __OWNCP_EPID_H__
  23. #define __OWNCP_EPID_H__
  24. #if defined (USE_P8_HEADER)
  25. #include "ippcpepid_p8.h"
  26. #elif defined (USE_Y8_HEADER)
  27. #include "ippcpepid_y8.h"
  28. #endif
  29. #ifndef __OWNDEFS_H__
  30. #include "owndefs.h"
  31. #endif
  32. #ifndef __OWNCP_H__
  33. #include "owncp.h"
  34. #endif
  35. #ifndef __IPPCP_EPID_H__
  36. #include "ippcpepid.h"
  37. #endif
  38. #define LOG2_CACHE_LINE_SIZE (6) /* LOG2(CACHE_LINE_SIZE) */
  39. /* convert bitsize nbits into the number of BNU_CHUNK_T */
  40. #define BITS_CHUNKSIZE(nbits) (((nbits)+BITSIZE(BNU_CHUNK_T)-1)/BITSIZE(BNU_CHUNK_T))
  41. /*
  42. // dst = (src1 & mask) | (src2 & ~mask)
  43. */
  44. #define MASKED_COPY(dst, mask, src1, src2, len) { \
  45. /*cpSize*/ int i; \
  46. for(i=0; i<(len); i++) (dst)[i] = ((mask) & (src1)[i]) | (~(mask) & (src2)[i]); \
  47. }
  48. #endif /* __OWNCP_EPID_H__ */