mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 10:47:28 +02:00
SP int: fix for SP_INT_DIGITS calc
Implementation of sp_mont_red needs words * 2 + 1.
This commit is contained in:
@ -425,10 +425,10 @@ typedef struct sp_ecc_ctx {
|
|||||||
* numbers in bits that will be used.
|
* numbers in bits that will be used.
|
||||||
* Double the size to hold multiplication result.
|
* Double the size to hold multiplication result.
|
||||||
* Add one to accommodate extra digit used by sp_mul(), sp_mulmod(),
|
* Add one to accommodate extra digit used by sp_mul(), sp_mulmod(),
|
||||||
* sp_sqr(), and sp_sqrmod().
|
* sp_sqr(), sp_sqrmod() and sp_mont_red().
|
||||||
*/
|
*/
|
||||||
#define SP_INT_DIGITS \
|
#define SP_INT_DIGITS \
|
||||||
(((SP_INT_BITS * 2 + SP_WORD_SIZE - 1) / SP_WORD_SIZE) + 1)
|
(((SP_INT_BITS + SP_WORD_SIZE - 1) / SP_WORD_SIZE) * 2 + 1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SP_INT_MAX_BITS
|
#ifndef SP_INT_MAX_BITS
|
||||||
|
Reference in New Issue
Block a user