Home | History | Annotate | Download | only in common-testhelper
      1 /*############################################################################
      2   # Copyright 2016-2017 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 /*!
     18  * \file
     19  * \brief Intel(R) EPID 2.0 parameters C++ wrapper interface.
     20  */
     21 #ifndef EPID_COMMON_TESTHELPER_EPID_PARAMS_TESTHELPER_H_
     22 #define EPID_COMMON_TESTHELPER_EPID_PARAMS_TESTHELPER_H_
     23 
     24 #include <memory>
     25 #include "epid/common/types.h"
     26 
     27 extern "C" {
     28 #include "epid/common/math/bignum.h"
     29 #include "epid/common/math/ecgroup.h"
     30 #include "epid/common/math/finitefield.h"
     31 }
     32 
     33 #include "epid/common-testhelper/bignum_wrapper-testhelper.h"
     34 #include "epid/common-testhelper/ecgroup_wrapper-testhelper.h"
     35 #include "epid/common-testhelper/ecpoint_wrapper-testhelper.h"
     36 #include "epid/common-testhelper/ffelement_wrapper-testhelper.h"
     37 #include "epid/common-testhelper/finite_field_wrapper-testhelper.h"
     38 
     39 typedef struct Epid2Params_ Epid2Params_;
     40 
     41 class Epid20Params {
     42  public:
     43   Epid20Params();
     44 
     45   // This class instances are not meant to be copied.
     46   // Explicitly delete copy constructor and assignment operator.
     47   Epid20Params(const Epid20Params&) = delete;
     48   Epid20Params& operator=(const Epid20Params&) = delete;
     49 
     50   virtual ~Epid20Params() {}
     51 
     52   FiniteFieldObj GT;
     53   EcGroupObj G1;
     54   EcGroupObj G2;
     55   FiniteFieldObj fq;
     56   FiniteFieldObj fp;
     57 
     58  private:
     59   static const BigNumStr q_str_;
     60   static const FqElemStr beta_str_;
     61   static const Fq6ElemStr v_str_;
     62 
     63   static const BigNumStr p_str_;
     64   static const FqElemStr b_str_;
     65   static const FqElemStr h_str_;
     66   static const G1ElemStr g1_str_;
     67 
     68   static const Fq2ElemStr xi_str_;
     69   static const G2ElemStr g2_str_;
     70 
     71   FiniteFieldObj fq2;
     72   FiniteFieldObj fq6;
     73 };
     74 
     75 #endif  // EPID_COMMON_TESTHELPER_EPID_PARAMS_TESTHELPER_H_
     76