mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 19:05:44 +00:00
Use deterministic ECDSA in the PK layer
This commit is contained in:
parent
5e6edcfd96
commit
65ad3e4daf
|
@ -303,10 +303,19 @@ static int ecdsa_sign_wrap( void *ctx, md_type_t md_alg,
|
||||||
unsigned char *sig, size_t *sig_len,
|
unsigned char *sig, size_t *sig_len,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
|
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
|
||||||
{
|
{
|
||||||
|
/* Use deterministic ECDSA by default if available */
|
||||||
|
#if defined(POLARSSL_ECDSA_DETERMINISTIC)
|
||||||
|
((void) f_rng);
|
||||||
|
((void) p_rng);
|
||||||
|
|
||||||
|
return( ecdsa_write_signature_det( (ecdsa_context *) ctx,
|
||||||
|
hash, hash_len, sig, sig_len, md_alg ) );
|
||||||
|
#else
|
||||||
((void) md_alg);
|
((void) md_alg);
|
||||||
|
|
||||||
return( ecdsa_write_signature( (ecdsa_context *) ctx,
|
return( ecdsa_write_signature( (ecdsa_context *) ctx,
|
||||||
hash, hash_len, sig, sig_len, f_rng, p_rng ) );
|
hash, hash_len, sig, sig_len, f_rng, p_rng ) );
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void *ecdsa_alloc_wrap( void )
|
static void *ecdsa_alloc_wrap( void )
|
||||||
|
|
Loading…
Reference in a new issue