Fix bug in ecdh_calc_secret()
Only affects curves with nbits != pbits (currently only secp224k1)
This commit is contained in:
parent
5304812b2d
commit
0a56c2c698
1 changed files with 1 additions and 1 deletions
|
@ -246,7 +246,7 @@ int ecdh_calc_secret( ecdh_context *ctx, size_t *olen,
|
||||||
if( mpi_size( &ctx->z ) > blen )
|
if( mpi_size( &ctx->z ) > blen )
|
||||||
return( POLARSSL_ERR_ECP_BAD_INPUT_DATA );
|
return( POLARSSL_ERR_ECP_BAD_INPUT_DATA );
|
||||||
|
|
||||||
*olen = ctx->grp.nbits / 8 + ( ( ctx->grp.nbits % 8 ) != 0 );
|
*olen = ctx->grp.pbits / 8 + ( ( ctx->grp.pbits % 8 ) != 0 );
|
||||||
return mpi_write_binary( &ctx->z, buf, *olen );
|
return mpi_write_binary( &ctx->z, buf, *olen );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue