Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1258)

Unified Diff: lib/freebl/mpi/tests/mptest-8.c

Issue 201830043: Bug 1118245 - Apply uniform style across NSS
Patch Set: Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/freebl/mpi/tests/mptest-7.c ('k') | lib/freebl/mpi/tests/mptest-9.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/freebl/mpi/tests/mptest-8.c
===================================================================
--- a/lib/freebl/mpi/tests/mptest-8.c
+++ b/lib/freebl/mpi/tests/mptest-8.c
@@ -14,49 +14,50 @@
#include <limits.h>
#include <time.h>
#define MP_IOFUNC 1
#include "mpi.h"
#include "mpprime.h"
-int main(int argc, char *argv[])
-{
- int ix;
- mp_digit num;
- mp_int a;
+int main(int argc, char *argv[]) {
+ int ix;
+ mp_digit num;
+ mp_int a;
srand(time(NULL));
- if(argc < 2) {
+ if (argc < 2) {
fprintf(stderr, "Usage: %s <a>\n", argv[0]);
return 1;
}
printf("Test 8: Probabilistic primality testing\n\n");
mp_init(&a);
mp_read_radix(&a, argv[1], 10);
- printf("a = "); mp_print(&a, stdout); fputc('\n', stdout);
+ printf("a = ");
+ mp_print(&a, stdout);
+ fputc('\n', stdout);
printf("\nChecking for divisibility by small primes ... \n");
num = 170;
- if(mpp_divis_primes(&a, &num) == MP_YES) {
+ if (mpp_divis_primes(&a, &num) == MP_YES) {
printf("it is not prime\n");
goto CLEANUP;
}
printf("Passed that test (not divisible by any small primes).\n");
- for(ix = 0; ix < 10; ix++) {
+ for (ix = 0; ix < 10; ix++) {
printf("\nPerforming Rabin-Miller test, iteration %d\n", ix + 1);
- if(mpp_pprime(&a, 5) == MP_NO) {
+ if (mpp_pprime(&a, 5) == MP_NO) {
printf("it is not prime\n");
goto CLEANUP;
}
}
printf("All tests passed; a is probably prime\n");
CLEANUP:
mp_clear(&a);
« no previous file with comments | « lib/freebl/mpi/tests/mptest-7.c ('k') | lib/freebl/mpi/tests/mptest-9.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b