mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 20:24:39 +02:00
sp_math: error on multiplier larger than curve order
zd 12674
This commit is contained in:
@@ -3121,6 +3121,11 @@ exit:
|
|||||||
|
|
||||||
(void)a;
|
(void)a;
|
||||||
|
|
||||||
|
/* k can't have more bits than modulus count plus 1 */
|
||||||
|
if (mp_count_bits(k) > mp_count_bits(modulus) + 1) {
|
||||||
|
return ECC_OUT_OF_RANGE_E;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef WOLFSSL_HAVE_SP_ECC
|
#ifdef WOLFSSL_HAVE_SP_ECC
|
||||||
#ifndef WOLFSSL_SP_NO_256
|
#ifndef WOLFSSL_SP_NO_256
|
||||||
if (mp_count_bits(modulus) == 256) {
|
if (mp_count_bits(modulus) == 256) {
|
||||||
|
Reference in New Issue
Block a user