mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-03 20:54:41 +02:00
optimize domain check in wolfcrypt/src/integer.c and wolfcrypt/src/tfm.c.
This commit is contained in:
@@ -562,10 +562,10 @@ void mp_rshb (mp_int *c, int x)
|
||||
mp_digit r, rr;
|
||||
mp_digit D = x;
|
||||
|
||||
/* shifting by a negative number not supported */
|
||||
if (x < 0) return;
|
||||
/* shifting by zero changes nothing */
|
||||
if (x == 0) return;
|
||||
/* shifting by a negative number not supported, and shifting by
|
||||
* zero changes nothing.
|
||||
*/
|
||||
if (x <= 0) return;
|
||||
|
||||
/* shift digits first if needed */
|
||||
if (x >= DIGIT_BIT) {
|
||||
|
@@ -3903,10 +3903,10 @@ void fp_rshb(fp_int *c, int x)
|
||||
fp_digit r, rr;
|
||||
fp_digit D = x;
|
||||
|
||||
/* shifting by a negative number not supported */
|
||||
if (x < 0) return;
|
||||
/* shifting by zero changes nothing */
|
||||
if (x == 0) return;
|
||||
/* shifting by a negative number not supported, and shifting by
|
||||
* zero changes nothing.
|
||||
*/
|
||||
if (x <= 0) return;
|
||||
|
||||
/* shift digits first if needed */
|
||||
if (x >= DIGIT_BIT) {
|
||||
|
Reference in New Issue
Block a user