1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Implement DH blinding

This commit is contained in:
Manuel Pégourié-Gonnard
2013-09-04 16:29:59 +02:00
parent 2d627649bf
commit 143b5028a5
4 changed files with 124 additions and 9 deletions

View File

@ -147,6 +147,9 @@ typedef struct
mpi GY; /*!< peer = G^Y mod P */
mpi K; /*!< key = GY^X mod P */
mpi RP; /*!< cached R^2 mod P */
mpi Vi; /*!< blinding value */
mpi Vf; /*!< un-blinding value */
mpi _X; /*!< previous X */
}
dhm_context;
@ -223,6 +226,9 @@ int dhm_make_public( dhm_context *ctx, int x_size,
* \param p_rng RNG parameter
*
* \return 0 if successful, or an POLARSSL_ERR_DHM_XXX error code
*
* \note If f_rng is not NULL, it is used to blind the input as
* countermeasure against timing attacks.
*/
int dhm_calc_secret( dhm_context *ctx,
unsigned char *output, size_t *olen,