validatekey.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. /// Non-sensitive member context APIs
  17. /*! \file */
  18. #ifndef EPID_MEMBER_SRC_VALIDATEKEY_H_
  19. #define EPID_MEMBER_SRC_VALIDATEKEY_H_
  20. #include "epid/common/errors.h"
  21. #include "epid/common/stdtypes.h"
  22. /// \cond
  23. typedef struct MemberCtx MemberCtx;
  24. typedef struct G1ElemStr G1ElemStr;
  25. typedef struct G2ElemStr G2ElemStr;
  26. typedef struct FpElemStr FpElemStr;
  27. /// \endcond
  28. /// Checks if provided parameters result in a valid key
  29. /*!
  30. \param[in,out] ctx
  31. The member context.
  32. \param[in] A_str
  33. The A value of the member private key.
  34. \param[in] x_str
  35. The x value of the member private key.
  36. \param[in] h1_str
  37. The h1 value of the group public key.
  38. \param[in] w_str
  39. The w value of the group public key.
  40. \retval true
  41. if the input values would result in a valid member private key
  42. \retval false
  43. if the input values would result in an invalid member private key
  44. \see MemberCreate
  45. */
  46. bool EpidMemberIsKeyValid(MemberCtx* ctx, G1ElemStr const* A_str,
  47. FpElemStr const* x_str, G1ElemStr const* h1_str,
  48. G2ElemStr const* w_str);
  49. #endif // EPID_MEMBER_SRC_VALIDATEKEY_H_