precomp.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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. /// Member pre-computation API
  17. /*! \file */
  18. #ifndef EPID_MEMBER_SRC_PRECOMP_H_
  19. #define EPID_MEMBER_SRC_PRECOMP_H_
  20. #include "epid/common/errors.h"
  21. /// \cond
  22. typedef struct Epid2Params_ Epid2Params_;
  23. typedef struct GroupPubKey GroupPubKey;
  24. typedef struct G1ElemStr G1ElemStr;
  25. typedef struct MemberPrecomp MemberPrecomp;
  26. /// \endcond
  27. /// Precomputes pairing values for member
  28. /*!
  29. The the result of the expensive pairing operations can be
  30. pre-computed. The pre-computation result can be saved for future
  31. sign operations using the same group and private key.
  32. \param[in] epid2_params
  33. The field and group parameters.
  34. \param[in] pub_key
  35. The public key of the group.
  36. \param[in] A_str
  37. The A value of the member private key.
  38. \param[out] precomp
  39. The member pre-computed data.
  40. \returns ::EpidStatus
  41. \see CreateEpid2Params
  42. */
  43. EpidStatus PrecomputeMemberPairing(Epid2Params_ const* epid2_params,
  44. GroupPubKey const* pub_key,
  45. G1ElemStr const* A_str,
  46. MemberPrecomp* precomp);
  47. #endif // EPID_MEMBER_SRC_PRECOMP_H_