Lines Matching refs:gcd
139 BIGNUM *p1 = NULL, *gcd = NULL; in ossl_rsa_check_prime_factor() local
149 gcd = BN_CTX_get(ctx); in ossl_rsa_check_prime_factor()
150 if (gcd != NULL) { in ossl_rsa_check_prime_factor()
152 BN_set_flags(gcd, BN_FLG_CONSTTIME); in ossl_rsa_check_prime_factor()
161 && BN_gcd(gcd, p1, e, ctx) in ossl_rsa_check_prime_factor()
162 && BN_is_one(gcd); in ossl_rsa_check_prime_factor()
178 BIGNUM *r, *p1, *q1, *lcm, *p1q1, *gcd; in ossl_rsa_check_private_exponent() local
190 gcd = BN_CTX_get(ctx); in ossl_rsa_check_private_exponent()
191 if (gcd != NULL) { in ossl_rsa_check_private_exponent()
197 BN_set_flags(gcd, BN_FLG_CONSTTIME); in ossl_rsa_check_private_exponent()
204 && (ossl_rsa_get_lcm(ctx, rsa->p, rsa->q, lcm, gcd, p1, q1, in ossl_rsa_check_private_exponent()
216 BN_clear(gcd); in ossl_rsa_check_private_exponent()
266 BIGNUM *lcm, BIGNUM *gcd, BIGNUM *p1, BIGNUM *q1, in ossl_rsa_get_lcm() argument
272 && BN_gcd(gcd, p1, q1, ctx) in ossl_rsa_get_lcm()
273 && BN_div(lcm, NULL, p1q1, gcd, ctx); /* LCM((p-1, q-1)) */ in ossl_rsa_get_lcm()
286 BIGNUM *gcd = NULL; local
318 gcd = BN_new();
319 if (ctx == NULL || gcd == NULL)
326 if (!BN_gcd(gcd, rsa->n, ossl_bn_get0_small_factors(), ctx)
327 || !BN_is_one(gcd)) {
348 BN_free(gcd);