60 research outputs found

    Faster constant-time evaluation of the Kronecker symbol with application to elliptic curve hashing

    Get PDF
    We generalize the Bernstein-Yang (BY) algorithm for constant-time modular inversion to compute the Kronecker symbol, of which the Jacobi and Legendre symbols are special cases. We start by developing a basic and easy-to-implement divstep version of the algorithm defined in terms of full-precision division steps. We then describe an optimized version due to Hamburg over word-sized inputs, similar to the jumpdivstep version of the BY algorithm, and formally verify its correctness. Along the way, we introduce a number of optimizations for implementing both versions in constant time and at high-speed. The resulting algorithms are particularly suitable for the special case of computing the Legendre symbol with dense prime pp, where no efficient addition chain is known for the conventional approach by exponentiation to p12\frac{p-1}{2}. This is often the case for the base field of popular pairing-friendly elliptic curves. Our high-speed implementation for a range of parameters shows that the new algorithm is up to 40 times faster than the conventional exponentiation approach, and up to 25.7\% faster than the previous state of the art. We illustrate the performance of the algorithm with an application for hashing to elliptic curves, where the observed savings amount to 14.7\% -- 48.1\% when used for testing quadratic residuosity within the SwiftEC hashing algorithm. We also apply our techniques to the CTIDH isogeny-based key exchange, with savings of 3.5--13.5\%

    Efficient indifferentiable hashing to elliptic curves y2=x3+by^2 = x^3 + b provided that bb is a quadratic residue

    Get PDF
    Let F ⁣q\mathbb{F}_{\!q} be a finite field and Eb ⁣:y2=x3+bE_b\!: y^2 = x^3 + b be an ordinary elliptic F ⁣q\mathbb{F}_{\!q}-curve of jj-invariant 00 such that bF ⁣q\sqrt{b} \in \mathbb{F}_{\!q}. In particular, this condition is fulfilled for the curve BLS12-381 and for one of sextic twists of the curve BW6-761 (in both cases b=4b=4). These curves are very popular in pairing-based cryptography. The article provides an efficient constant-time encoding h ⁣:F ⁣qEb(F ⁣q)h\!: \mathbb{F}_{\!q} \to E_b(\mathbb{F}_{\!q}) of an absolutely new type for which q/6#Im(h)q/6 \leqslant \#\mathrm{Im}(h). We prove that at least for q4 (mod 9)q \equiv 4 \ (\mathrm{mod} \ 9) the hash function H ⁣:{0,1}Eb(F ⁣q)H\!: \{0,1\}^* \to E_b(\mathbb{F}_{\!q}) induced by hh is indifferentiable from a random oracle. The main idea of our encoding consists in extracting in F ⁣q\mathbb{F}_{\!q} (for q1 (mod 3)q \equiv 1 \ (\mathrm{mod} \ 3)) a cubic root instead of a square root as in the well known (universal) SWU encoding and in its simplified analogue. Besides, the new hashing can be implemented without quadratic and cubic residuosity tests (as well as without inversions) in F ⁣q\mathbb{F}_{\!q}. Thus in addition to the protection against timing attacks, HH is much more efficient than the SWU hash function, which generally requires to perform 44 quadratic residuosity tests in F ⁣q\mathbb{F}_{\!q}. For instance, in the case of BW6-761 this allows to avoid approximately 4 ⁣ ⁣76130004 \!\cdot\! 761 \approx 3000 field multiplications

    SwiftEC: Shallue–van de Woestijne Indifferentiable Function To Elliptic Curves

    Get PDF
    Hashing arbitrary values to points on an elliptic curve is a required step in many cryptographic constructions, and a number of techniques have been proposed to do so over the years. One of the first ones was due to Shallue and van de Woestijne (ANTS-VII), and it had the interesting property of applying to essentially all elliptic curves over finite fields. It did not, however, have the desirable property of being indifferentiable from a random oracle when composed with a random oracle to the base field. Various approaches have since been considered to overcome this limitation, starting with the foundational work of Brier et al. (CRYPTO 2011). For example, if f ⁣:FqE(Fq)f\colon \mathbb{F}_q\to E(\mathbb{F}_q) is the Shallue--van de Woestijne (SW) map and h1,h2\mathfrak{h}_1,\mathfrak{h}_2 are two independent random oracles to Fq\mathbb{F}_q, we now know that mf(h1(m))+f(h2(m))m\mapsto f\big(\mathfrak{h}_1(m)\big)+f\big(\mathfrak{h}_2(m)\big) is indifferentiable from a random oracle. Unfortunately, this approach has the drawback of being twice as expensive to compute than the straightforward, but not indifferentiable, mf(h1(m))m\mapsto f\big(\mathfrak{h}_1(m)\big). Most other solutions so far have had the same issue: they are at least as costly as two base field exponentiations, whereas plain encoding maps like ff cost only one exponentiation. Recently, Koshelev (DCC 2022) provided the first construction of indifferentiable hashing at the cost of one exponentiation, but only for a very specific class of curves (some of those with jj-invariant 00), and using techniques that are unlikely to apply more broadly. In this work, we revisit this long-standing open problem, and observe that the SW map actually fits in a one-parameter family (fu)uFq(f_u)_{u\in\mathbb{F}_q} of encodings, such that for independent random oracles h1,h2\mathfrak{h}_1, \mathfrak{h}_2 to Fq\mathbb{F}_q, F ⁣:mfh2(m)(h1(m))F\colon m\mapsto f_{\mathfrak{h}_2(m)}\big(\mathfrak{h}_1(m)\big) is indifferentiable. Moreover, on a very large class of curves (essentially those that are either of odd order or of order divisible by 4), the one-parameter family admits a rational parametrization, which let us compute FF at almost the same cost as small ff, and finally achieve indifferentiable hashing to most curves with a single exponentiation. Our new approach also yields an improved variant of the Elligator Squared technique of Tibouchi (FC 2014) that represents points of arbitrary elliptic curves as close-to-uniform random strings

    Batch point compression in the context of advanced pairing-based protocols

    Get PDF
    This paper continues previous ones about compression of points on elliptic curves Eb ⁣:y2=x3+bE_b\!: y^2 = x^3 + b (with jj-invariant 00) over a finite field F ⁣q\mathbb{F}_{\!q} of characteristic p>3p > 3. It is shown in detail how any two (resp., three) points from Eb(F ⁣q)E_b(\mathbb{F}_{\!q}) can be quickly compressed to two (resp., three) elements of F ⁣q\mathbb{F}_{\!q} (apart from a few auxiliary bits) in such a way that the corresponding decompression stage requires to extract only one cubic (resp., sextic) root in F ⁣q\mathbb{F}_{\!q}. As a result, for many fields F ⁣q\mathbb{F}_{\!q} occurring in practice, the new compression-decompression methods are more efficient than the classical one with the two (resp., three) xx or yy coordinates of the points, which extracts two (resp., three) roots in F ⁣q\mathbb{F}_{\!q}. As a by-product, it is also explained how to sample uniformly at random two (resp., three) ``independent\u27\u27 F ⁣q\mathbb{F}_{\!q}-points on EbE_b essentially at the cost of only one cubic (resp., sextic) root in F ⁣q\mathbb{F}_{\!q}. Finally, the cases of four and more points from Eb(F ⁣q)E_b(\mathbb{F}_{\!q}) are commented on as well

    Poseidon: A New Hash Function for Zero-Knowledge Proof Systems

    Get PDF
    The area of practical computational integrity proof systems, like SNARKs, STARKs, Bulletproofs, is seeing a very dynamic development with several constructions having appeared recently with improved properties and relaxed setup requirements. Many use cases of such systems involve, often as their most expensive part, proving the knowledge of a preimage under a certain cryptographic hash function, which is expressed as a circuit over a large prime field. A notable example is a zero-knowledge proof of coin ownership in the Zcash cryptocurrency, where the inadequacy of the SHA-256 hash function for such a circuit caused a huge computational penalty. In this paper, we present a modular framework and concrete instances of cryptographic hash functions which work natively with GF(p) objects. Our hash function Poseidon uses up to 8x fewer constraints per message bit than Pedersen Hash. Our construction is not only expressed compactly as a circuit, but can also be tailored for various proof systems using specially crafted polynomials, thus bringing another boost in performance. We demonstrate this by implementing a 1-out-of-a-billion membership proof with Merkle trees in less than a second by using Bulletproofs

    A note on group membership tests for \G_1, \G_2 and \G_T on BLS pairing-friendly curves

    Get PDF
    Here we consider a method for quickly testing for group membership in the groups \G_1, \G_2 and \G_T (all of prime order rr) as they arise on a type-3 pairing-friendly curve. As is well known endomorphisms exist for each of these groups which allows for faster point multiplication for elements of order rr. The endomorphism applies if an element is of order rr. Here we show that, under relatively mild conditions, the endomorphism applies {\bf if and only if} an element is of order rr. This results in a faster method of confirming group membership. In particular we show that the conditions are met for the popular BLS family of curves

    The inspection model for zero-knowledge proofs and efficient Zerocash with secp256k1 keys

    Get PDF
    Proving discrete log equality for groups of the same order is addressed by Chaum and Pedersen\u27s seminal work. However, there has not been a lot of work in proving discrete log equality for groups of different orders. This paper presents an efficient solution, which leverages a technique we call delegated Schnorr. The discovery of this technique is guided by a design methodology that we call the inspection model, and we find it useful for protocol designs. We show two applications of this technique on the Findora blockchain: **Maxwell-Zerocash switching:** There are two privacy-preserving transfer protocols on the Findora blockchain, one follows the Maxwell construction and uses Pedersen commitments over Ristretto, one follows the Zerocash construction and uses Rescue over BLS12-381. We present an efficient protocol to convert assets between these two constructions while preserving the privacy. **Zerocash with secp256k1 keys:** Bitcoin, Ethereum, and many other chains do signatures on secp256k1. There is a strong need for ZK applications to not depend on special curves like Jubjub, but be compatible with secp256k1. Due to FFT unfriendliness of secp256k1, many proof systems (e.g., Groth16, Plonk, FRI) are infeasible. We present a solution using Bulletproofs over curve secq256k1 ( q ) and delegated Schnorr which connects Bulletproofs to TurboPlonk over BLS12-381. We conclude the paper with (im)possibility results about Zerocash with only access to a deterministic ECDSA signing oracle, which is the case when working with MetaMask. This result shows the limitations of the techniques in this paper. This paper is under a bug bounty program through a grant from Findora Foundation

    Hashing to elliptic curves of j=0j=0 and quadratic imaginary orders of class number 22

    Get PDF
    In this article we produce the simplified SWU encoding to some Barreto--Naehrig curves, including BN512, BN638 from the standards ISO/IEC 15946-5 and TCG Algorithm Registry respectively. Moreover, we show (for any jj-invariant) how to implement the simplified SWU encoding in constant time of one exponentiation in the basic field, namely without quadratic residuosity tests and inversions. Thus in addition to the protection against timing attacks, the new encoding turns out to be much more efficient than the (universal) SWU encoding, which generally requires to perform two quadratic residuosity tests
    corecore