mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 00:55:39 +01:00
Add ecdsa_init and ecdsa_free
This commit is contained in:
parent
bec2f45cfc
commit
7c8934ea0e
@ -84,6 +84,20 @@ int ecdsa_verify( const ecp_group *grp,
|
||||
const unsigned char *buf, size_t blen,
|
||||
const ecp_point *Q, const mpi *r, const mpi *s);
|
||||
|
||||
/**
|
||||
* \brief Initialize context
|
||||
*
|
||||
* \param ctx Context to initialize
|
||||
*/
|
||||
void ecdsa_init( ecdsa_context *ctx );
|
||||
|
||||
/**
|
||||
* \brief Free context
|
||||
*
|
||||
* \param ctx Context to free
|
||||
*/
|
||||
void ecdsa_free( ecdsa_context *ctx );
|
||||
|
||||
/**
|
||||
* \brief Checkup routine
|
||||
*
|
||||
|
@ -174,6 +174,33 @@ cleanup:
|
||||
return( ret );
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize context
|
||||
*/
|
||||
void ecdsa_init( ecdsa_context *ctx )
|
||||
{
|
||||
ecp_group_init( &ctx->grp );
|
||||
mpi_init( &ctx->d );
|
||||
ecp_point_init( &ctx->Q );
|
||||
mpi_init( &ctx->r );
|
||||
mpi_init( &ctx->s );
|
||||
mpi_init( &ctx->d );
|
||||
ctx->point_format = POLARSSL_ECP_PF_UNCOMPRESSED;
|
||||
}
|
||||
|
||||
/*
|
||||
* Free context
|
||||
*/
|
||||
void ecdsa_free( ecdsa_context *ctx )
|
||||
{
|
||||
ecp_group_free( &ctx->grp );
|
||||
mpi_free( &ctx->d );
|
||||
ecp_point_free( &ctx->Q );
|
||||
mpi_free( &ctx->r );
|
||||
mpi_free( &ctx->s );
|
||||
mpi_free( &ctx->d );
|
||||
ctx->point_format = POLARSSL_ECP_PF_UNCOMPRESSED;
|
||||
}
|
||||
|
||||
#if defined(POLARSSL_SELF_TEST)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user