@@ -41,23 +41,23 @@ int main(int argc, char *argv[]) {
4141 printf (" \n\n\t streess/%fkB: %d times\n " , m0.length ()/1000.0 , t);
4242
4343 gettimeofday (&curTime, NULL );
44- printf (" secret box ...@%6.3f\n " , curTime.tv_sec *1000 + (curTime.tv_usec / 1000 ));
44+ printf (" secret box ...@%6.3f\n " , curTime.tv_sec *1000.0 + (curTime.tv_usec / 1000.0 ));
4545
4646 unsigned char cab[crypto_secretbox_ZEROBYTES+m0.length ()];
4747 crypto_secretbox ((unsigned char *)cab, (unsigned char *)mb0, m0.length (), (unsigned char *)nonce, (unsigned char *)shk);
4848
4949 gettimeofday (&curTime, NULL );
50- printf (" ... secret box@%6.3f\n " , curTime.tv_sec *1000 + (curTime.tv_usec / 1000 ));
50+ printf (" ... secret box@%6.3f\n " , curTime.tv_sec *1000.0 + (curTime.tv_usec / 1000.0 ));
5151
5252
5353 gettimeofday (&curTime, NULL );
54- printf (" \n secret box open ...@%f \n " , curTime.tv_sec *1000 + (curTime.tv_usec / 1000 ));
54+ printf (" \n secret box open ...@%6.3f \n " , curTime.tv_sec *1000.0 + (curTime.tv_usec / 1000.0 ));
5555
5656 unsigned char mba[crypto_secretbox_ZEROBYTES+m0.length ()];
5757 crypto_secretbox_open ((unsigned char *)mba, (unsigned char *)(cab+16 ), 16 +m0.length (), (unsigned char *)nonce, (unsigned char *)shk);
5858
5959 gettimeofday (&curTime, NULL );
60- printf (" ... secret box open@%6.3f\n " , curTime.tv_sec *1000 + (curTime.tv_usec / 1000 ));
60+ printf (" ... secret box open@%6.3f\n " , curTime.tv_sec *1000.0 + (curTime.tv_usec / 1000.0 ));
6161 }
6262
6363 return 0 ;
0 commit comments