1 /*############################################################################
2   # Copyright 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 /// Host join helper APIs
17 /*! \file */
18 #ifndef EPID_MEMBER_SRC_JOIN_COMMITMENT_H_
19 #define EPID_MEMBER_SRC_JOIN_COMMITMENT_H_
20 
21 #include "epid/common/errors.h"
22 #include "epid/common/types.h"  // HashAlg
23 
24 /// \cond
25 typedef struct FiniteField FiniteField;
26 typedef struct G1ElemStr G1ElemStr;
27 typedef struct FpElemStr FpElemStr;
28 typedef struct OctStr256 OctStr256;
29 typedef struct OctStr256 IssuerNonce;
30 /// \endcond
31 
32 /// Calculates commitment hash of join commit
33 /*!
34 
35   \param[in] Fp
36   The finite field.
37 
38   \param[in] hash_alg
39   The hash algorithm.
40 
41   \param[in] pub_key
42   The public key of the group being joined.
43 
44   \param[in] F_str
45   The F value of the join commit.
46 
47   \param[in] R_str
48   The R value of the join commit.
49 
50   \param[in] NI
51   The nonce chosen by issuer as part of join protocol.
52 
53   \param[out] c_str
54   The resulting commitment hash.
55 
56   \returns ::EpidStatus
57 
58  */
59 EpidStatus HashJoinCommitment(FiniteField* Fp, HashAlg hash_alg,
60                               GroupPubKey const* pub_key,
61                               G1ElemStr const* F_str, G1ElemStr const* R_str,
62                               IssuerNonce const* NI, FpElemStr* c_str);
63 
64 #endif  // EPID_MEMBER_SRC_JOIN_COMMITMENT_H_
65