Esempio n. 1
0
 private void GlobalInit()
 {
     if (null == bigint_ctx)
     {
         bigint_ctx = BI_CTX.bi_initialize();
     }
 }
Esempio n. 2
0
        internal BigInteger mod_pow(BigInteger modulus, BigInteger exponent)
        {
            BI_CTX tmp_ctx = BI_CTX.bi_initialize();

            tmp_ctx.bi_set_mod(tmp_ctx.bi_clone(modulus._impl),
                               BIGINT_M_OFFSET);
            bigint tmp_biR = tmp_ctx.bi_mod_power(tmp_ctx.bi_clone(_impl),
                                                  tmp_ctx.bi_clone(exponent._impl));
            bigint biR = bigint_ctx.bi_clone(tmp_biR);

            tmp_ctx.bi_free(tmp_biR);
            tmp_ctx.bi_free_mod(BIGINT_M_OFFSET);
            tmp_ctx.bi_terminate();
            return(new BigInteger(biR));
        }