ecdh_misc.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /**
  2. * \file ecdh_misc.h
  3. *
  4. * \brief Internal functions shared by the ECDH module
  5. */
  6. /*
  7. * Copyright The Mbed TLS Contributors
  8. * SPDX-License-Identifier: Apache-2.0
  9. *
  10. * Licensed under the Apache License, Version 2.0 ( the "License" ); you may
  11. * not use this file except in compliance with the License.
  12. * You may obtain a copy of the License at
  13. *
  14. * http://www.apache.org/licenses/LICENSE-2.0
  15. *
  16. * Unless required by applicable law or agreed to in writing, software
  17. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  18. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. * See the License for the specific language governing permissions and
  20. * limitations under the License.
  21. */
  22. #if !defined(MBEDTLS_ECDH_MISC_H)
  23. #define MBEDTLS_ECDH_MISC_H
  24. #include "mbedtls/ecdh.h"
  25. #include "mbedtls/ecp.h"
  26. #if defined(MBEDTLS_ECDH_C)
  27. #if defined(MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL)
  28. /*
  29. * Setup context without Everest
  30. */
  31. int mbedtls_ecdh_setup_no_everest( mbedtls_ecdh_context *ctx,
  32. mbedtls_ecp_group_id grp_id );
  33. /*
  34. * TLS 1.3 version of mbedtls_ecdh_make_params
  35. */
  36. int mbedtls_ecdh_tls13_make_params( mbedtls_ecdh_context *ctx, size_t *olen,
  37. unsigned char *buf, size_t buf_len,
  38. int ( *f_rng )( void *, unsigned char *, size_t ),
  39. void *p_rng );
  40. /*
  41. * TLS 1.3 version of mbedtls_ecdh_read_public
  42. */
  43. int mbedtls_ecdh_tls13_read_public( mbedtls_ecdh_context *ctx,
  44. const unsigned char *buf,
  45. size_t buf_len );
  46. #endif /* MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL */
  47. #endif /* MBEDTLS_ECDH_C */
  48. #endif /* !MBEDTLS_ECDH_MISC_H */