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 #ifndef EPID_COMMON_1_1_SRC_EPID11PARAMS_H_ 17 #define EPID_COMMON_1_1_SRC_EPID11PARAMS_H_ 18 /*! 19 * \file 20 * \brief Intel(R) EPID 1.1 constant parameters interface. 21 * \addtogroup EpidCommon 22 * @{ 23 */ 24 #include "epid/common/1.1/types.h" 25 #include "epid/common/math/bignum.h" 26 #include "epid/common/math/ecgroup.h" 27 #include "epid/common/math/finitefield.h" 28 #include "epid/common/math/tatepairing.h" 29 30 /// Internal representation of Epid11Params 31 typedef struct Epid11Params_ { 32 BigNum* p; ///< a prime 33 BigNum* p_tick; ///< a prime 34 EcPoint* g1; ///< a generator (an element) of G1 35 EcPoint* g2; ///< a generator (an element) of G2 36 EcPoint* g3; ///< a generator (an element) of G3 37 38 FiniteField* Fp; ///< Finite field Fp 39 FiniteField* Fq; ///< Finite field Fq 40 FiniteField* Fp_tick; ///< Finite field Fp' 41 FiniteField* Fq_tick; ///< Finite field Fq' 42 FiniteField* Fqd; ///< Finite field Fqd, an extension of Fq 43 FiniteField* GT; ///< GT is a quadratic field extension Fqk of Fqd 44 45 EcGroup* G1; ///< Elliptic curve group over finite field Fq 46 EcGroup* G2; ///< Elliptic curve group over finite field Fqd 47 EcGroup* G3; ///< Elliptic curve group over finite field Fq' 48 49 Epid11PairingState* pairing_state; ///< Pairing state 50 } Epid11Params_; 51 52 /// Constructs the internal representation of Epid11Params 53 /*! 54 Allocates memory for the internal representation of Epid11Params. Initialize 55 the Epid11Params. Use DeleteEpid11Params() to deallocate memory. 56 57 \param[in,out] params 58 Internal Epid11Params 59 60 \returns ::EpidStatus 61 \see DeleteEpid11Params 62 */ 63 EpidStatus CreateEpid11Params(Epid11Params_** params); 64 /// Deallocates storage for internal representation of Epid11Params 65 /*! 66 Frees the memory and nulls the pointer. 67 68 \param[in,out] params 69 params to be deallocated 70 71 \see CreateEpid11Params 72 */ 73 void DeleteEpid11Params(Epid11Params_** params); 74 /*! @} */ 75 #endif // EPID_COMMON_1_1_SRC_EPID11PARAMS_H_ 76