- 01945E4CAD02CCC3811194A69CB62904B862F6A07E6EF4C7801E4D702A9C076AB3CE0056349E7121D64212B73511400C5D28580C400FFAD7E71014F753E4295A
+ 89B1C405D92E249341BDC0BDDC5A98D8AE8DD0349E04A165063D938F01DF557A057BE544C51B0EFB6D72D505F1424A1AA3A6D7957E83F229711677240123E2FD
eucrypt/smg_rsa/tests/tests.c
(601 . 6)(601 . 51)
105 xfree(getbuffer);
106 }
107
108 void test_dirty_float_rng( int nruns ) {
109 int i, status;
110 float dirty;
111
112 printf("Running test for smg rng dirty float with %d runs\n", nruns);
113 for (i=0; i<nruns; i++) {
114 status = rng_dirty_float( &dirty );
115 printf("Run %d: %f status %s\n", i+1, dirty, status>0 ? "OK" : "FAIL");
116 }
117 }
118
119 void test_ieee_float_rng( int nruns ) {
120 int i, status;
121 float ieee;
122
123 printf("Running test for smg rng ieee 745/1985 float with %d runs\n", nruns);
124 for (i=0; i<nruns; i++) {
125 status = rng_float_754_1985( &ieee );
126 printf("Run %d: %f status %s\n", i+1, ieee, status>0 ? "OK" : "FAIL");
127 }
128 }
129
130 void test_uint32_rng( int nruns ) {
131 int i, status;
132 uint32_t n;
133
134 printf("Running test for smg rng unsigned int32 with %d runs\n", nruns);
135 for (i=0; i<nruns; i++) {
136 status = rng_uint32( &n );
137 printf("Run %d: %"PRIu32" status %s\n", i+1, n, status>0 ? "OK" : "FAIL");
138 }
139 }
140
141 void test_uint64_rng( int nruns ) {
142 int i, status;
143 uint64_t n;
144
145 printf("Running test for smg rng unsigned int64 with %d runs\n", nruns);
146 for (i=0; i<nruns; i++) {
147 status = rng_uint64( &n );
148 printf("Run %d: %"PRIu64" status %s\n", i+1, n, status>0 ? "OK" : "FAIL");
149 }
150 }
151
152
153 int main(int ac, char **av)
154 {
155 int nruns;
(680 . 6)(725 . 18)
157 case 10:
158 test_mpi_buffer();
159 break;
160 case 11:
161 test_dirty_float_rng(nruns);
162 break;
163 case 12:
164 test_ieee_float_rng(nruns);
165 break;
166 case 13:
167 test_uint32_rng(nruns);
168 break;
169 case 14:
170 test_uint64_rng(nruns);
171 break;
172 default:
173 printf("Current test ids:\n");
174 printf("0 for timing entropy source\n");
(694 . 6)(751 . 10)
176 printf("8 for timing rsa key pair generator\n");
177 printf("9 for oaep encrypt/decrypt\n");
178 printf("10 for testing mpi_set/get_buffer\n");
179 printf("11 for testing smg_rng dirty float\n");
180 printf("12 for testing smg_rng ieee 745/1985 float\n");
181 printf("13 for testing smg_rng uint32 \n");
182 printf("14 for testing smg_rng uint64 \n");
183 }
184
185 return 0;