2 #include <openssl/tmdiff.h>
7 #define MOD (8*8*8*8*8)
14 BIGNUM a,b,c,r,rr,t,l;
15 int j,i,size=SIZE,num=NUM,mod=MOD;
20 BN_MONT_CTX_init(&mont);
29 while (size <= 1024*8)
35 BN_mod(&a,&a,&c,&ctx);
39 BN_MONT_CTX_set(&mont,&c,&ctx);
41 md=ms_time_diff(start,end);
46 /* bn_mull(&r,&a,&b,&ctx); */
47 /* BN_sqr(&r,&a,&ctx); */
48 BN_mod_exp_mont(&r,&a,&b,&c,&ctx,&mont);
51 d=ms_time_diff(start,end)/* *50/33 */;
52 printf("%5d bit:%6.2f %6d %6.4f %4d m_set(%5.4f)\n",size,
53 d,num,d/num,(int)((d/num)*mod),md/10.0);