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 #ifndef EPID_VERIFIER_SRC_CONTEXT_H_
17 #define EPID_VERIFIER_SRC_CONTEXT_H_
18 /*!
19  * \file
20  * \brief Verifier context interface.
21  */
22 #include "epid/common/math/ecgroup.h"
23 #include "epid/common/math/finitefield.h"
24 #include "epid/common/src/commitment.h"
25 #include "epid/common/src/epid2params.h"
26 #include "epid/common/src/grouppubkey.h"
27 
28 /// Verifier context definition
29 struct VerifierCtx {
30   GroupPubKey_* pub_key;    ///< group public key
31   FfElement* e12;           ///< an element in GT
32   FfElement* e22;           ///< an element in GT
33   FfElement* e2w;           ///< an element in GT
34   FfElement* eg12;          ///< an element in GT
35   PrivRl const* priv_rl;    ///< Private key based revocation list - not owned
36   SigRl const* sig_rl;      ///< Signature based revocation list - not owned
37   GroupRl const* group_rl;  ///< Group revocation list - not owned
38   VerifierRl* verifier_rl;  ///< Verifier revocation list
39   bool was_verifier_rl_updated;  ///< Indicates if blacklist was updated
40   Epid2Params_* epid2_params;    ///< Intel(R) EPID 2.0 params
41   CommitValues commit_values;  ///< Values that are hashed to create commitment
42   HashAlg hash_alg;            ///< Hash algorithm to use
43   EcPoint* basename_hash;      ///< EcHash of the basename (NULL = random base)
44   uint8_t* basename;           ///< Basename to use
45   size_t basename_len;         ///< Number of bytes in basename
46 };
47 #endif  // EPID_VERIFIER_SRC_CONTEXT_H_
48