bigint.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. ROM functions for hardware bigint support.
  3. It is not recommended to use these functions directly,
  4. use the wrapper functions in hwcrypto/mpi.h instead.
  5. */
  6. // Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
  7. //
  8. // Licensed under the Apache License, Version 2.0 (the "License");
  9. // you may not use this file except in compliance with the License.
  10. // You may obtain a copy of the License at
  11. // http://www.apache.org/licenses/LICENSE-2.0
  12. //
  13. // Unless required by applicable law or agreed to in writing, software
  14. // distributed under the License is distributed on an "AS IS" BASIS,
  15. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. // See the License for the specific language governing permissions and
  17. // limitations under the License.
  18. #ifndef _ROM_BIGINT_H_
  19. #define _ROM_BIGINT_H_
  20. #include <stdint.h>
  21. #include <stdbool.h>
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. void ets_bigint_enable(void);
  26. void ets_bigint_disable(void);
  27. int ets_bigint_multiply(const uint32_t *x, const uint32_t *y, uint32_t len_words);
  28. int ets_bigint_modmult(const uint32_t *x, const uint32_t *y, const uint32_t *m, uint32_t m_dash, const uint32_t *rb, uint32_t len_words);
  29. int ets_bigint_modexp(const uint32_t *x, const uint32_t *y, const uint32_t *m, uint32_t m_dash, const uint32_t *rb, bool constant_time, uint32_t len_words);
  30. void ets_bigint_wait_finish(void);
  31. int ets_bigint_getz(uint32_t *z, uint32_t len_words);
  32. #ifdef __cplusplus
  33. }
  34. #endif
  35. #endif /* _ROM_BIGINT_H_ */