12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef _SGX_ECC256_COMMON_H_
- #define _SGX_ECC256_COMMON_H_
- #include "sgx_trts.h"
- #include "sgx_tcrypto.h"
- #include "sgx_tcrypto_internal.h"
- #include "ippcp.h"
- #include "util.h"
- #include "stdlib.h"
- #include "string.h"
- #ifndef ERROR_BREAK
- #define ERROR_BREAK(x) if(x != ippStsNoErr){break;}
- #endif
- #ifndef SAFE_FREE
- #define SAFE_FREE(ptr) {if (NULL != (ptr)) {free(ptr); (ptr)=NULL;}}
- #endif
- IppStatus sgx_ipp_newBN(const Ipp32u *p_data, int size_in_bytes, IppsBigNumState **p_new_BN);
- void sgx_ipp_secure_free_BN(IppsBigNumState *pBN, int size_in_bytes);
- IppStatus __STDCALL sgx_ipp_DRNGen(Ipp32u* pRandBNU, int nBits, void* pCtx);
- static inline IppStatus check_copy_size(size_t target_size, size_t source_size)
- {
- if(target_size < source_size)
- return ippStsSizeErr;
- return ippStsNoErr;
- }
- #endif
|