Twisted Edwards Elliptic Curves for Zero-Knowledge Circuits
Abstract
:1. Introduction
1.1. Motivation
1.2. Our Contributions
1.3. Organization of the Paper
2. Related Work
3. Background
3.1. Zero-Knowledge Proofs
3.2. Elliptic Curves
Montgomery and Twisted Edwards Curves
- If , then the sum is a third point with coordinates
- If , then is a point with coordinates
4. Our Proposal
4.1. General Overview
- The prime order of the finite field the curve is defined over (which is the input p);
- Parameters a and d of the equation that defines the twisted Edwards curve;
- The order of the curve and its decomposition into the product of a cofactor and a large prime;
- A generator and a base point for the curve.
- Choice of Montgomery Equation: we start by deterministically generating a Montgomery elliptic curve over ;
- Choice of Generator and Base Points: we set the generator and base points of ;
- Transformation to Twisted Edwards: we convert the curve to its birationally equivalent twisted Edwards form and the generator and base points using the maps from Theorem 5;
- Optimization of Parameters: if possible, we rescale all parameters so that the arithmetic in the curve can be sped up [38].
4.2. Choice of Montgomery Equation
Algorithm 1. Generation of |
Input: prime number p Output: coefficients A, B, order n, cofactor h, prime l 1 fix. 2 start with . 3 if : 4 continue. 5 else : 6 increment A by 1 and go back to line 3. 7 if equation defines an elliptic curve over : 8 continue. 9 else : 10 increment A by 1 and go back to line 3. 11 compute the group order n and cofactor h. 12 if : 13 if (cofactor is 8 and cofactor of twist is 4) : 14 set . 15 else : 16 increment A by 1 and go back to line 3. 17 if : 18 if (cofactor and cofactor of twist is 4) : 19 set . 20 else : 21 increment A by 1 and go back to line 3. 22 compute. 23 returnA, B, n, h and l. |
4.3. Choice of Generator and Base Points
Algorithm 2. Generator and Base Points of |
Input: Montgomery curve , order n, cofactor h Output: generator , base point 1 start with . 2 find v such that is a point of . else, increment u by 1 and repeat the step. 3 check that has order n. else, increment u by 1 and go back to step 2. 4 set and . 5 return and . |
4.4. Transformation to Twisted Edwards
4.5. Optimization of Parameters
Algorithm 3. convert to E |
Input: Montgomery coefficients A, B, generator , base Output: twisted Edwards coefficients a, d, generator , base point 1 compute and . 2 compute . 3 compute . 4 set . 5 compute . 6 compute . 7 set . 8 return a, d, and . |
Algorithm 4. if possible, rescale E with |
Input: coefficients a, d, generator , base point Output: scaling factor f, coefficients , , generator , base point 1 if is a square in : 2 take . 3 set and . 4 compute and . 5 set and . 6 return f, , , and . 7 else : 8 set . 9 return f, a, d, and . |
5. Security Analysis
- The given number p is prime;
- The given parameters define an equation that corresponds to an elliptic curve;
- The product of h and l results into the order of the curve and the point is a generator;
- The given number l is prime and the point is a base point.
- Rho method (Section V.1, [17]): we require the cost for the rho method, which takes on average around additions, to be above ;
- Additive and multiplicative transfers (Section V.2, [17]): we require the embedding degree to be at least ;
- High discriminant (Section IX.3, [17]): we require the complex-multiplication field discriminant D to be larger than .
- Ladders [16]: check the curve supports the Montgomery ladder;
- Twists (twist, [18]): check if it is secure against the small-subgroup attack, invalid-curve attacks and twisted-attacks;
- Completeness (complete, [18]): check if the curve has complete single-scalar and multiple-scalar formulas. It is enough to check that there is only one point of order 2 and 2 of order 4;
- Indistinguishability [43]: check availability of maps that turn elliptic-curve points indistinguishable from uniform random strings.
6. Implementation
Listing 1. Generation of . |
Listing 2. Generator and base point of . |
Listing 3. Conversion of to E. |
Listing 4. Scaling of E to . |
7. Discussion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
Abbreviations
BN | Barreto–Naehrig |
BLS | Barreto–Lynn–Scott |
CCPA | California Consumer Privacy Act |
ECC | Elliptic-Curve Cryptography |
EdDSA | Edwards Digital Signature Algorithm |
EVM | Ethereum Virtual Machine |
GDPR | General Data Protection Regulation |
IRTF | Internet Research Task Force |
MNT | Miyaji–Nakabayashi–Takano |
NP | Nondeterministic Polynomial Time |
ZK | Zero-Knowledge |
ZK-SNARK | Zero-Knowledge Succinct Non-interactive Argument of Knowledge |
List of Mathematical Symbols
p | Prime number |
Finite field of order p | |
E | Elliptic curve in twisted Edwards form |
Elliptic curve in Montgomery form | |
n | Order of the elliptic curve |
l | Largest prime divisor of n |
h | Cofactor |
Generator of E | |
Generator of | |
Base point of E | |
Base point of |
Appendix A. Safety Checks against Known Attacks
Listing A1. Algorithm written in SAGE that verifies if a given twisted Edwards curve passes the checks described in Section 5. |
References
- Koblitz, N. Elliptic Curve Cryptosystems. Math. Comput. 1987, 48, 203–209. [Google Scholar] [CrossRef]
- Miller, V.S. Use of Elliptic Curves in Cryptography. In Advances in Cryptology—CRYPTO ’85 Proceedings, Proceedings of the Annual International Cryptology Conference, Santa Barbara, CA, USA, 18–22 August 1985; Williams, H.C., Ed.; Springer: Berlin/Heidelberg, Germany, 1986; pp. 417–426. [Google Scholar] [CrossRef] [Green Version]
- Hankerson, D.; Menezes, A.J.; Vanstone, S. Guide to Elliptic Curve Cryptography; Springer: Berlin, Heidelberg, Germany, 2003. [Google Scholar]
- Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. 2009. Available online: http://www.bitcoin.org/bitcoin.pdf (accessed on 30 October 2021).
- Noether, S.; Mackenzie, A.; Lab, T. Ring Confidential Transactions. Ledger 2016, 1, 1–18. [Google Scholar] [CrossRef]
- Ben-Sasson, E.; Chiesa, A.; Garman, C.; Green, M.; Miers, I.; Tromer, E.; Virza, M. Zerocash: Decentralized Anonymous Payments from Bitcoin. In Proceedings of the IEEE Symposium on Security and Privacy, Berkeley, CA, USA,, 18–21 May 2014; IEEE Computer Society: Los Alamitos, CA, USA, 2014; pp. 459–474. [Google Scholar] [CrossRef] [Green Version]
- Goldwasser, S.; Micali, S.; Rackoff, C. The knowledge complexity of interactive proof systems. SIAM J. Comput. 1989, 18, 186–208. [Google Scholar] [CrossRef]
- Parno, B.; Howell, J.; Gentry, C.; Raykova, M. Pinocchio: Nearly Practical Verifiable Computation. Commun. ACM 2016, 59, 103–112. [Google Scholar] [CrossRef]
- Groth, J. On the Size of Pairing-Based Non-interactive Arguments. In Advances in Cryptology—EUROCRYPT 2016; Springer: Berlin/Heidelberg, Germany, 2016; pp. 305–326. [Google Scholar] [CrossRef] [Green Version]
- Gabizon, A.; Williamson, Z.J.; Ciobotaru, O. PLONK: Permutations over Lagrange-Bases for Oecumenical Noninteractive Arguments of Knowledge. Cryptology ePrint Archive, Report 2019/953. 2019. Available online: https://ia.cr/2019/953 (accessed on 30 October 2021).
- WhiteHat, B.; Bellés, M.; Baylina, J. Baby Jubjub Elliptic Curve. Ethereum Improvement Proposal, EIP-2494. 29 January 2020. Available online: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2494.md (accessed on 30 October 2021).
- Electric Coin Company. What Is Jubjub? Available online: https://z.cash/technology/jubjub/ (accessed on 30 October 2021).
- Libert, B.; Mouhartem, F.; Stehlé, D. Notes from the Master Course Cryptology and Security at the École Normale Supérieure de Lyon. Tutorial 8, 2016–2017. Available online: https://fmouhart.epheme.re/Crypto-1617/TD08.pdf (accessed on 30 October 2021).
- Josefsson, S.; Liusvaara, I. Edwards-Curve Digital Signature Algorithm (EdDSA). Internet Research Task Force (IRTF). Request for Comments: 8032, January 2017. Available online: https://tools.ietf.org/html/8032 (accessed on 30 October 2021).
- Bernstein, D.J.; Birkner, P.; Joye, M.; Lange, T.; Peters, C. Twisted Edwards Curves. In Progress in Cryptology—AFRICACRYPT 2008; Vaudenay, S., Ed.; Springer: Berlin/Heidelberg, Germany, 2008; pp. 389–405. [Google Scholar] [CrossRef]
- Montgomery, P.L. Speeding the Pollard and Elliptic Curve Methods of Factorization. Math. Comput. 1987, 48, 243–246. [Google Scholar] [CrossRef]
- Blake, I.; Seroussi, G.; Smart, N. Elliptic Curves in Cryptography; London Mathematical Society Lecture Note Series; Cambridge University Press: Cambridge, UK, 1999; Volume 256. [Google Scholar]
- Bernstein, D.J.; Lange, T. SafeCurves: Choosing Safe Curves for Elliptic-Curve Cryptography. Available online: https://safecurves.cr.yp.to (accessed on 30 October 2021).
- European Parliament and Council of the European Union. Regulation (EU) 2016/679 of the EUROPEAN PARLIAMENT and of the Council of 27 April 2016 on the Protection of Natural Persons with Regard to the Processing of Personal Data and on the Free Movement of Such Data, and Repealing Directive 95/46/EC (General Data Protection Regulation). 2016. Available online: https://eur-lex.europa.eu/eli/reg/2016/679 (accessed on 30 October 2021).
- The California Consumer Privacy Act of 2018. An Act to Add Title 1.81.5 (Commencing with Section 1798.100) to Part 4 of Division 3 of the Civil Code, Relating to privacy, 2018. Available online: https://leginfo.legislature.ca.gov/faces/codes_displayText.xhtml?division=3.&part=4.&lawCode=CIV&title=1.81.5 (accessed on 30 October 2021).
- Bellés-Muñoz, M.; Baylina, J.; Daza, V.; Muñoz, J.L. New Privacy Practices for Blockchain Software. IEEE Softw. 2021. [Google Scholar] [CrossRef]
- Salleras, X.; Daza, V. ZPiE: Zero-Knowledge Proofs in Embedded Systems. Mathematics 2021, 9, 2569. [Google Scholar] [CrossRef]
- Sestrem Ochôa, I.; Reis Quietinho Leithardt, V.; Calbusch, L.; De Paz Santana, J.F.; Delcio Parreira, W.; Oriel Seman, L.; Albenes Zeferino, C. Performance and Security Evaluation on a Blockchain Architecture for License Plate Recognition Systems. Appl. Sci. 2021, 11, 1255. [Google Scholar] [CrossRef]
- Barreto, P.S.L.M.; Naehrig, M. Pairing-Friendly Elliptic Curves of Prime Order. In Proceedings of the 12th International Conference on Selected Areas in Cryptography (SAC’05), Kingston, ON, Canada, 11–12 August 2005; Springer: Berlin/Heidelberg, Germany, 2005; pp. 319–331. [Google Scholar] [CrossRef] [Green Version]
- Barreto, P.S.L.M.; Lynn, B.; Scott, M. Constructing Elliptic Curves with Prescribed Embedding Degrees. In Security in Communication Networks; Springer: Berlin/Heidelberg, Germany, 2003; pp. 257–267. [Google Scholar] [CrossRef]
- Kasamatsu, K.; Kanno, S.; Kobayashi, T.; Kawahara, Y. Barreto-Naehrig Curves. Network Working Group. Internet-Draft. February 2014. Available online: https://tools.ietf.org/html/draft-kasamatsu-bncurves-01 (accessed on 30 October 2021).
- Yonezawa, S.; Chikara, S.; Kobayashi, T.; Saito, T. Pairing-Friendly Curves. Network Working Group. Internet-Draft. January 2019. Available online: https://tools.ietf.org/html/draft-yonezawa-pairing-friendly-curves-00 (accessed on 30 October 2021).
- Masson, S.; Sanso, A.; Zhang, Z. Bandersnatch: A Fast Elliptic Curve Built over the BLS12-381 Scalar Field. Cryptology ePrint Archive, Report 2021/1152. 2021. Available online: https://ia.cr/2021/1152 (accessed on 30 October 2021).
- Ben-Sasson, E.; Chiesa, A.; Tromer, E.; Virza, M. Scalable Zero Knowledge via Cycles of Elliptic Curves. In Advances in Cryptology—CRYPTO 2014; Garay, J.A., Gennaro, R., Eds.; Springer: Berlin/Heidelberg, Germay, 2014; pp. 276–294. [Google Scholar] [CrossRef] [Green Version]
- Bowe, S.; Chiesa, A.; Green, M.; Miers, I.; Mishra, P.; Wu, H. ZEXE: Enabling Decentralized Private Computation. In Proceedings of the 2020 IEEE Symposium on Security and Privacy (SP), San Francisco, CA, USA, 18–21 May 2020; IEEE Computer Society: Los Alamitos, CA, USA, 2020; pp. 947–964. [Google Scholar] [CrossRef]
- Housni, Y.E.; Guillevic, A. Optimized and Secure Pairing-Friendly Elliptic Curves Suitable for One Layer Proof Composition. Cryptology ePrint Archive, Report 2020/351. 2020. Available online: https://ia.cr/2020/351 (accessed on 30 October 2021).
- Miyaji, A.; Nakabayashi, M.; Nonmembers, S. New explicit conditions of elliptic curve traces for FR-reduction. IEICE Trans. Fundam. Electron. Commun. Comput. Sci. 2001, 84, 1234–1243. [Google Scholar]
- Koblitz, N. A Course in Number Theory and Cryptography, 2nd ed.; Graduate Texts in Mathematics; Springer: Berlin/Heidelberg, Germany, 1994. [Google Scholar]
- Silverman, J.H. The Arithmetic of Elliptic Curves. Graduate Texts in Mathematics; Springer: New York, NY, USA, 1994; Volume 106. [Google Scholar]
- Washington, L.C. Elliptic Curves. Number Theory and Cryptography, 2nd ed.; Chapman & Hall/CRC Press: Boca Raton, FL, USA, 2008. [Google Scholar]
- Okeya, K.; Kurumatani, H.; Sakurai, K. Elliptic Curves with the Montgomery-Form and Their Cryptographic Applications. In Proceedings of the Third International Workshop on Practice and Theory in Public Key Cryptography: Public Key Cryptography (PKC ’00), Melbourne, VIC, Australia, 18–20 January 2000; Springer: London, UK, 2000; pp. 238–257. [Google Scholar] [CrossRef] [Green Version]
- Bernstein, D.J.; Lange, T. Faster Addition and Doubling on Elliptic Curves. In Advances in Cryptology—ASIACRYPT 2007; Springer: Berlin/Heidelberg, Germany, 2007; pp. 29–50. [Google Scholar] [CrossRef] [Green Version]
- Hisil, H.; Wong, K.K.H.; Carter, G.; Dawson, E. Twisted Edwards Curves Revisited. In Advances in Cryptology—ASIACRYPT 2008; Springer: Berlin/Heidelberg, Germany, 2008; pp. 326–343. [Google Scholar] [CrossRef] [Green Version]
- Langley, A.; Hamburg, M.; Turner, S. Elliptic Curves for Security. Internet Research Task Force (IRTF). Request for Comments: 7748. January 2016. Available online: https://tools.ietf.org/html/7748 (accessed on 30 October 2021).
- Bowe, S. Derivation of Jubjub Elliptic Curve. GitHub. 2019. Available online: https://github.com/zkcrypto/jubjub/blob/master/doc/derive/derive.sage (accessed on 30 October 2021).
- Bernstein, D.J.; Lange, T. Montgomery curves and the Montgomery Ladder. Cryptology ePrint Archive, Report 2017/293. 2017. Available online: https://ia.cr/2017/293 (accessed on 30 October 2021).
- Hopwood, D. Supporting Evidence for Security of the Jubjub Curve to Be Used in Zcash. Available online: https://github.com/daira/jubjub/blob/master/verify.sage (accessed on 30 October 2021).
- Bernstein, D.J.; Hamburg, M.; Krasnova, A.; Lange, T. Elligator: Elliptic-Curve Points Indistinguishable from Uniform Random Strings. In Proceedings of the 2013 ACM SIGSAC Conference on Computer and Communications Security (CCS ’13), Berlin, Germany, 4–8 November 2013; Association for Computing Machinery: New York, NY, USA, 2013; pp. 967–980. [Google Scholar] [CrossRef] [Green Version]
- WhiteHat, B. Baby Jubjub Supporting Evidence. GitHub. 2018. Available online: https://github.com/barryWhiteHat/baby_jubjub (accessed on 30 October 2021).
- Singh, S.K.; Tanwar, S. Analysis of Software Testing Techniques: Theory to Practical Approach. Indian J. Sci. Technol. 2016, 9, 1–6. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Bellés-Muñoz, M.; Whitehat, B.; Baylina, J.; Daza, V.; Muñoz-Tapia, J.L. Twisted Edwards Elliptic Curves for Zero-Knowledge Circuits. Mathematics 2021, 9, 3022. https://doi.org/10.3390/math9233022
Bellés-Muñoz M, Whitehat B, Baylina J, Daza V, Muñoz-Tapia JL. Twisted Edwards Elliptic Curves for Zero-Knowledge Circuits. Mathematics. 2021; 9(23):3022. https://doi.org/10.3390/math9233022
Chicago/Turabian StyleBellés-Muñoz, Marta, Barry Whitehat, Jordi Baylina, Vanesa Daza, and Jose Luis Muñoz-Tapia. 2021. "Twisted Edwards Elliptic Curves for Zero-Knowledge Circuits" Mathematics 9, no. 23: 3022. https://doi.org/10.3390/math9233022
APA StyleBellés-Muñoz, M., Whitehat, B., Baylina, J., Daza, V., & Muñoz-Tapia, J. L. (2021). Twisted Edwards Elliptic Curves for Zero-Knowledge Circuits. Mathematics, 9(23), 3022. https://doi.org/10.3390/math9233022