mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
mbedtls: make style
This commit is contained in:
parent
6324e2e746
commit
b1d6eaf2f7
177 changed files with 37224 additions and 41821 deletions
|
@ -106,8 +106,7 @@ extern "C" {
|
|||
* - Add the curve to the ecp_supported_curves array in ecp.c.
|
||||
* - Add the curve to applicable profiles in x509_crt.c if applicable.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
MBEDTLS_ECP_DP_NONE = 0, /*!< Curve not defined. */
|
||||
MBEDTLS_ECP_DP_SECP192R1, /*!< Domain parameters for the 192-bit curve defined by FIPS 186-4 and SEC1. */
|
||||
MBEDTLS_ECP_DP_SECP224R1, /*!< Domain parameters for the 224-bit curve defined by FIPS 186-4 and SEC1. */
|
||||
|
@ -134,8 +133,7 @@ typedef enum
|
|||
/*
|
||||
* Curve types
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
typedef enum {
|
||||
MBEDTLS_ECP_TYPE_NONE = 0,
|
||||
MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS, /* y^2 = x^3 + a x + b */
|
||||
MBEDTLS_ECP_TYPE_MONTGOMERY, /* y^2 = x^3 + a x^2 + x */
|
||||
|
@ -144,8 +142,7 @@ typedef enum
|
|||
/**
|
||||
* Curve information, for use by other modules.
|
||||
*/
|
||||
typedef struct mbedtls_ecp_curve_info
|
||||
{
|
||||
typedef struct mbedtls_ecp_curve_info {
|
||||
mbedtls_ecp_group_id grp_id; /*!< An internal identifier. */
|
||||
uint16_t tls_id; /*!< The TLS NamedCurve identifier. */
|
||||
uint16_t bit_size; /*!< The curve size in bits. */
|
||||
|
@ -163,8 +160,7 @@ typedef struct mbedtls_ecp_curve_info
|
|||
* Otherwise, \p X and \p Y are its standard (affine)
|
||||
* coordinates.
|
||||
*/
|
||||
typedef struct mbedtls_ecp_point
|
||||
{
|
||||
typedef struct mbedtls_ecp_point {
|
||||
mbedtls_mpi X; /*!< The X coordinate of the ECP point. */
|
||||
mbedtls_mpi Y; /*!< The Y coordinate of the ECP point. */
|
||||
mbedtls_mpi Z; /*!< The Z coordinate of the ECP point. */
|
||||
|
@ -212,8 +208,7 @@ mbedtls_ecp_point;
|
|||
* identical.
|
||||
*
|
||||
*/
|
||||
typedef struct mbedtls_ecp_group
|
||||
{
|
||||
typedef struct mbedtls_ecp_group {
|
||||
mbedtls_ecp_group_id id; /*!< An internal group identifier. */
|
||||
mbedtls_mpi P; /*!< The prime modulus of the base field. */
|
||||
mbedtls_mpi A; /*!< For Short Weierstrass: \p A in the equation. For
|
||||
|
@ -318,8 +313,7 @@ typedef struct mbedtls_ecp_restart_muladd mbedtls_ecp_restart_muladd_ctx;
|
|||
/**
|
||||
* \brief General context for resuming ECC operations
|
||||
*/
|
||||
typedef struct
|
||||
{
|
||||
typedef struct {
|
||||
unsigned ops_done; /*!< current ops count */
|
||||
unsigned depth; /*!< call depth (0 = top-level) */
|
||||
mbedtls_ecp_restart_mul_ctx *rsm; /*!< ecp_mul_comb() sub-context */
|
||||
|
@ -345,9 +339,9 @@ typedef struct
|
|||
* \return \c 0 if doing \p ops basic ops is still allowed,
|
||||
* \return #MBEDTLS_ERR_ECP_IN_PROGRESS otherwise.
|
||||
*/
|
||||
int mbedtls_ecp_check_budget( const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx,
|
||||
unsigned ops );
|
||||
int mbedtls_ecp_check_budget(const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx,
|
||||
unsigned ops);
|
||||
|
||||
/* Utility macro for checking and updating ops budget */
|
||||
#define MBEDTLS_ECP_BUDGET( ops ) \
|
||||
|
@ -371,8 +365,7 @@ typedef void mbedtls_ecp_restart_ctx;
|
|||
* \note Members are deliberately in the same order as in the
|
||||
* ::mbedtls_ecdsa_context structure.
|
||||
*/
|
||||
typedef struct mbedtls_ecp_keypair
|
||||
{
|
||||
typedef struct mbedtls_ecp_keypair {
|
||||
mbedtls_ecp_group grp; /*!< Elliptic curve and base point */
|
||||
mbedtls_mpi d; /*!< our secret value */
|
||||
mbedtls_ecp_point Q; /*!< our public value */
|
||||
|
@ -448,7 +441,7 @@ mbedtls_ecp_keypair;
|
|||
*
|
||||
* \note This setting is currently ignored by Curve25519.
|
||||
*/
|
||||
void mbedtls_ecp_set_max_ops( unsigned max_ops );
|
||||
void mbedtls_ecp_set_max_ops(unsigned max_ops);
|
||||
|
||||
/**
|
||||
* \brief Check if restart is enabled (max_ops != 0)
|
||||
|
@ -456,13 +449,13 @@ void mbedtls_ecp_set_max_ops( unsigned max_ops );
|
|||
* \return \c 0 if \c max_ops == 0 (restart disabled)
|
||||
* \return \c 1 otherwise (restart enabled)
|
||||
*/
|
||||
int mbedtls_ecp_restart_is_enabled( void );
|
||||
int mbedtls_ecp_restart_is_enabled(void);
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
/*
|
||||
* Get the type of a curve
|
||||
*/
|
||||
mbedtls_ecp_curve_type mbedtls_ecp_get_type( const mbedtls_ecp_group *grp );
|
||||
mbedtls_ecp_curve_type mbedtls_ecp_get_type(const mbedtls_ecp_group *grp);
|
||||
|
||||
/**
|
||||
* \brief This function retrieves the information defined in
|
||||
|
@ -477,7 +470,7 @@ mbedtls_ecp_curve_type mbedtls_ecp_get_type( const mbedtls_ecp_group *grp );
|
|||
*
|
||||
* \return A statically allocated array. The last entry is 0.
|
||||
*/
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void );
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list(void);
|
||||
|
||||
/**
|
||||
* \brief This function retrieves the list of internal group
|
||||
|
@ -493,7 +486,7 @@ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_list( void );
|
|||
* \return A statically allocated array,
|
||||
* terminated with MBEDTLS_ECP_DP_NONE.
|
||||
*/
|
||||
const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list( void );
|
||||
const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list(void);
|
||||
|
||||
/**
|
||||
* \brief This function retrieves curve information from an internal
|
||||
|
@ -504,7 +497,7 @@ const mbedtls_ecp_group_id *mbedtls_ecp_grp_id_list( void );
|
|||
* \return The associated curve information on success.
|
||||
* \return NULL on failure.
|
||||
*/
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id( mbedtls_ecp_group_id grp_id );
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id(mbedtls_ecp_group_id grp_id);
|
||||
|
||||
/**
|
||||
* \brief This function retrieves curve information from a TLS
|
||||
|
@ -515,7 +508,7 @@ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_grp_id( mbedtls_ecp_gr
|
|||
* \return The associated curve information on success.
|
||||
* \return NULL on failure.
|
||||
*/
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id( uint16_t tls_id );
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id(uint16_t tls_id);
|
||||
|
||||
/**
|
||||
* \brief This function retrieves curve information from a
|
||||
|
@ -526,14 +519,14 @@ const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_tls_id( uint16_t tls_i
|
|||
* \return The associated curve information on success.
|
||||
* \return NULL on failure.
|
||||
*/
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_name( const char *name );
|
||||
const mbedtls_ecp_curve_info *mbedtls_ecp_curve_info_from_name(const char *name);
|
||||
|
||||
/**
|
||||
* \brief This function initializes a point as zero.
|
||||
*
|
||||
* \param pt The point to initialize.
|
||||
*/
|
||||
void mbedtls_ecp_point_init( mbedtls_ecp_point *pt );
|
||||
void mbedtls_ecp_point_init(mbedtls_ecp_point *pt);
|
||||
|
||||
/**
|
||||
* \brief This function initializes an ECP group context
|
||||
|
@ -544,21 +537,21 @@ void mbedtls_ecp_point_init( mbedtls_ecp_point *pt );
|
|||
* mbedtls_ecp_group_load() or mbedtls_ecp_tls_read_group()
|
||||
* functions.
|
||||
*/
|
||||
void mbedtls_ecp_group_init( mbedtls_ecp_group *grp );
|
||||
void mbedtls_ecp_group_init(mbedtls_ecp_group *grp);
|
||||
|
||||
/**
|
||||
* \brief This function initializes a key pair as an invalid one.
|
||||
*
|
||||
* \param key The key pair to initialize.
|
||||
*/
|
||||
void mbedtls_ecp_keypair_init( mbedtls_ecp_keypair *key );
|
||||
void mbedtls_ecp_keypair_init(mbedtls_ecp_keypair *key);
|
||||
|
||||
/**
|
||||
* \brief This function frees the components of a point.
|
||||
*
|
||||
* \param pt The point to free.
|
||||
*/
|
||||
void mbedtls_ecp_point_free( mbedtls_ecp_point *pt );
|
||||
void mbedtls_ecp_point_free(mbedtls_ecp_point *pt);
|
||||
|
||||
/**
|
||||
* \brief This function frees the components of an ECP group.
|
||||
|
@ -567,7 +560,7 @@ void mbedtls_ecp_point_free( mbedtls_ecp_point *pt );
|
|||
* case this function returns immediately. If it is not
|
||||
* \c NULL, it must point to an initialized ECP group.
|
||||
*/
|
||||
void mbedtls_ecp_group_free( mbedtls_ecp_group *grp );
|
||||
void mbedtls_ecp_group_free(mbedtls_ecp_group *grp);
|
||||
|
||||
/**
|
||||
* \brief This function frees the components of a key pair.
|
||||
|
@ -576,7 +569,7 @@ void mbedtls_ecp_group_free( mbedtls_ecp_group *grp );
|
|||
* case this function returns immediately. If it is not
|
||||
* \c NULL, it must point to an initialized ECP key pair.
|
||||
*/
|
||||
void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key );
|
||||
void mbedtls_ecp_keypair_free(mbedtls_ecp_keypair *key);
|
||||
|
||||
#if defined(MBEDTLS_ECP_RESTARTABLE)
|
||||
/**
|
||||
|
@ -585,7 +578,7 @@ void mbedtls_ecp_keypair_free( mbedtls_ecp_keypair *key );
|
|||
* \param ctx The restart context to initialize. This must
|
||||
* not be \c NULL.
|
||||
*/
|
||||
void mbedtls_ecp_restart_init( mbedtls_ecp_restart_ctx *ctx );
|
||||
void mbedtls_ecp_restart_init(mbedtls_ecp_restart_ctx *ctx);
|
||||
|
||||
/**
|
||||
* \brief Free the components of a restart context.
|
||||
|
@ -594,7 +587,7 @@ void mbedtls_ecp_restart_init( mbedtls_ecp_restart_ctx *ctx );
|
|||
* case this function returns immediately. If it is not
|
||||
* \c NULL, it must point to an initialized restart context.
|
||||
*/
|
||||
void mbedtls_ecp_restart_free( mbedtls_ecp_restart_ctx *ctx );
|
||||
void mbedtls_ecp_restart_free(mbedtls_ecp_restart_ctx *ctx);
|
||||
#endif /* MBEDTLS_ECP_RESTARTABLE */
|
||||
|
||||
/**
|
||||
|
@ -608,7 +601,7 @@ void mbedtls_ecp_restart_free( mbedtls_ecp_restart_ctx *ctx );
|
|||
* \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
|
||||
* \return Another negative error code for other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
|
||||
int mbedtls_ecp_copy(mbedtls_ecp_point *P, const mbedtls_ecp_point *Q);
|
||||
|
||||
/**
|
||||
* \brief This function copies the contents of group \p src into
|
||||
|
@ -621,8 +614,8 @@ int mbedtls_ecp_copy( mbedtls_ecp_point *P, const mbedtls_ecp_point *Q );
|
|||
* \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst,
|
||||
const mbedtls_ecp_group *src );
|
||||
int mbedtls_ecp_group_copy(mbedtls_ecp_group *dst,
|
||||
const mbedtls_ecp_group *src);
|
||||
|
||||
/**
|
||||
* \brief This function sets a point to the point at infinity.
|
||||
|
@ -633,7 +626,7 @@ int mbedtls_ecp_group_copy( mbedtls_ecp_group *dst,
|
|||
* \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_set_zero( mbedtls_ecp_point *pt );
|
||||
int mbedtls_ecp_set_zero(mbedtls_ecp_point *pt);
|
||||
|
||||
/**
|
||||
* \brief This function checks if a point is the point at infinity.
|
||||
|
@ -644,7 +637,7 @@ int mbedtls_ecp_set_zero( mbedtls_ecp_point *pt );
|
|||
* \return \c 0 if the point is non-zero.
|
||||
* \return A negative error code on failure.
|
||||
*/
|
||||
int mbedtls_ecp_is_zero( mbedtls_ecp_point *pt );
|
||||
int mbedtls_ecp_is_zero(mbedtls_ecp_point *pt);
|
||||
|
||||
/**
|
||||
* \brief This function compares two points.
|
||||
|
@ -658,8 +651,8 @@ int mbedtls_ecp_is_zero( mbedtls_ecp_point *pt );
|
|||
* \return \c 0 if the points are equal.
|
||||
* \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if the points are not equal.
|
||||
*/
|
||||
int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P,
|
||||
const mbedtls_ecp_point *Q );
|
||||
int mbedtls_ecp_point_cmp(const mbedtls_ecp_point *P,
|
||||
const mbedtls_ecp_point *Q);
|
||||
|
||||
/**
|
||||
* \brief This function imports a non-zero point from two ASCII
|
||||
|
@ -673,8 +666,8 @@ int mbedtls_ecp_point_cmp( const mbedtls_ecp_point *P,
|
|||
* \return \c 0 on success.
|
||||
* \return An \c MBEDTLS_ERR_MPI_XXX error code on failure.
|
||||
*/
|
||||
int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix,
|
||||
const char *x, const char *y );
|
||||
int mbedtls_ecp_point_read_string(mbedtls_ecp_point *P, int radix,
|
||||
const char *x, const char *y);
|
||||
|
||||
/**
|
||||
* \brief This function exports a point into unsigned binary data.
|
||||
|
@ -701,10 +694,10 @@ int mbedtls_ecp_point_read_string( mbedtls_ecp_point *P, int radix,
|
|||
* or the export for the given group is not implemented.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *P,
|
||||
int format, size_t *olen,
|
||||
unsigned char *buf, size_t buflen );
|
||||
int mbedtls_ecp_point_write_binary(const mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *P,
|
||||
int format, size_t *olen,
|
||||
unsigned char *buf, size_t buflen);
|
||||
|
||||
/**
|
||||
* \brief This function imports a point from unsigned binary data.
|
||||
|
@ -728,9 +721,9 @@ int mbedtls_ecp_point_write_binary( const mbedtls_ecp_group *grp,
|
|||
* \return #MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE if the import for the
|
||||
* given group is not implemented.
|
||||
*/
|
||||
int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_point *P,
|
||||
const unsigned char *buf, size_t ilen );
|
||||
int mbedtls_ecp_point_read_binary(const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_point *P,
|
||||
const unsigned char *buf, size_t ilen);
|
||||
|
||||
/**
|
||||
* \brief This function imports a point from a TLS ECPoint record.
|
||||
|
@ -750,9 +743,9 @@ int mbedtls_ecp_point_read_binary( const mbedtls_ecp_group *grp,
|
|||
* failure.
|
||||
* \return #MBEDTLS_ERR_ECP_BAD_INPUT_DATA if input is invalid.
|
||||
*/
|
||||
int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_point *pt,
|
||||
const unsigned char **buf, size_t len );
|
||||
int mbedtls_ecp_tls_read_point(const mbedtls_ecp_group *grp,
|
||||
mbedtls_ecp_point *pt,
|
||||
const unsigned char **buf, size_t len);
|
||||
|
||||
/**
|
||||
* \brief This function exports a point as a TLS ECPoint record
|
||||
|
@ -776,10 +769,10 @@ int mbedtls_ecp_tls_read_point( const mbedtls_ecp_group *grp,
|
|||
* is too small to hold the exported point.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *pt,
|
||||
int format, size_t *olen,
|
||||
unsigned char *buf, size_t blen );
|
||||
int mbedtls_ecp_tls_write_point(const mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *pt,
|
||||
int format, size_t *olen,
|
||||
unsigned char *buf, size_t blen);
|
||||
|
||||
/**
|
||||
* \brief This function sets up an ECP group context
|
||||
|
@ -798,7 +791,7 @@ int mbedtls_ecp_tls_write_point( const mbedtls_ecp_group *grp,
|
|||
* correspond to a known group.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id );
|
||||
int mbedtls_ecp_group_load(mbedtls_ecp_group *grp, mbedtls_ecp_group_id id);
|
||||
|
||||
/**
|
||||
* \brief This function sets up an ECP group context from a TLS
|
||||
|
@ -817,8 +810,8 @@ int mbedtls_ecp_group_load( mbedtls_ecp_group *grp, mbedtls_ecp_group_id id );
|
|||
* recognized.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp,
|
||||
const unsigned char **buf, size_t len );
|
||||
int mbedtls_ecp_tls_read_group(mbedtls_ecp_group *grp,
|
||||
const unsigned char **buf, size_t len);
|
||||
|
||||
/**
|
||||
* \brief This function extracts an elliptic curve group ID from a
|
||||
|
@ -838,9 +831,9 @@ int mbedtls_ecp_tls_read_group( mbedtls_ecp_group *grp,
|
|||
* recognized.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_tls_read_group_id( mbedtls_ecp_group_id *grp,
|
||||
const unsigned char **buf,
|
||||
size_t len );
|
||||
int mbedtls_ecp_tls_read_group_id(mbedtls_ecp_group_id *grp,
|
||||
const unsigned char **buf,
|
||||
size_t len);
|
||||
/**
|
||||
* \brief This function exports an elliptic curve as a TLS
|
||||
* ECParameters record as defined in RFC 4492, Section 5.4.
|
||||
|
@ -859,9 +852,9 @@ int mbedtls_ecp_tls_read_group_id( mbedtls_ecp_group_id *grp,
|
|||
* buffer is too small to hold the exported group.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp,
|
||||
size_t *olen,
|
||||
unsigned char *buf, size_t blen );
|
||||
int mbedtls_ecp_tls_write_group(const mbedtls_ecp_group *grp,
|
||||
size_t *olen,
|
||||
unsigned char *buf, size_t blen);
|
||||
|
||||
/**
|
||||
* \brief This function performs a scalar multiplication of a point
|
||||
|
@ -899,9 +892,9 @@ int mbedtls_ecp_tls_write_group( const mbedtls_ecp_group *grp,
|
|||
* \return #MBEDTLS_ERR_MPI_ALLOC_FAILED on memory-allocation failure.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng );
|
||||
int mbedtls_ecp_mul(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng);
|
||||
|
||||
/**
|
||||
* \brief This function performs multiplication of a point by
|
||||
|
@ -933,10 +926,10 @@ int mbedtls_ecp_mul( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
|||
* operations was reached: see \c mbedtls_ecp_set_max_ops().
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx );
|
||||
int mbedtls_ecp_mul_restartable(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx);
|
||||
|
||||
#if defined(MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED)
|
||||
/**
|
||||
|
@ -974,9 +967,9 @@ int mbedtls_ecp_mul_restartable( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
|||
* designate a short Weierstrass curve.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
const mbedtls_mpi *n, const mbedtls_ecp_point *Q );
|
||||
int mbedtls_ecp_muladd(mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
const mbedtls_mpi *n, const mbedtls_ecp_point *Q);
|
||||
|
||||
/**
|
||||
* \brief This function performs multiplication and addition of two
|
||||
|
@ -1019,10 +1012,10 @@ int mbedtls_ecp_muladd( mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
|||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_muladd_restartable(
|
||||
mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
const mbedtls_mpi *n, const mbedtls_ecp_point *Q,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx );
|
||||
mbedtls_ecp_group *grp, mbedtls_ecp_point *R,
|
||||
const mbedtls_mpi *m, const mbedtls_ecp_point *P,
|
||||
const mbedtls_mpi *n, const mbedtls_ecp_point *Q,
|
||||
mbedtls_ecp_restart_ctx *rs_ctx);
|
||||
#endif /* MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED */
|
||||
|
||||
/**
|
||||
|
@ -1052,8 +1045,8 @@ int mbedtls_ecp_muladd_restartable(
|
|||
* a valid public key for the given curve.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *pt );
|
||||
int mbedtls_ecp_check_pubkey(const mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *pt);
|
||||
|
||||
/**
|
||||
* \brief This function checks that an \p mbedtls_mpi is a
|
||||
|
@ -1074,8 +1067,8 @@ int mbedtls_ecp_check_pubkey( const mbedtls_ecp_group *grp,
|
|||
* private key for the given curve.
|
||||
* \return Another negative error code on other kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp,
|
||||
const mbedtls_mpi *d );
|
||||
int mbedtls_ecp_check_privkey(const mbedtls_ecp_group *grp,
|
||||
const mbedtls_mpi *d);
|
||||
|
||||
/**
|
||||
* \brief This function generates a private key.
|
||||
|
@ -1092,10 +1085,10 @@ int mbedtls_ecp_check_privkey( const mbedtls_ecp_group *grp,
|
|||
* \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
|
||||
* on failure.
|
||||
*/
|
||||
int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp,
|
||||
mbedtls_mpi *d,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng );
|
||||
int mbedtls_ecp_gen_privkey(const mbedtls_ecp_group *grp,
|
||||
mbedtls_mpi *d,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng);
|
||||
|
||||
/**
|
||||
* \brief This function generates a keypair with a configurable base
|
||||
|
@ -1124,11 +1117,11 @@ int mbedtls_ecp_gen_privkey( const mbedtls_ecp_group *grp,
|
|||
* \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
|
||||
* on failure.
|
||||
*/
|
||||
int mbedtls_ecp_gen_keypair_base( mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *G,
|
||||
mbedtls_mpi *d, mbedtls_ecp_point *Q,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng );
|
||||
int mbedtls_ecp_gen_keypair_base(mbedtls_ecp_group *grp,
|
||||
const mbedtls_ecp_point *G,
|
||||
mbedtls_mpi *d, mbedtls_ecp_point *Q,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng);
|
||||
|
||||
/**
|
||||
* \brief This function generates an ECP keypair.
|
||||
|
@ -1153,10 +1146,10 @@ int mbedtls_ecp_gen_keypair_base( mbedtls_ecp_group *grp,
|
|||
* \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
|
||||
* on failure.
|
||||
*/
|
||||
int mbedtls_ecp_gen_keypair( mbedtls_ecp_group *grp, mbedtls_mpi *d,
|
||||
mbedtls_ecp_point *Q,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng );
|
||||
int mbedtls_ecp_gen_keypair(mbedtls_ecp_group *grp, mbedtls_mpi *d,
|
||||
mbedtls_ecp_point *Q,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng);
|
||||
|
||||
/**
|
||||
* \brief This function generates an ECP key.
|
||||
|
@ -1171,9 +1164,9 @@ int mbedtls_ecp_gen_keypair( mbedtls_ecp_group *grp, mbedtls_mpi *d,
|
|||
* \return An \c MBEDTLS_ERR_ECP_XXX or \c MBEDTLS_MPI_XXX error code
|
||||
* on failure.
|
||||
*/
|
||||
int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng );
|
||||
int mbedtls_ecp_gen_key(mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
|
||||
int (*f_rng)(void *, unsigned char *, size_t),
|
||||
void *p_rng);
|
||||
|
||||
/**
|
||||
* \brief This function reads an elliptic curve private key.
|
||||
|
@ -1193,8 +1186,8 @@ int mbedtls_ecp_gen_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
|
|||
* the group is not implemented.
|
||||
* \return Another negative error code on different kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_read_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
|
||||
const unsigned char *buf, size_t buflen );
|
||||
int mbedtls_ecp_read_key(mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
|
||||
const unsigned char *buf, size_t buflen);
|
||||
|
||||
/**
|
||||
* \brief This function exports an elliptic curve private key.
|
||||
|
@ -1212,8 +1205,8 @@ int mbedtls_ecp_read_key( mbedtls_ecp_group_id grp_id, mbedtls_ecp_keypair *key,
|
|||
* the group is not implemented.
|
||||
* \return Another negative error code on different kinds of failure.
|
||||
*/
|
||||
int mbedtls_ecp_write_key( mbedtls_ecp_keypair *key,
|
||||
unsigned char *buf, size_t buflen );
|
||||
int mbedtls_ecp_write_key(mbedtls_ecp_keypair *key,
|
||||
unsigned char *buf, size_t buflen);
|
||||
|
||||
/**
|
||||
* \brief This function checks that the keypair objects
|
||||
|
@ -1232,8 +1225,8 @@ int mbedtls_ecp_write_key( mbedtls_ecp_keypair *key,
|
|||
* \return An \c MBEDTLS_ERR_ECP_XXX or an \c MBEDTLS_ERR_MPI_XXX
|
||||
* error code on calculation failure.
|
||||
*/
|
||||
int mbedtls_ecp_check_pub_priv( const mbedtls_ecp_keypair *pub,
|
||||
const mbedtls_ecp_keypair *prv );
|
||||
int mbedtls_ecp_check_pub_priv(const mbedtls_ecp_keypair *pub,
|
||||
const mbedtls_ecp_keypair *prv);
|
||||
|
||||
#if defined(MBEDTLS_SELF_TEST)
|
||||
|
||||
|
@ -1243,7 +1236,7 @@ int mbedtls_ecp_check_pub_priv( const mbedtls_ecp_keypair *pub,
|
|||
* \return \c 0 on success.
|
||||
* \return \c 1 on failure.
|
||||
*/
|
||||
int mbedtls_ecp_self_test( int verbose );
|
||||
int mbedtls_ecp_self_test(int verbose);
|
||||
|
||||
#endif /* MBEDTLS_SELF_TEST */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue