join_commitment.h 1.9 KB

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