hash_basename.h 1.7 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. /// Basename hashing helper API
  17. /*! \file */
  18. #ifndef EPID_MEMBER_SRC_HASH_BASENAME_H_
  19. #define EPID_MEMBER_SRC_HASH_BASENAME_H_
  20. #include <stddef.h>
  21. #include <stdint.h>
  22. #include "epid/common/errors.h"
  23. #include "epid/common/types.h" // HashAlg
  24. /// \cond
  25. typedef struct EcGroup EcGroup;
  26. typedef struct G1ElemStr G1ElemStr;
  27. /// \endcond
  28. /// Calculates hash of basename
  29. /*!
  30. \param[in] G1
  31. The elliptic curve group.
  32. \param[in] hash_alg
  33. The hash algorithm.
  34. \param[in] basename
  35. The basename.
  36. \param[in] basename_len
  37. The size of the basename in bytes.
  38. \param[out] B_str
  39. The resulting hashed basename.
  40. \param[out] iterations
  41. The number of hash iterations needed to find a valid hash. Can be NULL.
  42. \returns ::EpidStatus
  43. */
  44. EpidStatus HashBaseName(EcGroup* G1, HashAlg hash_alg, void const* basename,
  45. size_t basename_len, G1ElemStr* B_str,
  46. uint32_t* iterations);
  47. #endif // EPID_MEMBER_SRC_HASH_BASENAME_H_