Giter VIP home page Giter VIP logo

ss-isogeny-software's Introduction

Quantum-Resistant Cryptosystems from Supersingular Elliptic Curve Isogenies

Copyright 2011-2016 Luca De Feo http://defeo.lu/.

This software implements the cryptosystem described in

D. Jao and L. De Feo, Towards quantum-resistant cryptosystems from supersingular elliptic curve isogenies. Post-Quantum Cryptography, Nov 2011, Taipei, Taiwan. Springer, LNCS 7071, pp. 19-34, 2011.

L. De Feo, D. Jao and J. Plût, Towards quantum-resistant cryptosystems from supersingular elliptic curve isogenies. Journal of Mathematical Cryptology, 8(3), pp. 209-247. De Gruyter, 2014.

WARNING: This code is obsolete. For a modern treatment, please see the official code for the NIST candidate SIKE, and the additional implementations referenced here.

Installation

Just clone or download this repo.

You will need a recent version of Sage and a C compiler. This version has been tested with Sage 6.10 and gcc 5.2.1.

Usage

In a Sage shell type

sage: load('pqcrypto11.sage')

Some predefined key sizes are stored in a string-indexed dictionary called 'parameters'. Read pqcrypto11.sage to find them out.

Public data for a cryptosystem are generated via a call to ss_isogeny_gen. For example, to obtain parameters relative to a 40-bit prime, type

sage: set_verbose(1)
sage: pdata = ss_isogeny_gen(**parameters['2-3-40'])

The key exchange is performed by ss_isogeny_exchange. Type

sage: ss_isogeny_exchange(*pdata)
sage: set_verbose(0)

The function ss_isogeny runs both previous functions in one. The previous sequence of commands is equivalent to

sage: ss_isogeny('2-3-40', verbose=1)

Additional parameters can be passed to these functions, read pqcrypto11.sage.

NOTE: The file gfp2.c can be compiled as a standalone program with

gcc -lgmp gfp2.c

Then it can be run to gather estimates on the running times of doublings, triplings, 2 and 3-isogeny evaluations. These data can be used to tune up (via the dictionary "weights" in pqcrypto11.sage) the key exchange algorithm.

Thanks

Many thanks to those who have helped in testing and fixing this software.

  • David Jao,
  • Jérôme Plût,
  • Erik Nellessen.
  • Adarsh Saraf,
  • Srinath,
  • Miha Marolt @miham

ss-isogeny-software's People

Contributors

defeo avatar jeromeplut avatar miham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ss-isogeny-software's Issues

Accessing invalid memory because of bug in GMP results in failed key exchange

There is a bug in GMP [1] that in SSIKE software results in accessing invalid (previously freed) memory and subsequently in failing to successfully calculate the same shared key on Alice's and Bob's side.

According to the following comment in gfp2.c,

/*
  There seems to be a bug in GMP 4.2.1 that makes mpz_mod give
  unpredictable results when the mpz_t holding the result is the same
  as one of the operands.
*/

you already suspected something, but what you describe there is just a symptom. The underlying problem is that when input and output mpz_t variables are copies of one another (if they are the same, then there is no problem), invalid memory accesses occur and you get unpredictable behavior - sometimes the calculated value will be correct despite accessing invalid memory, sometimes it will be wrong.

In my testing (using a modified version of you SSIKE software) this bug manifested itself in sporadically wrong results from neg_GF() or more specifically mpz_sub() inside it. In your testing bug might manifest itself somewhere else. So the correct way to fix this bug is to not use multiple copies of the same mpz_t object unless they are all read-only.

See [1] for code that ilustrates the bug. There pair_t is similar to GF in SSIKE.

[1] https://gmplib.org/list-archives/gmp-bugs/2016-April/003939.html

Sagemath 8.1

It would seem that there is some issue with Cython, it can't seem to find the .pxd file when using cimport.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.