示例1: BN_MONT_CTX_set_locked ▲点赞 7▼ intBN_MONT_CTX_set_locked(BN_MONT_CTX **pmont, CRYPTO_MUTEX *lock,constBIGNUM *mod, BN_CTX *bn_ctx){ CRYPTO_MUTEX_lock_read(lock); BN_MONT_CTX *ctx = *pmont; CRYPTO_MUTEX_unlock_read(lock);if(ctx) {return1; } CRYPTO_MUTEX_lock_wri...
}elsed = rsa->d;if(rsa->flags & RSA_FLAG_CACHE_PUBLIC)if(!BN_MONT_CTX_set_locked(&rsa->_method_mod_n, CRYPTO_LOCK_RSA, rsa->n, ctx)) {if(local_d) BN_free(local_d);gotoerr; }if(!rsa->meth->bn_mod_exp(ret,f,d,rsa->n,ctx, rsa->_method_mod_n))//...这里部分代码...
BN_CTX *ctx); int BN_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx); int BN_mod_exp_mont(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, const BIGNUM *m, BN_CTX *ctx, BN_MONT_CTX *m_ctx); int BN_mod_exp_mont_consttime(BIGNUM *rr,...
ctx = new_ctx = BN_CTX_new ();if(ctx ==NULL)return-1; } BN_CTX_start (ctx); tmp1 = BN_CTX_get (ctx); tmp2 = BN_CTX_get (ctx); Za23 = BN_CTX_get (ctx); Zb23 = BN_CTX_get (ctx);if(Zb23 ==NULL)gotoend;/* We have to decide whether * (X_a/Z_a^2, Y_a/...
}if(rsa->flags & RSA_FLAG_CACHE_PUBLIC) {if(BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx) ==NULL) {gotoerr; } }if(!rsa->meth->bn_mod_exp(result, f, rsa->e, rsa->n, ctx, rsa->mont_n)) {gotoerr; ...
mont_ctx =BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx);if(mont_ctx ==NULL) {gotoerr; } } ret = BN_BLINDING_create_param(NULL, e, n, ctx, mont_ctx);if(ret ==NULL) { OPENSSL_PUT_ERROR(RSA, ERR_R_BN_LIB);gotoerr; ...
BN_CTX_free(&ctx);return(ret); } 开发者ID:robacklin,项目名称:uclinux-linux,代码行数:32,代码来源:dh_key.c 示例3: BN_MONT_CTX_set_locked ▲点赞 4▼ BN_MONT_CTX *BN_MONT_CTX_set_locked(BN_MONT_CTX **pmont,intlock,constBIGNUM *mod, ...
*/if(!BN_set_word(e,2))gotoerr;if(!BN_sub(e, group->order, e))gotoerr;/*- * Exponent e is public. * No need for scatter-gather or BN_FLG_CONSTTIME. */if(!BN_mod_exp_mont(r, x, e, group->order, ctx, group->mont_data))gotoerr; ...
{if(!BN_MONT_CTX_set_locked((BN_MONT_CTX **)&dsa->method_mont_p, CRYPTO_LOCK_DSA, dsa->p, ctx))gotoerr; }/* Compute r = (g^k mod p) mod q */if((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) ==0) {if(!BN_copy(&kq, &k))gotoerr;/* We do not want timing information...
}if(rsa->flags & RSA_FLAG_CACHE_PUBLIC) {if(BN_MONT_CTX_set_locked(&rsa->mont_n, &rsa->lock, rsa->n, ctx) ==NULL) {gotoerr; } }if(!rsa->meth->bn_mod_exp(result, f, rsa->e, rsa->n, ctx, rsa->mont_n)) {gotoerr; ...