Use labs(rand()) instead of abs(rand()) in tommath
Originally by Christos Zoulas.
This commit is contained in:

committed by
Viktor Dukhovni

parent
369945f5bc
commit
352ff15477
@@ -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);
|
||||
|
Reference in New Issue
Block a user