signbasic.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. /// EpidSignBasic interface.
  17. /*! \file */
  18. #ifndef EPID_MEMBER_SRC_SIGNBASIC_H_
  19. #define EPID_MEMBER_SRC_SIGNBASIC_H_
  20. #include <stddef.h>
  21. #include "epid/common/errors.h"
  22. /// \cond
  23. typedef struct MemberCtx MemberCtx;
  24. typedef struct BasicSignature BasicSignature;
  25. typedef struct BigNumStr BigNumStr;
  26. /// \endcond
  27. /// Creates a basic signature for use in constrained environment.
  28. /*!
  29. Used in constrained environments where, due to limited memory, it may not
  30. be possible to process through a large and potentially unbounded revocation
  31. list.
  32. \param[in] ctx
  33. The member context.
  34. \param[in] msg
  35. The message.
  36. \param[in] msg_len
  37. The length of message in bytes.
  38. \param[in] basename
  39. Optional basename. If basename is NULL a random basename is used.
  40. Signatures generated using random basenames are anonymous. Signatures
  41. generated using the same basename are linkable by the verifier. If a
  42. basename is provided it must already be registered or
  43. ::kEpidBadArgErr is returned.
  44. \param[in] basename_len
  45. The size of basename in bytes. Must be 0 if basename is NULL.
  46. \param[out] sig
  47. The generated basic signature
  48. \param[out] rnd_bsn
  49. Random basename, can be NULL if basename is provided.
  50. \returns ::EpidStatus
  51. \note
  52. This function should be used in conjunction with EpidNrProve()
  53. \note
  54. If the result is not ::kEpidNoErr the content of sig, is undefined.
  55. \see EpidMemberInit
  56. \see EpidNrProve
  57. */
  58. EpidStatus EpidSignBasic(MemberCtx const* ctx, void const* msg, size_t msg_len,
  59. void const* basename, size_t basename_len,
  60. BasicSignature* sig, BigNumStr* rnd_bsn);
  61. #endif // EPID_MEMBER_SRC_SIGNBASIC_H_