Use labs(rand()) instead of abs(rand()) in tommath

Originally by Christos Zoulas.
This commit is contained in:
Nicolas Williams
2017-01-31 11:39:55 -06:00
committed by Viktor Dukhovni
parent 369945f5bc
commit 352ff15477
5 changed files with 8 additions and 7 deletions

View File

@@ -281,7 +281,7 @@ int main(void)
printf("%s\n", buf);
} else if (n == 13) {
rand_num2(&a);
tmp = labs(rand()) & THE_MASK;
tmp = abs(rand()) & THE_MASK;
mp_add_d(&a, tmp, &b);
printf("add_d\n");
mp_to64(&a, buf);
@@ -290,7 +290,7 @@ int main(void)
printf("%s\n", buf);
} else if (n == 14) {
rand_num2(&a);
tmp = labs(rand()) & THE_MASK;
tmp = abs(rand()) & THE_MASK;
mp_sub_d(&a, tmp, &b);
printf("sub_d\n");
mp_to64(&a, buf);