sm2_commit.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright 2014-2022 The GmSSL Project. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the License); you may
  5. * not use this file except in compliance with the License.
  6. *
  7. * http://www.apache.org/licenses/LICENSE-2.0
  8. */
  9. #ifndef GMSSL_SM2_COMMIT_H
  10. #define GMSSL_SM2_COMMIT_H
  11. #include <stdio.h>
  12. #include <string.h>
  13. #include <stdlib.h>
  14. #include <limits.h>
  15. #include <stdint.h>
  16. #include <gmssl/sm2.h>
  17. #include <gmssl/sm3.h>
  18. #include <gmssl/mem.h>
  19. #include <gmssl/asn1.h>
  20. #include <gmssl/rand.h>
  21. #include <gmssl/error.h>
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. int sm2_commit_generate(const uint8_t x[32], uint8_t r[32], uint8_t commit[65], size_t *commitlen);
  26. int sm2_commit_open(const uint8_t x[32], const uint8_t r[32], const uint8_t *commit, size_t commitlen);
  27. int sm2_commit_vector_generate(const sm2_bn_t *x, size_t count, uint8_t r[32], uint8_t commit[65], size_t *commitlen);
  28. int sm2_commit_vector_open(const sm2_bn_t *x, size_t count, const uint8_t r[32], const uint8_t *commit, size_t commitlen);
  29. #ifdef __cplusplus
  30. }
  31. #endif
  32. #endif