4 #include <openssl/tmdiff.h>
9 #define MOD (8*8*8*8*8)
16 BIGNUM a
,b
,c
,r
,rr
,t
,l
;
17 int j
,i
,size
=SIZE
,num
=NUM
,mod
=MOD
;
22 BN_MONT_CTX_init(&mont
);
31 while (size
<= 1024*8)
37 BN_mod(&a
,&a
,&c
,&ctx
);
41 BN_MONT_CTX_set(&mont
,&c
,&ctx
);
43 md
=ms_time_diff(start
,end
);
48 /* bn_mull(&r,&a,&b,&ctx); */
49 /* BN_sqr(&r,&a,&ctx); */
50 BN_mod_exp_mont(&r
,&a
,&b
,&c
,&ctx
,&mont
);
53 d
=ms_time_diff(start
,end
)/* *50/33 */;
54 printf("%5d bit:%6.2f %6d %6.4f %4d m_set(%5.4f)\n",size
,
55 d
,num
,d
/num
,(int)((d
/num
)*mod
),md
/10.0);