GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

Primality certificate

In mathematics and computer science, a primality certificate or primality proof is a succinct, formal proof that a number is prime. Primality certificates allow the primality of a number to be rapidly checked without having to run an expensive or unreliable primality test. "Succinct" usually means that the proof should be at most polynomially larger than the number of digits in the number itself (for example, if the number has b bits, the proof might contain roughly b 2 bits). Primality certificates lead directly to proofs that problems such as primality testing and the complement of integer factorization lie in NP, the class of problems verifiable in polynomial time given a solution. These... Source: e01 Encyclopedia. Licence: CC BY-SA 4.0.

In mathematics and computer science, a primality certificate or primality proof is a succinct, formal proof that a number is prime. Primality certificates allow the primality of a number to be rapidly checked without having to run an expensive or unreliable primality test. "Succinct" usually means that the proof should be at most polynomially larger than the number of digits in the number itself (for example, if the number has b bits, the proof might contain roughly b 2 bits). Primality certificates lead directly to proofs that problems such as primality testing and the complement of integer factorization lie in NP, the class of problems verifiable in polynomial time given a solution. These problems already trivially lie in co-NP. This was the first strong evidence that these problems are not NP-complete, since if they were, it would imply that NP is subset of co-NP, a result widely believed to be false; in fact, this was the first demonstration of a problem in NP intersect co-NP not known, at the time, to be in P. Producing certificates for the complement problem, to establish that a number is composite, is straightforward: it suffices to give a nontrivial divisor. Standard probabilistic primality tests such as the Baillie–PSW primality test, the Fermat primality test, and the Miller–Rabin primality test also produce compositeness certificates in the event where the input is composite, but do not produce certificates for prime inputs. However, it is possible to trick a verifier into accepting a composite number by giving it a "prime factorization" of n − 1 that includes composite numbers. For example, suppose we claim that n = 85 is prime, supplying a = 4 and n − 1 = 6 × 14 as the "prime factorization". Then (using q = 6 and q = 14): 4 is coprime to 85, 4 85−1 ≡ 1 (mod 85), 4 (85−1)/6 ≡ 16 (mod 85), 4 (85−1)/14 ≡ 16 (mod 85). We would falsely conclude that 85 is prime. We don't want to just force the verifier to factor the number, so a better way to avoid this issue is to give primality certificates for each of the prime factors of n − 1 as well, which are just smaller instances of the original problem. We continue recursively in this manner until we reach a number known to be prime, such as 2. We end up with a tree of prime numbers, each associated with a witness a. For example, here is a complete Pratt certificate for the number 229: 229 (a = 6, 229 − 1 = 2 2 × 3 × 19), 2 (known prime), 3 (a = 2, 3 − 1 = 2), 2 (known prime), 19 (a = 2, 19 − 1 = 2 × 3 2 ), 2 (known prime), 3 (a = 2, 3 − 1 = 2), 2 (known prime). This proof tree can be shown to contain at most 4\log_2 n - 4 values other than 2 by a simple inductive proof (based on theorem 2 of Pratt). The result holds for 3; in general, take p > 3 and let its children in the tree be p 1 , ..., p k . By the inductive hypothesis, the tree rooted at p i contains at most 4\log_2 p_i - 4 values, so the entire tree contains at most 1 + \sum_{i=1}^k (4\log_2 p_i - 4) = -4k + 4\log_2 p_1 \cdots p_k \leq 4\log_2 p - 4, since k ≥ 2, and p 1 ...p k ≤ p − 1. Since each value has at most log n bits, this also demonstrates that the certificate has a size of O((log n) 2 ) bits. Since there are O(log n) values other than 2, and each requires at most one exponentiation to verify (and exponentiations dominate the running time), the total time is O((log n) 3 (log log n)(log log log n)), or Õ((log n) 3 ), which is quite feasible for numbers in the range that computational number theorists usually work with. However, while useful in theory and easy to verify, actually generating a Pratt certificate for n requires factoring n − 1 and other potentially large numbers. This is simple for some special numbers such as Fermat primes, but currently much more difficult than simple primality testing for large primes of general form. M x , M y , A, B in \mathbb{Z}_n (the integers mod n) satisfying M y 2 = M x 3 + AM x + B and with 4A 3 + 27B 2 coprime to n; a prime q > n^{1/2} + 1 + 2n^{1/4} . Then M = (M x , M y ) is a non-identity point on the elliptic curve y 2 = x 3 + Ax + B. Let kM be M added to itself k times using standard elliptic-curve addition. Then, if qM is the identity element I, then n is prime. Technically, an elliptic curve can only be constructed over a field, and \mathbb{Z}_n is only a field if n is prime, so we seem to be assuming the result we're trying to prove. The difficulty arises in the elliptic-curve addition algorithm, which takes inverses in the field that may not exist in \mathbb{Z}_n . However, it can be shown (lemma 1 of "Almost All Primes Can Be Quickly Certified") that if we merely perform computations as though the curve were well-defined and do not at any point attempt to invert an element with no inverse, the result is still valid; if we do encounter an element with no inverse, this establishes that n is composite. To derive a certificate from this theorem, we first encode M x , M y , A, B, and q, then recursively encode the proof of primality for q 2 ) and can be verified in Õ((log n) 4 ) time. Moreover, the algorithm that generates these certificates can be shown to be expected polynomial time for all but a small fraction of primes, and this fraction exponentially decreases with the size of the primes. Consequently, it's well-suited to generating certified large random primes, an application that is important in cryptography applications such as generating provably valid RSA keys. Time spent on generating an ECPP certificate is not bounded, but a heuristic argument gives Õ((log n) 6 ) implemented naively as in Goldwasser-Kilian. Atkin and Morain lowered the number to Õ((log n) 5 ). FastECPP (Shallit, Franke, Morain, Enge) has lowered the time to Õ((log n) 4 ). Let P=Rh+1 where R=\prod q_j^{e_j} where q_j are distinct primes with e_j an integer greater than zero and a witness g such that: Then P is prime if one of the following holds: ===Pocklington primality certificate=== A Pocklington primality certificate consists of the prime P, a set primes q_j dividing (P-1) , each with their own Pocklington prime certificate or small enough to be a known prime, and a witness g . The steps needed for this certificate (and order of computational cost) should be the sum of these steps: Verify that all q_j are primes and that they divide P-1 , obtaining R and h in the process. This would take less time than the rest of the process. Verify that ( ) holds. This is the same complexity as the Fermat primality test, Õ((log P) 2 ). Verify that ( ) holds. This requires calculation of gcd, done for large numbers usually using the Extended Euclidean algorithm, over the number of primes provided. Each operation takes between Õ((log P) 2 ) to Õ((log P) 3 ) time depending on the relative magnitude of q_j versus P . Verify that the last step holds. This is approximately: \log_2{P}\left(1 + \sum_{k=1}^{\infty}\frac{1}{3^k}\right) = 1.5\log_2{P} for version ( ) to \log_2{P}\left(1 + \sum_{k=1}^{\infty}\frac{1}{2^k}\right) = 2\log_2{P} for version ( ). See also PARI/GP's documentation. ===A small example=== Let P=1056893 . Note that (P-1)=1621\cdot 163\cdot 2^2 and P^{1/2}=1028.053\ldots , P^{1/3}=101.86156\ldots . Using the 'witness' 2, equation is satisfied and using q=163 and q=1621 . For version , the certificate needs only P=1056893,\ q=1621,\ g=2 . for version , the certificate needs only P=1056893,\ q=163,\ g=2 , but there's a bit more work to do: h = (1056893-1)/163 = 6484 a\equiv h\equiv 127\bmod{163} and b=\left(6484-127\right)/163=39 Using r=3 fails: \left(127^2-4\cdot 39\right)^{(3-1)/2}\equiv (1^2-0)^1\equiv 1\bmod{3} Using r=5 succeeds: \left(127^2-4\cdot 39\right)^{(5-1)/2}\equiv (2^2-1)^2\equiv 2\bmod{5} , and P is prime. The Gerbicz error-checking scheme was originally defined for the Proth test, but was later extended to the Fermat primality test. The original form verifies the computation u(t)={a^k}^{2^t} \pmod N by adding an additional variable d(t)=\textstyle\prod_{i=0}^t u(iL) \pmod N and an arbitrary scaling constant L. There is therefore a recurrence relation of d(t+1)=d(t)\cdot u((t+1)\cdot L) \pmod N which can be used to update d(t) every L iterations of exponential doubling. There is also a relation d(t+1)=u(0)\cdot d(t)^{2^L} \pmod N , which is used to check the computation every B = L 2 iterations. A mismatch would result in a rollback to a previously saved "checkpoint" tuple of (t, u, d) . With the addition of the Pietrzak VDF scheme, the calculating client generates a "certificate" file using the saved "checkpoint" residues from the computation, resulting in a file of O(\log(m/L)) elements. It uploads the certificate to a server, which then assigns it to a "verifier" client. The verifier then uses the non-interactive version of the Pietrzak scheme to check the result. A generalization of the Pietrzak scheme to Lucas sequences has been published, in which the computation of U_{2^m}(P, Q) \bmod n , V_{2^m}(P, Q) \bmod n is verified. The main limitation of Gerbicz-Pietrzak is that it only applies to modular exponentiation to a power of 2 m . The Gerbicz-Li scheme was developed for PrimeGrid to overcome the limitation, verifying left-to-right modular exponentiation to any power n. Let L be the length of the binary expansion of n, so that n=n_02^0+n_12^1+\dots+n_{L-1}2^{L-1} . The process to be verified is to calculate u_i = a^{\lfloor n/2^i\rfloor} by the following recurrence relation: \begin{align}u_i=\begin{cases} 1 & L\le i \\ u_{i+1}^2\cdot a^{n_i} & \text{otherwise} \end{cases}\end{align} There is therefore a relation u_i = u_{i+j}^{2^j}a^{\left\lfloor\frac{n}{2^i}\right\rfloor\bmod 2^j} . As with the Gerbicz scheme, the calculating client saves u_0,u_{B},u_{2B},\dots for some constant B which is a multiple of L . It then checks the equivalences between u_{iB} and u_{(i+1)B} every B blocks, adding a random weight term w_i for soundness in the proof for security: \begin{align} \prod_{i=0} u_{iB}^{w_i} & \overset{\text{?}}{=} \prod_{i=0} u_{(i+1)B}^{w_i 2^B}a^{\left(\left\lfloor\frac{n}{2^{iB}}\right\rfloor\bmod 2^B\right) w_i} \\ & = \left(\prod_{i=0} u_{(i+1)B}^{w_i}\right)^{2^B}a^{\sum\limits_{i=0} \left(\left\lfloor\frac{n}{2^{iB}}\right\rfloor\bmod 2^B\right) w_i} \end{align} Hashing is similarly used to produce a non-interactive proof for use by PrimeGrid operators. Pavel Atnashev has further generalized Gerbicz-Li to the computation of arbitrary Lucas sequence terms with Q = -1 . This generalization is used in his "Morrison test", a generalization of the LLR test with Rödseth starting value, in the PrimeGrid software "PRST". The Prime Glossary: Certificate of Primality All primality certificates in factordb Vašek Chvátal. Lecture notes on Pratt's Primality Proofs. Department of Computer Science. Rutgers University. PDF version at Concordia University.

source: e01 Encyclopedia · licence: CC BY-SA 4.0 · page · source revision

Cite this

"Primality certificate". 1790705991. e01 Encyclopedia. CC BY-SA 4.0. https://en.wikipedia.org/w/index.php?oldid=1377515298

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·