Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About generate RSA large prime pairs.Not only is it slow, but it's hard to find really large prime numbers #112

Open
you74092078 opened this issue May 17, 2022 · 0 comments

Comments

@you74092078
Copy link

miracl *mip = mirsys(4096,16);
irand(mip, time(NULL)+SEED_CONST);
.......
do
{
seed = brand(mip);
bigbits(mip,half,btmp);
//otnum(mip,btmp, stdout);
nxprime(mip,btmp,bp);
p_width = numdig(mip, bp);
if(p_width != (bits/8))
{
continue;
}

		for (i=0; i<10; i++)
		{
			if (!isprime(mip, bp))
			{
				continue;
			}
		}
		
		break;
	} while (1);

	do 
	{
		seed = brand(mip);
		bigbits(mip,half,btmp);
		//otnum(mip,btmp, stdout);
		nxprime(mip,btmp,bq);

		if (compare(bp,bq)==0)
		{
			continue;
		}
		q_width = numdig(mip, bq);
		if(q_width != (bits/8))
		{
			continue;
		}

		for (i=0; i<10; i++)
		{
			if (!isprime(mip, bq))
			{
				continue;
			}
		}

		break;
	} while (1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant